8000 Some docstring fixes and change a raise type by anntzer · Pull Request #10093 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Some docstring fixes and change a raise type #10093

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 1 commit into from
Jan 2, 2018

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Dec 26, 2017

PR Summary

All's in the title.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

if len(num1num2_list) != len(subplot_list):
raise RuntimeError("")
if len(num1num2_list) != len(subplot_list) or len(subplot_list) == 0:
raise ValueError
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 changing the type of error is an API change, so this could do with an API note if it's going in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

----------
nrows_ncols : Tuple[int, int]
Number of rows and number of columns of the grid.
num1num2_list : List[int]
Copy link
Member

Choose a reason for hiding this comment

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

Is this a standard way of documenting lists of ints (for example)? It looks new to me, and if it is the standard it should be in our documentation guide to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested in #9271 ("typehints-style"), and OK'd by @tacaswell further down the comments.
Will edit the style guide in a separate PR.

and passed the vertices of the selected path.
button : int or List[int]
Integer or list of integers indicating which mouse buttons should
be used for rectangle selection. Default is *None*, which does not
Copy link
Member

Choose a reason for hiding this comment

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

Should be
``None``

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

ax : `~matplotlib.axes.Axes`
The parent axes for the widget.
onselect : callable
Whenever the lasso is released, the `onselect` function is called
Copy link
Member

Choose a reason for hiding this comment

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

Should by *onselect*

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@anntzer anntzer force-pushed the more-docstring-fixes branch 2 times, most recently from 84379a5 to 95b177e Compare December 26, 2017 19:18
Copy link
Member
@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,2 @@
`~.tight_layout.auto_adjust_subplotpars` now raises `ValueError` instead of `RuntimeError` when sizes of input lists don't match
````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
Copy link
Member

Choose a reason for hiding this comment

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

What does this long line of ``````s do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just a very long title... (I don't think this entry deserves both a title and some contents in the section.)

@tacaswell
Copy link
Member

conflicts #10106

Sorry if I missed discussion here and merged that pre-maturely.

@tacaswell tacaswell changed the title Some docstring fixes. Some docstring fixes and change a raise type Dec 27, 2017
@anntzer anntzer force-pushed the more-docstring-fixes branch from 95b177e to 8ad05a3 Compare December 27, 2017 03:04
@anntzer
Copy link
Contributor Author
anntzer commented Dec 27, 2017

no worries, rebased

@tacaswell tacaswell added this to the v2.2 milestone Dec 29, 2017
Copy link
Member
@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

These are pretty minor. Otherwise I think this is helpful

fig : Figure
axes_list : List[Axes]
subplotspec_list : List[SubplotSpec]
The subplotspecs of each axes.
Copy link
Member

Choose a reason for hiding this comment

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

Can this be "`.SubplotSpec`" so there is a link to what a SubplotSpec is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed back to old form for now

fraction of the font size.
h_pad, w_pad : float
Padding (height/width) between edges of adjacent subplots. Defaults to
*pad_inches*.
Copy link
Member

Choose a reason for hiding this comment

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

Is this in inches, and the other pad in fraction of font size? Not your fault, but I find these random units pretty annoying. At least here we should be explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clarified

@anntzer anntzer force-pushed the more-docstring-fixes branch from 8ad05a3 to 2c16696 Compare December 29, 2017 05:06
@jklymak jklymak merged commit 37978a8 into matplotlib:master Jan 2, 2018
@anntzer anntzer deleted the more-docstring-fixes branch January 2, 2018 20:36
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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
0