Skip to content
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

save widgets after execute #779

Closed
wants to merge 6 commits into from

Conversation

scottdraves
Copy link

finished @ricklupton's PR

@scottdraves scottdraves changed the title save widget's after execute save widgets after execute Mar 18, 2018
@scottdraves
Copy link
Author

Looking into fixing on Python 2.7...

@mpacer
Copy link
Member

mpacer commented Mar 19, 2018

@jasongrout So is this your preferred mechanism for having widgets in exported contexts? Rather than with the custom mimetype and using the cdn approach?


try:
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
finally:
self.kc.stop_channels()
self.km.shutdown_kernel(now=self.shutdown_kernel == 'immediate')
if self.widget_state:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you isolate this functionality in a separate method?

setup.py Outdated
@@ -199,7 +199,7 @@ def run(self):
]

extra_requirements = {
'test': ['pytest', 'pytest-cov', 'ipykernel', 'jupyter_client>=4.2'],
'test': ['pytest', 'pytest-cov', 'ipykernel', 'jupyter_client>=4.2', 'ipywidgets'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a specific version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be at least >=7


wdata = output_nb['metadata']['widgets'] \
['application/vnd.jupyter.widget-state+json']
for k in model_ids:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests!

]
}
],
"metadata": {},
Copy link
Member

@jasongrout jasongrout Mar 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the widget state for the widget view above?

@jasongrout
Copy link
Member

@jasongrout So is this your preferred mechanism for having widgets in exported contexts? Rather than with the custom mimetype and using the cdn approach?

I glanced through it, and it looks all right for storing widget state in a notebook. For a notebook, the widget views are stored as custom mimetypes, and the widget state is stored in the notebook metadata. The cdn is used by an html output, for example, to actually get the js code to render the widget views.

@scottdraves
Copy link
Author

@mpacer @jasongrout should be ready to go.

@blink1073
Copy link
Member

@jasongrout, I'm about to cut 5.4, is this okay in your mind?

@blink1073 blink1073 modified the milestones: 5.4, 5.5 Aug 29, 2018
@astrojuanlu
Copy link

This needs a rebase, thanks for tackling it @scottdraves!

@MSeal
Copy link
Contributor

MSeal commented Apr 15, 2019

I believe this is now completed via #900 -- please reopen and rebase if you think there's anything that got missed.

@MSeal MSeal closed this Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants