-
-
Notifications
You must be signed in to change notification settings - Fork 114
Refactor and improve patching of the plotting methods docstring and signature #1520
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
hoxbro
left a comment
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'm assuming most of the changes are "just" moved code, and no significant logic has been changed in them.
| from .util import _PatchHvplotDocstrings, _in_ipython | ||
| from .utilities import help, hvplot_extension, output, save, show # noqa |
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 a little weird that there are two files with util/utilities, but this was not added to this PR.
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 it's weird :/
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.
That's the sort of thing we should clean up for hvPlot 1.0.
hvplot/util.py
Outdated
| return geoviews | ||
|
|
||
|
|
||
| def _is_installed(package: str) -> bool: |
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.
Maybe cache this result?
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.
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 thanks good catch, I didn't know find_spec was looking at modules. I removed _is_installed entirely as I think it was a bit misleading and isn't used much anyway.
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.
Maybe cache this result?
I thought about it before, and then thought people do special things in their environment while working directly from a notebook (install packages, autoreloading modules, etc.). The function that patches plotting signatures and docstrings doesn't only run on import but also when switching HoloViews backend. So I'd rather not cache for now, and keep that for future improvements to improve the import speed of hvPlot, which I'm sure we'll look at at some point.

HVPLOT_PATCH_PLOT_DOCSTRING_SIGNATUREis non falsy__init__.pyto theutil.pymodule