-
-
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
Defined hv.extension and hv.renderer utilities #1517
Conversation
@@ -361,7 +361,7 @@ def update_options(cls, options, items): | |||
@classmethod | |||
def initialize(cls, backend_list): | |||
cls.backend_list = backend_list | |||
backend = cls.options.get('backend', Store.current_backend) | |||
backend = Store.current_backend |
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.
@philippjfr I don't quite know why I had to make this change. I'll try to summarize:
- In the magic tests,
%unload_ext
is called which meant thatinitialize
was called multiple times because that unsets_loaded
on the notebook extension. If theoptions
dictionary had a value, this meant state was bleeding across tests and breaking. - I can't tell what changed: I believe
initialize
would have been called multiple times in the tests before this PR too.
That said, why isn't this an appropriate fix? When you initialize, it should reset the state even if initialize was called before. Why use a value from cls.options
when the purpose here is to reset it to the defaults (line below?).
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 can't be sure tbh, this code was always fairly brittle and I had to reorganize it a few times so methods may just have been badly named. I'd strongly suggest you make a notebook and then switch back and forth between backends with output a few times, rerun the notebook_extension, set fig formats then switch backends and so on. I don't think tests are currently a sufficient indication that things are still working.
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.
Sure. I can do that to check. That said, those switches shouldn't be going through initialize
each time 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.
I'd strongly suggest you make a notebook and then switch back and forth between backends with output a few times, rerun the notebook_extension, set fig formats then switch backends and so on.
I've just done that (included rerunning notebook_extension
) and it seems to be working correctly.
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.
Okay happy to merge once test pass.
@@ -254,6 +191,24 @@ def _get_resources(self, args, params): | |||
resources = ['holoviews'] + resources | |||
return resources | |||
|
|||
@classmethod | |||
def load_hvjs(cls, logo=False, JS=True, message='HoloViewsJS successfully loaded.'): |
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.
@philippjfr Is this ok? Anything else using this (i.e users)?
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.
What am I meant to check here? Looks like you just moved it slightly.
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.
Just wondering if anything else might have been using it. Why wasn't it a classmethod to begin with?
@philippjfr I think this PR is ready for review once the tests are green. |
Looks good to me. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Defines
hv.renderer
which helps load rendering backends outside of a notebook context.