-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simplify and tighten the docstring handling API. #13125
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
At least for the single call, there's a factor 3 difference.
Maybe we're not doing it often enough, but I would have assumed that this would parse a lot of our docstrings. |
Instrumenting calls to cbook.dedent (with global counters) shows that after removing the unnecessary calls to dedent in pyplot (as this PR does), there are 123 calls to dedent, so we're talking about a ~2ms difference (which is real, but likely quite less than the noise of timing the import of the whole library). |
Fair enough. |
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.
e39ff24
to
15188fd
Compare
Good catch... should be fixed now.
(duh) |
Seems to work now... |
- Despite what the comment says, I find no import time difference between using cbook.dedent and inspect.cleandoc/inspect.getdoc, so use the stdlib function. Deprecate `cbook.dedent` and `docstring.dedent`. - Deprecate the Appender class, which is both (effectively) unused and a ridiculously overengineered API. - We don't need to dedent the pyplot docstring, just to copy them from the Axes methods. Deprecate `docstring.copy_dedent`. - We don't need to dedent the anchored_artists docstrings.
15188fd
to
4f6ada2
Compare
rebased |
between using cbook.dedent and inspect.cleandoc/inspect.getdoc, so use
the stdlib function. Deprecate
cbook.dedent
anddocstring.dedent
.ridiculously overengineered API.
the Axes methods. Deprecate
docstring.copy_dedent
.PR Summary
PR Checklist