DOC: Updating docstring to numpy doc format for errorbar #7032

Merged
merged 14 commits into from Sep 14, 2016

Conversation

Projects
None yet
6 participants
Contributor

Seraf69 commented Sep 5, 2016

Hi matplotlib contributor,

we updated the docstring of errorbar to the numpy doc format. @NelleV

Thanks for your patience,
Benedikt and Seraphin

mdboom added the needs_review label Sep 5, 2016

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
subsamples the errorbars. e.g., if errorevery=5, errorbars for
every 5-th datapoint will be plotted. The data plot itself still
shows all data points.
+ Returns
+ -------
+ plotline: :class:`~matplotlib.lines.Line2D` instance
@NelleV

NelleV Sep 5, 2016

Contributor

For numpydoc to render properly, you need to add a space after plotline and before ":".

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
subsamples the errorbars. e.g., if errorevery=5, errorbars for
every 5-th datapoint will be plotted. The data plot itself still
shows all data points.
+ Returns
+ -------
+ plotline: :class:`~matplotlib.lines.Line2D` instance
+ x, y plot markers and/or line
+ caplines:
+ list of error bar cap :class:`~matplotlib.lines.Line2D` instances
@NelleV

NelleV Sep 5, 2016

Contributor

same

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
subsamples the errorbars. e.g., if errorevery=5, errorbars for
every 5-th datapoint will be plotted. The data plot itself still
shows all data points.
+ Returns
+ -------
+ plotline: :class:`~matplotlib.lines.Line2D` instance
+ x, y plot markers and/or line
+ caplines:
+ list of error bar cap :class:`~matplotlib.lines.Line2D` instances
+ barlinecols:
@NelleV

NelleV Sep 5, 2016

Contributor

same.

@NelleV

NelleV Sep 5, 2016

Contributor

There is also whitespace at the end of this line :)

Contributor

NelleV commented Sep 5, 2016 edited by QuLogic

Hello,

Thanks for the patch!
The matplotlib code follows the pep8 recommendations. The patch breaks a couple of these recommendations, mostly whitespace issues. Here is the traceback:

/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2705:19: W291 trailing whitespace
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2707:1: W293 blank line contains whitespace
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2708:80: E501 line too long (91 > 79 characters)
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2764:18: W291 trailing whitespace
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2766:21: W291 trailing whitespace
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2767:80: E501 line too long (81 > 79 characters)
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:2792:1: W293 blank line contains whitespace

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
- *xerr*/*yerr*: [ scalar | N, Nx1, or 2xN array-like ]
+ Parameters
+ ----------
+ x : scalar
@NelleV

NelleV Sep 5, 2016

Contributor

There is whitespace at the end of this line. Can you please remove it?

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
- *xerr*/*yerr*: [ scalar | N, Nx1, or 2xN array-like ]
+ Parameters
+ ----------
+ x : scalar
+ y : scalar
+
@NelleV

NelleV Sep 5, 2016

Contributor

There is whitespace on this line. Can you please remove it?

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
- *xerr*/*yerr*: [ scalar | N, Nx1, or 2xN array-like ]
+ Parameters
+ ----------
+ x : scalar
+ y : scalar
+
+ xerr/yerr : scalar or array-like, shape(n,1) or shape(2,n), optional, default: None
@NelleV

NelleV Sep 5, 2016

Contributor

This line is too long for our code requirements (max 79 char). Can you remove the default and add it in the text below?

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
subsamples the errorbars. e.g., if errorevery=5, errorbars for
every 5-th datapoint will be plotted. The data plot itself still
shows all data points.
+ Returns
+ -------
+ plotline: :class:`~matplotlib.lines.Line2D` instance
+ x, y plot markers and/or line
+ caplines:
@NelleV

NelleV Sep 5, 2016

Contributor

There seems to be whitespace at the end of this line. Can you remove it?

@NelleV NelleV commented on an outdated diff Sep 5, 2016

lib/matplotlib/axes/_axes.py
.. plot:: mpl_examples/statistics/errorbar_demo.py
-
+
@NelleV

NelleV Sep 5, 2016

Contributor

And there is whitespace as well on this line!

I hope I got all of the whitespace issues.

Contributor

NelleV commented Sep 5, 2016

Apart from my comments, great job!

Contributor

NelleV commented Sep 5, 2016

There is also a slight problem of rendering: I am not sure what the problem is, but I'll look again once you update the PR with the changes. These might actually fix the rendering problem.

@QuLogic QuLogic commented on an outdated diff Sep 6, 2016

lib/matplotlib/axes/_axes.py
@@ -2691,78 +2691,84 @@ def errorbar(self, x, y, yerr=None, xerr=None,
barsabove=False, lolims=False, uplims=False,
xlolims=False, xuplims=False, errorevery=1, capthick=None,
**kwargs):
- """
- Plot an errorbar graph.
-
- Call signature::
-
- errorbar(x, y, yerr=None, xerr=None,
- fmt='', ecolor=None, elinewidth=None, capsize=None,
- barsabove=False, lolims=False, uplims=False,
- xlolims=False, xuplims=False, errorevery=1,
- capthick=None)
-
- Plot *x* versus *y* with error deltas in *yerr* and *xerr*.
- Vertical errorbars are plotted if *yerr* is not *None*.
- Horizontal errorbars are plotted if *xerr* is not *None*.
+ """Plot an errorbar graph.
@QuLogic

QuLogic Sep 6, 2016

Member

This should remain on a separate line; I think this is causing the rendering issue @NelleV noted.

@QuLogic QuLogic and 1 other commented on an outdated diff Sep 6, 2016

lib/matplotlib/axes/_axes.py
- *x*, *y*, *xerr*, and *yerr* can all be scalars, which plots a
- single error bar at *x*, *y*.
+ Plot x versus y with error deltas in yerr and xerr.
@QuLogic

QuLogic Sep 6, 2016

Member

I'm not sure that the arguments should not have the distinct formatting that they originally had.

@NelleV

NelleV Sep 6, 2016

Contributor

I much prefer the way it is now, and I think we've had this discussion about 3 years ago and agreed to remove the *. This do not bring much in the sphinx rendering, and clutter the python docstrings.

Member

QuLogic commented Sep 6, 2016

It appears you have not set the config for your git client. All your commits are attributed to "Your Name you@example.com", which is probably not what you want.

Contributor

daurer commented Sep 6, 2016 edited

We tried to address all problems listed. @NelleV @Seraf69

Benedikt and Seraphin

@QuLogic QuLogic commented on an outdated diff Sep 6, 2016

lib/matplotlib/axes/_axes.py
- *xerr*/*yerr*: [ scalar | N, Nx1, or 2xN array-like ]
+ Parameters
+ ----------
+ x : scalar
+ y : scalar
+
@QuLogic

QuLogic Sep 6, 2016

Member

There are still spaces here.

daurer and others added some commits Sep 5, 2016

@daurer daurer [WIP] DOC: Updating docstring to numpy doc format for errorbar 4d2c994
@Seraf69 @daurer Seraf69 [WIP] DOC: Fixed issues with whitespaces 5ecdb2e
@daurer daurer [WIP] DOC: Removed whitespace d3d5ad0
@daurer daurer [WIP] DOC: Shortened a too long line
89c8586
@daurer daurer [WIP] DOC: Shortened line which was too long
5a9ee00
@daurer daurer Removed whitespace
6ab965e
@daurer daurer [WIP] DOC: Trying to fix intendation problems
835fec6
@daurer daurer [WIP] DOC: Fixed typo
d06853b

@NelleV NelleV commented on an outdated diff Sep 8, 2016

lib/matplotlib/axes/_axes.py
+ Examples
+ -------
@NelleV

NelleV Sep 8, 2016

Contributor

You have a tiny problem here: there is a dash missing to underline the whole section.

daurer and others added some commits Sep 8, 2016

@daurer daurer DOC: Fixing intendation and small formatting problems
96b05e9
@daurer daurer DOC: Shortened too long lines
f2f7689
@daurer daurer DOC: Removed trailling whitespace
8ae6f94
@NelleV NelleV DOC minor fixes on the documentation of errorbar 98f4ac1
@daurer daurer Merge pull request #1 from NelleV/Seraf69_docs_errorbar_fix
DOC minor fixes on the documentation of errorbar
b5dafba
@daurer daurer DOC: Shortened line to match pep8
bec46f0
Contributor

NelleV commented Sep 14, 2016

This looks good! Thanks for the contribution.
Here is how it looks:

errorbar

NelleV changed the title from [WIP] DOC: Updating docstring to numpy doc format for errorbar to [MRG+1] DOC: Updating docstring to numpy doc format for errorbar Sep 14, 2016

@tacaswell tacaswell merged commit 38be7ae into matplotlib:master Sep 14, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 70.362%
Details

tacaswell removed the needs_review label Sep 14, 2016

@tacaswell tacaswell added a commit that referenced this pull request Sep 14, 2016

@tacaswell tacaswell Merge pull request #7032 from Seraf69/docs_errorbar
DOC: Updating docstring to numpy doc format for errorbar
55d7a4f
Owner

tacaswell commented Sep 14, 2016

backported to v2.x as 55d7a4f

@Seraf69 Thanks!

daurer deleted the Seraf69:docs_errorbar branch Sep 14, 2016

QuLogic changed the title from [MRG+1] DOC: Updating docstring to numpy doc format for errorbar to DOC: Updating docstring to numpy doc format for errorbar Oct 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment