-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
47135c4
Defined hv.renderer utility as baseclass of notebook_extension
jlstevens 766a40e
Alias hv.renderer to notebook_extension when available
jlstevens d6fbde3
OutputSettings.initialize can now be called safely multiple times
jlstevens fa2151c
Reintroduced logic to add SVG exporter to the notebook archive
jlstevens 0eab145
Setting hv.archive to NotebookArchive in notebook_extension
jlstevens cfba05f
Maded load_hvjs into a notebook_extension classmethod
jlstevens 673da72
Renamed hv.renderer to hv.extension
jlstevens d8dc640
Added a hv.renderer utility to access renderers easily
jlstevens 651c2f1
Made the renderer, output and opts utilities available at the top level
jlstevens b8986e6
Fixed output magic tab completion
jlstevens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
%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.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'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.