Ensure hvplot.<ext> hooks are run on every import
The hvplot.<ext> import mechanism is a convenient way to allow users to have to avoid running the holoviews/panel extensions. However since imports are cached only the first import actually embeds the extension JS code, meaning that if you re-run the cell(s) containing import hvplot.pandas (or some other integration) then the JS will no longer be available and on subsequent reloads/re-runs of the notebook plots may not appear. This probably accounts for most issues encountered and described in https://github.com/holoviz/hvplot/issues/1232.
Here we add an IPython hook which simply deletes the modules before every cell execution. This is a big hammer but the best @hoxbro and I could find and at least it is restricted to IPython environments.
We need to update the logic to only register hvplot extensions once, have updated it for some but we should update it for all.
We need to look more into how this is going to affect Polars' users.
@hoxbro can you please review?
Codecov Report
Attention: Patch coverage is 73.95833% with 25 lines in your changes missing coverage. Please review.
Project coverage is 88.73%. Comparing base (
6c96c7e) to head (763392d). Report is 24 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| hvplot/cudf.py | 0.00% | 13 Missing :warning: |
| hvplot/intake.py | 0.00% | 7 Missing :warning: |
| hvplot/__init__.py | 64.28% | 5 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1359 +/- ##
==========================================
+ Coverage 87.39% 88.73% +1.34%
==========================================
Files 50 51 +1
Lines 7490 7592 +102
==========================================
+ Hits 6546 6737 +191
+ Misses 944 855 -89
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
oh my word, this explains so much, thanks for hunting it down...