-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Switch to %reload_ext in the tutorials #258
Comments
The notebook testing did not seem to mind the Logo + 'HoloViewsJS successfully loaded' + JS + CSS being added to the output so it might not cause any issues. |
I guess that is because it isn't a HoloViews object and isn't normal standard output either meaning this particular type of display output isn't captured and compared. Phew! |
I'd personally avoid putting any message by default, just to be nicer to people who want things to display without extra busyness. Telling people to uniformly use reload_ext seems fine to me. |
It doesn't tell me that in any way! On Wed, Sep 2, 2015 at 9:38 AM, Philipp Rudiger [email protected]
|
I don't like it in Bokeh either; I find it intrusive if a package I've loaded interferes with the contents of my notebook without my permission. If I wanted to know if BokehJS was loaded, I'd issue some command at the prompt explicitly. Explicit is better than implicit, right? :-) |
How about allowing our own parameterized version of %load_ext while still supporting the old syntax? |
That seems fine to me although this isn't a concrete example. Perhaps you are thinking of something like this? hv.load_extension() # Basically same as %load_ext *without* injecting javascript
hv.load_extension(javascript=True) # Explicitly used to just inject javascript |
Implementing this could also help address other issues such as #283 |
I agree-- can we just have a normal function that loads the extension, with arguments, and then we can handle both re-execution (which should simply be a no-op the second time, not a warning or an error) and changing defaults (e.g. width to 100%)? |
If we make it a ParameterizedFunction, we can have a css parameter, then if you want to always change the width, you can just set this in your notebook config: hv.ipython.load_notebook.css = """
div.container {
width: 100%;
}""" |
That sounds good for the general case, but I'd want something very simple in addition so that a one-liner could be used in all our examples and tutorials, e.g.:
instead of |
The new hv.notebook_extension function has now been merged. Closing this issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
We should use
%reload_ext holoviews.ipython
instead of%load_ext holoviews.ipython
as it behaves more predictably, reloading the extension without showing the message about the extension already being loaded.This is particularly important for the next release as the HoloViews IPython extension now loads the necessary javascript and CSS into the cell - rerunning
%load_ext
removes this cell which then breaks the widgets in the notebook.Of course
%load_ext
does still work but you need to be careful not to reload the extension! We could tell the user to use%reload_ext
(our current welcome message is 'HoloViewsJS successfully loaded.') but that might be awkward. Finally, we might need to make sure notebook testing works with this approach and we will probably have to regenerate all our reference data.The text was updated successfully, but these errors were encountered: