-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix get_center method for the jupyter widget and add a get_fov method for both widgets #206
Fix get_center method for the jupyter widget and add a get_fov method for both widgets #206
Conversation
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.
Looks great! My only real concern is the periodic timeout needed to update the view info in the Jupyter case. Is there really no way to trigger the update to happen only when the Python code makes a request?
Also, the Travis CI failures are due to the "link check" stage of the docs build: see log here. That breakage is unrelated to this PR, but if you can update the relevant URLs while you're at it, that would be good to straighten out. |
I couldn't figure out a way to do it so that the properties are only updated when the python code requests it. Specifically, I can't figure out a way to block the python code until the properties have been update or found to not need updating on the javascript side without just guessing how long that should/could take and sleeping for that much. If we can work that out, we can remove the periodic calls to update_view_data. |
Codecov Report
@@ Coverage Diff @@
## master #206 +/- ##
==========================================
- Coverage 58.12% 57.76% -0.36%
==========================================
Files 24 24
Lines 1667 1686 +19
==========================================
+ Hits 969 974 +5
- Misses 698 712 +14
Continue to review full report at Codecov.
|
OK, mini literature review on the issue of getting data out of the JavaScript. It seems that this is a known issue:
I think that I have a proof-of-concept based on the technique in ipython_blocking that works! Basically, you can block the Python code by manually running the Jupyter event queue and storing events until you see one indicating that your operation has completed. I haven't done a detailed implementation, but the basic approach seems functional. @astrofrog what do you think? The timeout approach clearly has its weaknesses, but it ought to work pretty well. I certainly am a little wary of manually futzing with Jupyter's event loop but it seems to work ... and I can certainly imagine that other cases might crop up where we'll need the Python code to talk to the JS code, so a more general framework for doing so might be valuable. |
…s will allow the get_center and get_fov methods to work with the jupyter widgets.
8a77f4c
to
a0eec24
Compare
I rebased this on |
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.
+1 from me; the issue of the timeout will be punted to #210.
Part of the work needed to implement issue #200. This uses traitlets to connect the jupyter widget's properties back into the python class.