I've been developing a Python module in one Atom instance, and using Hydrogen and a script in another to do some rough debugging. It's a really nice workflow!
Since Jupyter does not re-import imported modules when the import line is re-run, and it is (AFAICT) not possible to use IPython magics in Jupyter, I end up needing to restart the kernel repeatedly.
It would be useful to be able to keybind the command which is available from the Command Palette as "Hydrogen: Show Kernel Commands" > "Python kernel: restart". Or, if this is already possible, the documentation should list the command which can be used in the keymap.
I've been developing a Python module in one Atom instance, and using Hydrogen and a script in another to do some rough debugging. It's a really nice workflow!
so very nice feedback, thank you!
Thanks for your great feedback! I'll have a look at the restart command next week.
That said, IPython magics work in jupyter as well. There are several options you can use to achieve auto reloading of the imported modules:
%load_ext autoreload
%autoreload 2
ipython_config file (http://ipython.readthedocs.io/en/stable/config/intro.html):c.InteractiveShellApp.exec_lines = ['%autoreload 2']
c.InteractiveShellApp.extensions = ['autoreload']
add these lines to … your startup code in the hydrogen setting
Ah, sorry—I read this comment and so assumed magics were not available at all, so I must have overlooked them in the settings.
I also find very inconvenient that restart kernel can't be assigned a key binding. I'd like to split the command Hydrogen: Show Kernel Commands into:
Interrupt Running KernelRestart Running KernelSwitch Kernel ...@n-riesco That split was approved by @willwhitney, but wasn't done - I was waiting to have a time to refactor and move to async code in menus. But that time never came :)
@slavaGanzin Would you like to make a PR for it? It should be a matter of adding two new commands Interrupt Running Kernel and Restart Running Kernel, and renaming Hydrogen: Show Kernel Commands to Switch Kernel ....
@n-riesco Ok. I'll do
@khaeru If you are on master branch(or wait for next release), you can map restart kernel in your keymap.cson, for example:
'ctrl-shift-r': 'hydrogen:restart-kernel'
Excellent, thank you!
Most helpful comment
@khaeru If you are on master branch(or wait for next release), you can map restart kernel in your keymap.cson, for example: