8000 DOC updated hexbin documentation to numpydoc format. by dcmarcu · Pull Request #7170 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC updated hexbin documentation to numpydoc format. #7170

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 6 commits into from
Sep 28, 2016

Conversation

dcmarcu
Copy link
Contributor
@dcmarcu dcmarcu commented Sep 23, 2016

No description provided.

Copy link
Member
@NelleV NelleV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Thanks for the patch!
There is a bit of work to be done before we can merge it.

  • Check that the code is pep8 compliant. Right now, it has whitespace issues (blank line contain whitespace, and there are trailing whitespaces).
  • It would be great to add the default of each parameter after the optional mention.
  • I have underlined some issues in the text that need to be addressed for numpydoc to be able to parse the docstring properly.

Thanks a lot for this PR! The docstring is now much more readable.

Order of scalars is (left, right, bottom, top).

Other parameters
----------------
Other keyword arguments controlling color mapping and normalization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will not be rendered properly by numpydoc. You need to remove it.


See 8000 also
--------
The standard descriptions of all the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "See Also" section is meant for other functions, methods or modules. This format will not be understood properly by numpdoc.
I think you should be using the "Notes" section instead of the "See Also" section.
It is also possible that the %(Collection)s needs tweaking, but I need to build the documentation to check this.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Sep 24, 2016
@NelleV NelleV changed the title DOC updated hexbin documentation to numpydoc format. [MRG+1] DOC updated hexbin documentation to numpydoc format. Sep 25, 2016
@@ -4188,7 +4188,8 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
sequence of floats, as required by
:class:`~matplotlib.collections.RegularPolyCollection`.

edgecolors : {'none'}, mpl color, color sequence, optional, default is 'none'
edgecolors : {'none'}, mpl color, color sequence, optional,
default is 'none'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you indent this line and drop the coma at the end of the previous line? My guess is that sphinx is going to complain about this.

Copy link
Member
@efiring efiring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The basic problem here is that the hexbin docstring needs more than a simple reformatting because the original docstring has sections that are incorrect or at best misleading. I'm not sure I have caught all of them.

----------
x : array
may be masked array, in which case only unmasked points
will be plotted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see a reduction of the repetition here. I think that for x, y, C you can just say "array or masked array" on the top line. No need to spell out that masked points will be ignored. Or, a note like the original single sentence about masked arrays can be put somewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuLogic has the right suggestion below, applicable here also: group x, y : array or masked array. C needs its own line because it is optional.

is used. Note if you pass a norm instance, your settings
for *vmin* will be ignored.

vmax : scalar, optional, default is *None*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can consolidate: Under vmin, say "see vmax". Under vmax, concisely describe what they do; it is mostly the same, so you can minimize repetition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can be put together as the same entry with vmin, vmax : scalar, ...

linewidths : scalar, optional, default is *None*
If *None*, defaults to 1.0. Note that this is a tuple, and
if you set the linewidths argument you must set it as a
sequence of floats, as required by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is repeating the original incorrect description. In fact, only a scalar makes sense here, although a sequence can be accepted if it is not too long. I can't see any reasonable use case for a sequence of length other than 1, for which one might as well use a scalar. So, please delete the sentence starting with "Note".

If *None*, draws the outlines in the default color.

If a matplotlib color arg or sequence of rgba tuples, draws the
outlines in the specified color.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, for hexbin, specifying anything other than a single color makes no sense: first, because one doesn't know at this point where the hexagon getting that edge color will be, and second, because even if one did, it would be nonsensical from a plotting standpoint. So please omit everything having to do with the color sequence.

Copy link
Member
@efiring efiring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed one more consistency problem.

If 'log', use a logarithmic scale for the color
map. Internally, :math:`log_{10}(i+1)` is used to
determine the hexagon color.
gridsize : int, optional, default is 100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should say something like "int, (int, int), optional, default is 100".

@NelleV
Copy link
Member
NelleV commented Sep 28, 2016

Thanks!

@NelleV NelleV merged commit 9df6829 into matplotlib:master Sep 28, 2016
tacaswell pushed a commit that referenced this pull request Sep 28, 2016
[MRG+1] DOC updated hexbin documentation to numpydoc format.
@tacaswell
Copy link
Member

backported to v2.x as 1d8435a

@QuLogic QuLogic changed the title [MRG+1] DOC updated hexbin documentation to numpydoc format. DOC updated hexbin documentation to numpydoc format. Oct 15, 2016
@QuLogic QuLogic modified the milestones: 2.0.1 (next bug fix release), 2.0 (style change major release) Dec 7, 2016
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.

6 participants
0