NCAR / VAPOR

VAPOR is the Visualization and Analysis Platform for Ocean, Atmosphere, and Solar Researchers
https://www.vapor.ucar.edu/
BSD 3-Clause "New" or "Revised" License
178 stars 49 forks source link

Python API: Interactive Widgets: Error displaying on Casper #3297

Closed shaomeng closed 11 months ago

shaomeng commented 1 year ago

Using Python API installed from conda-forge and the supplied "animation_example.ipynb" file, the command anim.ShowInteractive() fails with error message "Error displaying widget: model not found."

Platform: Casper Conda environment: a clean one. Note: this behavior was observed through JupyterHub on Casper (https://arc.ucar.edu/knowledge_base/70549913)

image

StasJ commented 1 year ago

Works for me:

casper

shaomeng commented 1 year ago

Maybe it's a hit or miss situation. I'm ok to close it.

shaomeng commented 1 year ago

FWIW, the screen animation @StasJ posted seems to be a Jupyter session inside of a TurboVNC remote desktop session.

However, I don't believe that Jupyter via TurboVNC is the primary mechanism for Casper users to use Jupyter. On Casper, JupyterHub is the primary method, simply because it requires no more than a web browser from the user, and it's the method that CISL supports. As a result, I think it's worth investigation if VAPOR Python API can be used along with JupyterHub on Casper.

clyne commented 1 year ago

FWIW, the screen animation @StasJ posted seems to be a Jupyter session inside of a TurboVNC remote desktop session.

However, I don't believe that Jupyter via TurboVNC is the primary mechanism for Casper users to use Jupyter. On Casper, JupyterHub is the primary method, simply because it requires no more than a web browser from the user, and it's the method that CISL supports. As a result, I think it's worth investigation if VAPOR Python API can be used along with JupyterHub on Casper.

@shaomeng is correct. By far the most common mode of operation on casper is via JupyterHub, not TurboVNC

StasJ commented 1 year ago

This is an issue with Jupyter and Conda. Jupyter-Lab, which Jupyter-Hub uses, deprecated Jupyter-Notebook widgets. Jupyter-Widgets was ported to Jupyter-Lab, however, even with the latest Conda packages this does not yet work:

s

The above is in a new conda environment created with conda create -c conda-forge jupyterlab ipywidgets

NihanthCW commented 1 year ago

@StasJ This might be a silly question. So, does this mean the widgets don't work for Casper users? or since this is an issue with conda we could do the following: a. Add additional instructions for Casper users to install ipywidgets in addition to vapor-python or b. Recommend Casper users to install vapor-python using the manual build?

StasJ commented 1 year ago

@NihanthCW The widgets will work fine for Casper users as long as they use Jupyter-Notebook rather than Jupyter-Lab. This can be easily done in their local browser by port forwarding Jupyter-Notebook from Casper.

rec

NihanthCW commented 1 year ago

Thanks Stas. Yes, this could be a workaround. My only concern is that people are migrating to using JupyterLab over stand alone jupyter notebooks. So, sooner than later we might be on the hook to support this option. So, any other ideas on how we could move forward? You probably have already seen this- is this thread talking about a similar issue that we are facing? We can discuss this next week as well.

StasJ commented 1 year ago

Vapor’s extension is already packaged properly as a Jupyter-Lab extension. Conda is failing to install it, just like it is failing to install ipywidgets. I am looking into working around this issue.

NihanthCW commented 1 year ago

Vapor’s extension is already packaged properly as a Jupyter-Lab extension. Conda is failing to install it, just like it is failing to install ipywidgets. I am looking into working around this issue.

Great! Thanks Stas!

StasJ commented 1 year ago

I narrowed this down to an issue with the Jupyter-Hub configuration on Casper and opened a ticket with CISL help.

negin513 commented 1 year ago

Dear all,

I hope this message finds you well. I would like to inquire whether vapor-widgets have been tested on JupyterLab >3 on any other machine. On my local machine, I encountered difficulties in making vapor-widgets work with JupyterLab >3 and it only worked with classic Jupyter Notebook.

The issue with ipywidgets on NCAR machines is now resolved and better understood. (Thanks to @StasJ for reporting it and bringing it our attention.) Essentially for ipywidgets we need some packages installed on the base JH environment and we need to make sure the version in the user's environment is matching the jupyterlab_widgets. The instructions to install ipywidgets hints at this issue : https://ipywidgets.readthedocs.io/en/stable/user_install.html

However, it appears to me that the issue for vapor-widgets might stem from a different origin.

Thank you for your attention to this matter. Best Regards, Negin

StasJ commented 1 year ago

Hi @negin513, it appears that Vapor's widgets are not currently working with JupyterLab>3, however, neither is the template provided by Jupyter on top of which Vapor's widgets are built. I've opened an issue with Jupyter and in the meantime I will try to find a workaround.

negin513 commented 1 year ago

@StasJ Thanks for the update on this. Since vapor-widgets is not working with JupyterLab>3 and CISL JH implementation is using JupyerLab 3.4.5, vapor-widgets is not going to work CISL JH. However, the issue with ipywidgets is resolved and your users should be able to use that.

Please let me know when this issue is resolved and we can work on testing this on the NCAR JH system.