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

CellWatcher use of ZMQStream with JupyterLite #730

Open
thewtex opened this issue Jan 4, 2024 · 2 comments
Open

CellWatcher use of ZMQStream with JupyterLite #730

thewtex opened this issue Jan 4, 2024 · 2 comments

Comments

@thewtex
Copy link
Member

thewtex commented Jan 4, 2024

@bnmajor looking to update our docs JupyterLite itkwidgets version, and I am getting the following traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 1
----> 1 from itkwidgets import view
      2 import imageio.v2 as imageio

File /lib/python3.10/site-packages/itkwidgets/__init__.py:12
      9     from .imjoy import register_itkwasm_imjoy_codecs
     10     register_itkwasm_imjoy_codecs()
---> 12 from .viewer import Viewer, view, compare_images
     13 from .standalone_server import standalone_viewer
     15 __all__ = [
     16   "Viewer",
     17   "view",
     18   "compare_images",
     19   "standalone_viewer",
     20 ]

File /lib/python3.10/site-packages/itkwidgets/viewer.py:25
     17 from ._type_aliases import Gaussians, Style, Image, PointSet, CroppingPlanes
     18 from ._initialization_params import (
     19     init_params_dict,
     20     build_config,
   (...)
     23     defer_for_data_render,
     24 )
---> 25 from .cell_watcher import CellWatcher
     26 from .imjoy import register_itkwasm_imjoy_codecs
     27 from .integrations import _detect_render_type, _get_viewer_image, _get_viewer_point_set

File /lib/python3.10/site-packages/itkwidgets/cell_watcher.py:9
      7 from queue import Queue
      8 from imjoy_rpc.utils import FuturePromise
----> 9 from zmq.eventloop.zmqstream import ZMQStream
     11 background_tasks = set()
     14 class Viewers(object):

ModuleNotFoundError: No module named 'zmq'
@thewtex thewtex self-assigned this Jan 4, 2024
@thewtex
Copy link
Member Author

thewtex commented Jan 4, 2024

@bnmajor Viewers run with #731 but getters still failing with

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 viewer.get_rotate()

File /lib/python3.10/site-packages/itkwidgets/viewer.py:324, in Viewer.fetch_value.<locals>._fetch_value(self, *args, **kwargs)
    322 if isawaitable(result):
    323     future = asyncio.ensure_future(result)
--> 324     self.call_getter(future)
    325     return future
    326 return result

File /lib/python3.10/site-packages/itkwidgets/viewer.py:288, in Viewer.call_getter(self, future)
    286 global _cell_watcher
    287 name = uuid.uuid4()
--> 288 _cell_watcher.results[name] = future
    289 future.add_done_callback(functools.partial(_cell_watcher._callback, name))

AttributeError: 'NoneType' object has no attribute 'results'

thewtex added a commit to thewtex/itkwidgets that referenced this issue Jan 11, 2024
@thewtex
Copy link
Member Author

thewtex commented Jan 19, 2024

As discussed with @bnmajor, we will need to teach CellWatcher to operate on the Jupyter message stream in JupyterLite as we do with JupyterNotebook / JupyterLab with the ZMQStream.

@thewtex thewtex removed their assignment Jan 19, 2024
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

No branches or pull requests

1 participant