Skip to content

DOC: Clean up the pie docstring PR #8371

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 4 commits into from
Mar 25, 2017
Merged

Conversation

phobson
Copy link
Member

@phobson phobson commented Mar 24, 2017

Supersedes #8357

Builds upon @kahnchana 's work with some minor reorganization


- *patches* is a sequence of
:class:`matplotlib.patches.Wedge` instances
.. plot:: mpl_examples/pie_and_polar_charts/pie_demo_features.py
Copy link
Member

Choose a reason for hiding this comment

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

Soon, we won't need this anymore :D

Copy link
Member Author

Choose a reason for hiding this comment

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

@NelleV curious: what does the future look like in this regard?

Copy link
Member

Choose a reason for hiding this comment

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

On matplotlib, I am not sure, as our pyplot API page is gigantic, but on sklearn it looks like this:
http://scikit-learn.org/stable/modules/generated/sklearn.isotonic.IsotonicRegression.html#sklearn.isotonic.IsotonicRegression

If you scroll down, you'll see all examples using the isotonic regression (there's only one).
I am not sure how to activate this feature just yet, but that is my next step :)

Copy link
Member Author

Choose a reason for hiding this comment

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

oooooooh fancy!

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.

There's a merge/rebase problem in here.

@needs_xelatex
@pytest.mark.style('default')
@pytest.mark.backend('pgf')
=======
Copy link
Member

Choose a reason for hiding this comment

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

There's a problem in this file.

@phobson
Copy link
Member Author

phobson commented Mar 24, 2017

@NelleV I forgot that the test_backend_pgf file had been modified in the original PR. I took that out along with the other extraneous whitespace changes

@NelleV
Copy link
Member

NelleV commented Mar 24, 2017

Feel free to self-merge once the tests pass. This has been approved already in the previous PR.

@phobson
Copy link
Member Author

phobson commented Mar 24, 2017

@NelleV Does this error from the doc build mean anything to you?

/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes.Axes.pie:97: ERROR: Error in "rubric" directive:
no content permitted.

.. rubric:: Examples

        .. plot:: mpl_examples/pie_and_polar_charts/pie_demo_features.py

Building HTML failed.

@NelleV
Copy link
Member

NelleV commented Mar 24, 2017

It's an indentation problem. That's all I can say :(

@phobson
Copy link
Member Author

phobson commented Mar 24, 2017

Ok, I'll dig into that later

@QuLogic
Copy link
Member

QuLogic commented Mar 24, 2017

The previous PR was never approved, so please don't self-merge.

@phobson
Copy link
Member Author

phobson commented Mar 24, 2017

@QuLogic don't worry. wasn't going to after seen that weird "rubric" failure.

@@ -2682,9 +2684,9 @@ def get_next_color():
self.set_frame_on(False)

self.set_xlim((-1.25 + center[0],
1.25 + center[0]))
1.25 + center[0]))
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 not indented correctly.


*explode*: [ *None* | len(x) sequence ]
explode : array-like, 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.

I think our convention has been optional, default: None.

If not *None*, is a string or function used to label the wedges
with their numeric value. The label will be placed inside the
wedge. If it is a format string, the label will be ``fmt%pct``.
If it is a function, it will be called.

*pctdistance*: scalar
pctdistance : float, optional (default is 0.6)
The ratio between the center of each pie slice and the
start of the text generated by *autopct*. Ignored if
*autopct* is *None*; default is 0.6.
Copy link
Member

Choose a reason for hiding this comment

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

Can delete default here.

autotexts : list
A is a list of :class:`~matplotlib.text.Text` instances for the
numeric labels. Is returned only if parameter *autopct* is
not *None*.
Copy link
Member

Choose a reason for hiding this comment

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

Trailing whitespace.

def pie(self, x, explode=None, labels=None, colors=None,
autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1,
startangle=None, radius=None, counterclock=True,
wedgeprops=None, textprops=None, center=(0, 0),
frame=False, rotatelabels=False):
r"""
Plot a pie chart.
r"""Plot a pie chart.
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 try reverting this? I think it might fix it. At least it seems to be working locally...

Copy link
Member Author

Choose a reason for hiding this comment

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

Question: does it even need to be a raw string?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so, but if everything breaks when you remove the raw string, then it needs to be a raw string :p

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any backslashes, so maybe not?

@NelleV
Copy link
Member

NelleV commented Mar 24, 2017

The indentation problem probably comes from our magic interpolation docstring functions.

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

QuLogic commented Mar 25, 2017

Congrats on attaining AppVeyor build 1000.

@QuLogic QuLogic merged commit 199cea7 into matplotlib:master Mar 25, 2017
dstansby pushed a commit that referenced this pull request Mar 25, 2017
DOC: Clean up the pie docstring PR
@dstansby
Copy link
Member

Backported to 2.0.x via 5e3df66

@phobson phobson deleted the pie-docstring branch March 26, 2017 15:53
@phobson
Copy link
Member Author

phobson commented Mar 26, 2017

@kahnchana thanks for this!

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.

5 participants