nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
788 stars 132 forks source link

Display NGLViewer when kernel is running #1079

Closed GregorySchwing closed 5 months ago

GregorySchwing commented 8 months ago
print(nglview.__version__)'
3.0.8
print(ipywidgets.__version__)'
7.7.2
hainm commented 8 months ago

Thanks for reporting. It's weird. Noted.

hainm commented 8 months ago

https://github.com/nglviewer/nglview/issues/901#issuecomment-1793587615

I guess this is the full description?

hainm commented 7 months ago

GregorySchwing I have a working installation of nglview using jupyter lab. My problem is i'd like to be able to "Restart Kernel and Run all Cells" and see the nglview as the cells are run, however, the views aren't displayed until after all the kernels finish or I stop the kernel. Is there anyway to get my desired behavior?

GregorySchwing commented 7 months ago

GregorySchwing I have a working installation of nglview using jupyter lab. My problem is i'd like to be able to "Restart Kernel and Run all Cells" and see the nglview as the cells are run, however, the views aren't displayed until after all the kernels finish or I stop the kernel. Is there anyway to get my desired behavior?

yes that is the full description

GregorySchwing commented 7 months ago

although this was actually done in notebook not lab

hainm commented 7 months ago

@GregorySchwing I have been thinking about this and I think it's not about nglview but about Python in general. When clicking "Restart Kernel and Run all Cells", the python codes will be run in a single thread and blocks other threads to run. So the run must be finished to display anything.

(My educated guess).