Closed bnmajor closed 11 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
This approach is making progress but is still a bit naive and has a lot of additional cases/needs to take into account. Starting a list here of key concerns and shortcomings so that they are addressed as this moves forward:
print(viewer.get_axes_enabled()) # False by default
viewer.set_axes_enabled(True)
print(viewer.get_axes_enabled()) # Should be True, will return False
Todos
which should help with all three points above.
-> merge
Create another issue as needed for setting cell output with a getter output.
@bnmajor this timeout only occurs when the tests are executed through nbmake?
@alex-treebeard are notebook events processed in a different way when executed through nbmake?
@alex-treebeard suggested that there may be a to resolve via the way nbmake uses nbclient.
@thewtex So it seems like the nbmake
issue is not actually with the getters/setters but with the fact that in testing the itk-viewer is never actually created (so any cells with getters/setters timeout waiting for it to be created before being run). If I use the --overwrite
flag to see the results produced from testing there is no embedded screenshot which seems to backup this theory....
@bnmajor oh, good catch! :bulb:
This widget rendering is not performed against a browser during execution
@oeway any ideas / suggestions / pointers to have ImJoy talk to a headless chromium browser?
@thewtex been doing a bit of reading around widgets. Is it necessary to load the browser in order to initialise the ITK widget?
What needs to run in order to unblock the getters from executing against an initialised viewer object?
@alex-treebeard
Is it necessary to load the browser in order to initialise the ITK widget?
It is not necessary to import and run the Python code. However, a browser is necessary for the graphical context and JavaScript environment to perform renderings and work with the client-side widget state.
What needs to run in order to unblock the getters from executing against an initialised viewer object?
One way or another, we need to be talking to, e.g., Chrome / Electron in Headless Mode, when running in nbmake / nbclient.
@thewtex have you checked out galata?
It's possible to stand up a jupyter lab instance in a test environment, then we could potentially run nbmake against its kernel.
@alex-treebeard great idea!!
Yes, we could use a version of nb_run.py
that uses galata and something along the lines of:
Let's merge this, then, in separate PR's
-- WIP --
Guided by the items discussed in #568 this branch attempts to add support for getter functions. Adapting approaches in the ipython_blocking and jupyter-ui-poll libraries the general approach is to:
execute_next_request
to start the cycle of processing the remaining cellsIssues: