-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Docstring touchups #1866
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
Docstring touchups #1866
Changes from all commits
8a6469a
037955b
5c9cf5f
12fe5a5
b2bff06
09c255e
3b5db1b
a15a381
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,22 +302,22 @@ | |
], | ||
marginal=[ | ||
"str", | ||
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.", | ||
"One of `'rug'`, `'box'`, `'violin'`, or `'histogram'`.", | ||
"If set, a subplot is drawn alongside the main plot, visualizing the distribution.", | ||
], | ||
marginal_x=[ | ||
"str", | ||
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.", | ||
"One of `'rug'`, `'box'`, `'violin'`, or `'histogram'`.", | ||
"If set, a horizontal subplot is drawn above the main plot, visualizing the x-distribution.", | ||
], | ||
marginal_y=[ | ||
"str", | ||
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.", | ||
"One of `'rug'`, `'box'`, `'violin'`, or `'histogram'`.", | ||
"If set, a vertical subplot is drawn to the right of the main plot, visualizing the y-distribution.", | ||
], | ||
trendline=[ | ||
"str", | ||
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.", | ||
"One of `'ols'` or `'lowess'`.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops good catch! |
||
"If `'ols'`, an Ordinary Least Squares regression line will be drawn for each discrete-color/symbol group.", | ||
"If `'lowess`', a Locally Weighted Scatterplot Smoothing line will be drawn for each discrete-color/symbol group.", | ||
], | ||
|
@@ -336,7 +336,7 @@ | |
], | ||
direction=[ | ||
"str", | ||
"One of '`counterclockwise'`, `'clockwise'`. Default is `'clockwise'`", | ||
"One of '`counterclockwise'` or `'clockwise'`. Default is `'clockwise'`", | ||
"Sets the direction in which increasing values of the angular axis are drawn.", | ||
], | ||
start_angle=[ | ||
|
@@ -345,15 +345,15 @@ | |
], | ||
histfunc=[ | ||
"str (default `'count'`)", | ||
"One of `'count'`, `'sum'`, `'avg'`, `'min'`, `'max'`." | ||
"One of `'count'`, `'sum'`, `'avg'`, `'min'`, or `'max'`." | ||
"Function used to aggregate values for summarization (note: can be normalized with `histnorm`).", | ||
"The arguments to this function for `histogram` are the values of `y` if `orientation` is `'v'`,", | ||
"otherwise the arguements are the values of `x`.", | ||
"The arguments to this function for `density_heatmap` and `density_contour` are the values of `z`.", | ||
], | ||
histnorm=[ | ||
"str (default `None`)", | ||
"One of `'percent'`, `'probability'`, `'density'`, `'probability density'`", | ||
"One of `'percent'`, `'probability'`, `'density'`, or `'probability density'`", | ||
"If `None`, the output of `histfunc` is used as is.", | ||
"If `'probability'`, the output of `histfunc` for a given bin is divided by the sum of the output of `histfunc` for all bins.", | ||
"If `'percent'`, the output of `histfunc` for a given bin is divided by the sum of the output of `histfunc` for all bins and multiplied by 100.", | ||
|
@@ -411,12 +411,12 @@ | |
line_shape=["str (default `'linear'`)", "One of `'linear'` or `'spline'`."], | ||
scope=[ | ||
"str (default `'world'`).", | ||
"One of `'world'`, `'usa'`, `'europe'`, `'asia'`, `'africa'`, `'north america'`, `'south america'`)" | ||
"One of `'world'`, `'usa'`, `'europe'`, `'asia'`, `'africa'`, `'north america'`, or `'south america'`)" | ||
"Default is `'world'` unless `projection` is set to `'albers usa'`, which forces `'usa'`.", | ||
], | ||
projection=[ | ||
"str ", | ||
"One of `'equirectangular'`, `'mercator'`, `'orthographic'`, `'natural earth'`, `'kavrayskiy7'`, `'miller'`, `'robinson'`, `'eckert4'`, `'azimuthal equal area'`, `'azimuthal equidistant'`, `'conic equal area'`, `'conic conformal'`, `'conic equidistant'`, `'gnomonic'`, `'stereographic'`, `'mollweide'`, `'hammer'`, `'transverse mercator'`, `'albers usa'`, `'winkel tripel'`, `'aitoff'`, `'sinusoidal'`" | ||
"One of `'equirectangular'`, `'mercator'`, `'orthographic'`, `'natural earth'`, `'kavrayskiy7'`, `'miller'`, `'robinson'`, `'eckert4'`, `'azimuthal equal area'`, `'azimuthal equidistant'`, `'conic equal area'`, `'conic conformal'`, `'conic equidistant'`, `'gnomonic'`, `'stereographic'`, `'mollweide'`, `'hammer'`, `'transverse mercator'`, `'albers usa'`, `'winkel tripel'`, `'aitoff'`, or `'sinusoidal'`" | ||
"Default depends on `scope`.", | ||
], | ||
center=[ | ||
|
@@ -426,10 +426,12 @@ | |
], | ||
points=[ | ||
"str or boolean (default `'outliers'`)", | ||
"One of `'all'`, `'outliers'`, or `False`.", | ||
"One of `'outliers'`, `'suspectedoutliers'`, `'all'`, or `False`.", | ||
"If `'outliers'`, only the sample points lying outside the whiskers are shown.", | ||
"If `'suspectedoutliers'`, all outlier points are shown and those less than 4*Q1-3*Q3 or greater than 4*Q3-3*Q1 are highlighted with the marker's `'outliercolor'`.", | ||
"If `'outliers'`, only the sample points lying outside the whiskers are shown.", | ||
"If `'all'`, all sample points are shown.", | ||
"If `False`, no sample points are shown", | ||
"If `False`, no sample points are shown and the whiskers extend to the full range of the sample.", | ||
], | ||
box=["boolean (default `False`)", "If `True`, boxes are drawn inside the violins."], | ||
notched=["boolean (default `False`)", "If `True`, boxes are drawn with notches."], | ||
|
@@ -444,7 +446,7 @@ | |
|
||
|
||
def make_docstring(fn): | ||
tw = TextWrapper(width=79, initial_indent=" ", subsequent_indent=" ") | ||
tw = TextWrapper(width=77, initial_indent=" ", subsequent_indent=" ") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure I understand this change... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which version of jupyter are you using? Mine is
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue seems more complicated than I orginally thought, would you mind reverting here to 79 and opening an issue so that we can take the time to understand what's going on, and merge the rest of this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is the custom dark theme that changes the width of the help box in the first screen shot (it looks like you have even more room on the right). I tried the default Jupyter Light and Dark theme and they both perform the wrapping as I indicated above: On your binder screenshot, it appears as if you are running without PR #1835. I'm on jupyter 4.4.0 and jupyterlab 1.0.5. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you prefer if I make a new commit that to revert the change, or can I drop the old one in a rebase and then force push? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks a lot for helping to document this. OK, so no need to revert the change, I'll merge as it is. |
||
result = (fn.__doc__ or "") + "\nParameters\n----------\n" | ||
for param in inspect.getargspec(fn)[0]: | ||
param_desc_list = docs[param][1:] | ||
|
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.
could you please add a blank line before this sentence? The convention is to have a 1-line sentence to start the docstring, then if needed explanations in another paragraph.