insilichem / pychimera

Use UCSF Chimera Python API in a standard interpreter
http://pychimera.readthedocs.io
GNU Lesser General Public License v3.0
57 stars 10 forks source link

Live kernel reload inside IPython Notebook #2

Closed jaimergp closed 8 years ago

jaimergp commented 8 years ago

This would be a nice improvement, but not needed at all.

The expected implementation would be a %chimera magic command or something like that.

However, since patching the environment requires a restart to properly parse the LD_LIBRARY_PATH envvar, the user should run that magic before executing anything else. Otherwise, all previous cells would need a re-run. Subsequently, this implementation is more of a cosmetic/elegant touch than anything else, since it barely offers any improvement over the current pychimera notebook command.

Moreover, I don't know if it's even possible! Sounds like a nice challenge anyway :)

jaimergp commented 8 years ago

I did some testing and somehow it's working right now with this environment in Linux:

The version of the notebook server is 4.1.0 and is running on:
Python 2.7.11 |Continuum Analytics, Inc.| (default, Dec  6 2015, 18:08:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]

Current Kernel Information:
Python 2.7.11 |Continuum Analytics, Inc.| (default, Dec  6 2015, 18:08:32) 
IPython 4.0.3 -- An enhanced Interactive Python.

All you have to do is

from pychimera import enable_chimera
enable_chimera()

The cell will not respond after Ctrl+Enter, but you'll see the Kernel reload banner in top right. After a second Shift+Enter, you'll be able to import chimera though.

Would like to have some feedback from other systems too!