Switch grid documentation to numpydoc style #11760
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
IMHO the docstring is good now.
The underlying code still has some issues:
axis
argument is not checked for sanity. Arbitrary values are taken, in which case the function silently does nothing. This should complain.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.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?)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 asgrid(True, color='r')
orgrid(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.