-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
if len(num1num2_list) != len(subplot_list): | ||
raise RuntimeError("") | ||
if len(num1num2_list) != len(subplot_list) or len(subplot_list) == 0: | ||
raise ValueError |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
lib/matplotlib/widgets.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
``None``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/matplotlib/widgets.py
Outdated
ax : `~matplotlib.axes.Axes` | ||
The parent axes for the widget. | ||
onselect : callable | ||
Whenever the lasso is released, the `onselect` function is called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should by *onselect*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
84379a5
to
95b177e
Compare
There was a problem hiding this 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 | |||
```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.)
conflicts #10106 Sorry if I missed discussion here and merged that pre-maturely. |
95b177e
to
8ad05a3
Compare
no worries, rebased |
There was a problem hiding this 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
lib/matplotlib/tight_layout.py
Outdated
fig : Figure | ||
axes_list : List[Axes] | ||
subplotspec_list : List[SubplotSpec] | ||
The subplotspecs of each axes. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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*. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clarified
8ad05a3
to
2c16696
Compare
PR Summary
All's in the title.
PR Checklist