Skip to content

Convert docstring of Axes.pie() into numpydoc #8357

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

Closed
wants to merge 22 commits into from

Conversation

kahnchana
Copy link
Contributor

Reference Issue #8272

What does this implement/fix? Explain your changes.

The docstring of the function pie() in lib/matplotlib/axes/_axes.py has been converted to numpydoc format. Also, pep-8 style errors in the code have been fixed.

@QuLogic
Copy link
Member

QuLogic commented Mar 21, 2017

There's a lot of extraneous whitespace changes here. While correcting this is not unwelcome, it makes it rather difficult to say what parts of this change are actually relevant. It would be better to have a separate PR for whitespace correction, or only do it on the parts that you are actually editing.

Also, please write actual commit message, not just a single dot.

@kahnchana
Copy link
Contributor Author

Added the changes you suggested. I removed all the whitespace fixing. Will create a separate issue for that later. And added the exact commit name. Sorry about previous mistake.

@QuLogic
Copy link
Member

QuLogic commented Mar 22, 2017

Hmm, I should have been a bit clearer. It's not good to revert this because now there's a commit making the whitespace changes and another commit undoing those, and then if you open a separate PR, there'll be another commit fixing the whitespace again.

If you know how to rebase, it would be a little better if you rebased and squashed these commits all into a single one.


*explode*: [ *None* | len(x) sequence ]
explode: None or array
Copy link
Member

Choose a reason for hiding this comment

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

Add a space before the colon for all parameters.

Draw a shadow beneath the pie.

*startangle*: [ *None* | Offset angle ]
startangle: None or Offset angle
Copy link
Member

Choose a reason for hiding this comment

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

Offset angle is not a type; should be float.


*frame*: [ *False* | *True* ]
Plot axes frame with the chart.
center: list of int
Copy link
Member

Choose a reason for hiding this comment

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

Extra space. Also, why int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad. Changing to float.

ax = axes([0.1, 0.1, 0.8, 0.8])
Returns
-------
patches: list
Copy link
Member

Choose a reason for hiding this comment

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

Also add space before colon of every return value.

axes(aspect=1)
autotexts: list
A is a list of :class:`~matplotlib.text.Text` instances for the
numeric labels. Is returned only is if parameter *autopct* is
Copy link
Member

Choose a reason for hiding this comment

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

is if -> if

A is a list of :class:`~matplotlib.text.Text` instances for the
numeric labels. Is returned only is if parameter *autopct* is
not *None*. If *autopct* is *None*, the tuple returned
is (patches, texts).
Copy link
Member

Choose a reason for hiding this comment

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

Leave out this last sentence.

kahnchana and others added 15 commits March 22, 2017 11:52
# Conflicts:
#	lib/matplotlib/tests/test_backend_pgf.py
from "as mtrans" into "as mtransforms"
Rather than closing over it and relying on it being defined in the
top-level function namespace.
In cases were a filename is passed in we clean up the temporary file
by renaming it to the output file, however if a file handle is passed
in we copy the contents into that the file and do not clean up the
temporary file.

Use a try...finally block to always remove the temporary file, even if
things go wrong.
In cases were a filename is passed in we clean up the temporary file
by renaming it to the output file, however if a file handle is passed
in we copy the contents into that the file and do not clean up the
temporary file.

Use a try...finally block to always remove the temporary file, even if
things go wrong.
Converts the docstring of pie() function in _ axes.py into numpydoc
# Conflicts:
#	lib/matplotlib/tests/test_backend_pgf.py
Added spacing between colons and made the changes pointed out
@kahnchana
Copy link
Contributor Author

kahnchana commented Mar 22, 2017

I tried rebasing and made a mistake. I ended up adding additional commits. I am trying to fix this and figure out the rebasing.

Also made the changes suggested in: Made style changes and edits suggested (a0c7bd8)

@kahnchana
Copy link
Contributor Author

Shall I remove this PR and open a new PR with the changes you suggested?

@dstansby dstansby added this to the 2.0.1 (next bug fix release) milestone Mar 24, 2017
@dstansby
Copy link
Member

It looks like quite a few things have gone wrong with git here; if it would be easier for you to open a new PR, please feel free!

@phobson
Copy link
Member

phobson commented Mar 24, 2017

@kahnchana I have cleaned up the commits to this branch locally.

I'm closing this in favor of #8371

@phobson phobson closed this Mar 24, 2017
@QuLogic QuLogic changed the title [MRG] Convert docstring of Axes.pie() into numpydoc Convert docstring of Axes.pie() into numpydoc Mar 25, 2017
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