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

Use Output widget with Interact #7554

Merged
merged 4 commits into from
Jan 30, 2015
Merged

Use Output widget with Interact #7554

merged 4 commits into from
Jan 30, 2015

Conversation

jdfreder
Copy link
Member

closes #6534
alternative to #7482

Ping @jasongrout who was also interested in this solution.

Also this fixes a small bug in whichget_ipython is not defined in the context where the Output widget is __enter__ed.

@@ -34,6 +34,10 @@ class Output(DOMWidget):
print('prints to output widget')"""
_view_name = Unicode('OutputView', sync=True)

def __init__(self, *args, **kwargs):
super(Output, self).__init__(*args, **kwargs)
self._ip = get_ipython()
Copy link
Member

Choose a reason for hiding this comment

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

This file is missing from IPython import get_ipython

@minrk
Copy link
Member

minrk commented Jan 24, 2015

Travis failures look real. Missing description?

@minrk minrk added this to the 3.0 milestone Jan 24, 2015
@jdfreder
Copy link
Member Author

@minrk the test problem should be fixed in commit 996c4d7. The interact tests erroneously assumed every widget in the interact-produced container had a description property. Also, kernel isn't defined for every get_ipython() instance. Standing by to see what Travis thinks...

@minrk
Copy link
Member

minrk commented Jan 27, 2015

Tests are failing with a few off-by-one errors, but it looks like the tests need updating rather than an actual bug, since an extra widget is added to the collection.

@jdfreder
Copy link
Member Author

Looks like this is passing now.

@@ -80,7 +80,8 @@ def check_widgets(container, **to_check):
# build a widget dictionary, so it matches
widgets = {}
for w in container.children:
widgets[w.description] = w
if hasattr(w, 'description'):
widgets[w.description] = w
Copy link
Member

Choose a reason for hiding this comment

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

This means that widgets without a description will be excluded from the dict. Is there a problem with doing that?

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't be a problem, widgets without descriptions cause this code (without the check) to barf, so they can't be included as-is.

Copy link
Member

Choose a reason for hiding this comment

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

ok

minrk added a commit that referenced this pull request Jan 30, 2015
Use Output widget with Interact
@minrk minrk merged commit 6bf6e5a into ipython:master Jan 30, 2015
@minrk minrk modified the milestones: no action, 3.0 Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Same widget does not update all interact.
2 participants