-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC/CI: Fixes to make validate_docstrings.py to not generate warnings or unwanted output #23552
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
Changes from all commits
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 |
---|---|---|
|
@@ -2156,13 +2156,6 @@ def cat(self, others=None, sep=None, na_rep=None, join=None): | |
`join`-keyword works as in other methods. | ||
|
||
>>> t = pd.Series(['d', 'a', 'e', 'c'], index=[3, 0, 4, 2]) | ||
>>> s.str.cat(t, join=None, na_rep='-') | ||
0 ad | ||
1 ba | ||
2 -e | ||
3 dc | ||
dtype: object | ||
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 here it is actually useful to see the difference? (although it is deprecated?) cc @h-vetinari 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 makes more sense to remove it. But if we restore it, I think the page should make clear that this is a deprecated behavior. The way it was feels like it's encouraging users to use 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. Yes, that is true that it then should be more clear that it is deprecated, and pointing out the difference. 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. @datapythonista @jorisvandenbossche Indeed, the main intention of this was to show the difference, while relying on the fact that the user would see the deprecation warning if he actually used the code (but then, that was before all that docstring-validation jazz ;-)). |
||
>>> | ||
>>> s.str.cat(t, join='left', na_rep='-') | ||
0 aa | ||
1 b- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,7 +206,7 @@ def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds): | |
... 'versicolor', 'setosa', 'virginica', | ||
... 'setosa'] | ||
... }) | ||
>>> rad_viz = pd.plotting.radviz(df, 'Category') | ||
>>> rad_viz = pd.plotting.radviz(df, 'Category') # doctest: +SKIP | ||
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. But is the plot still shown then in the html documentation? 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. Yes, it's just skipped in the doctests. Just generated the page to confirm, and it's rendered as expected. 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. But there are many other plots in the docs? Why only those two? And from reading further it seems you are deactivating matplotlib anyway in the script? 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'm not skipping because it's a plot, I'm skipping because it generates a warning, something about the projection (not sure if the warning only happens with the backend 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. OK. I don't see any warning locally, though |
||
""" | ||
import matplotlib.pyplot as plt | ||
import matplotlib.patches as patches | ||
|
@@ -407,7 +407,7 @@ def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds): | |
:context: close-figs | ||
|
||
>>> s = pd.Series(np.random.uniform(size=100)) | ||
>>> fig = pd.plotting.bootstrap_plot(s) | ||
>>> fig = pd.plotting.bootstrap_plot(s) # doctest: +SKIP | ||
""" | ||
import random | ||
import matplotlib.pyplot as plt | ||
|
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.
Why does this need to be skipped?
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.
Ah, you are skipping the deprecated things, to avoid warnings?
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.
yes, that's correct