Skip to content

Switch grid documentation to numpydoc style #11760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jul 23, 2018

PR Summary

IMHO the docstring is good now.

The underlying code still has some issues:

  • The axis argument is not checked for sanity. Arbitrary values are taken, in which case the function silently does nothing. This should complain.
  • The which argument is not checked for sanity. Arbitrary values are taken, in which case the function silently does nothing, except for marking the axis as stale. This should complain.
  • The supported which values can have arbitrary capitalization. This is not documented. May be ok (I don't want to advertise this feature. On the other hand, it's probably not that important that we would want to break user code by removing that function?)
  • While Axes.grid supports "textual" bools such as "on", Axis.grid does not. This an unexpected mismatch in API functionality. It should be either both or none of them. Do we have a policy for that?
  • grid(False, color='r') is the same as grid(True, color='r') or grid(color='r'). While the behavior is correctly documented, grid(False, color='r') should at least issue a warning if not an error. It simply does not make sense and likely means that the user is not aware of what he's actually doing.

These can be addressed in a separte PR. I would like to keep this PR docstring-only.

@QuLogic
Copy link
Member

QuLogic commented Jul 23, 2018

While Axes.grid supports "textual" bools such as "on", Axis.grid does not. This an unexpected mismatch in API functionality. It should be either both or none of them. Do we have a policy for that?

This was deprecated elsewhere (tick_params), so it should probably be done here too.

@anntzer
Copy link
Contributor

anntzer commented Jul 25, 2018

The deprecation is actually in the helper method (_string_to_bool), so no need for additional changes here. @timhoffm Perhaps open a separate issue to track the other points you raised? Up to you.

@anntzer anntzer merged commit 1fc18be into matplotlib:master Jul 25, 2018
@timhoffm timhoffm deleted the doc-grid branch July 25, 2018 19:52
@QuLogic QuLogic added this to the v3.0 milestone Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants