Hydrogen: Give posibility to run different file in existing kernel

Created on 19 Oct 2017  Â·  9Comments  Â·  Source: nteract/hydrogen

With the new update when I run a file a Kernel opens. Okay.

I switch to a different file that may or may not be in the same directory as the first one.
When I run it a new kernel opens. This happens for every file.

I literally scanned through the options of Hydrogen. The "directory to start kernel in" is not what I am looking for.

There is no option to allow me to run all files in the existing kernel without opening a new one. I would very much like that!

(I am asking for an option to make this available by default by user's choice)

Most helpful comment

I messed around with the global kernel mode option last night and was able to get something rough working. I'll PR sometime this week.

All 9 comments

Currently I have to press so many buttons:
First Ctrl Shift P, then "Hydrogen Kernel" then Click hydrogen connect to existing Kernel, then try to guess which one is the kernel I want, since the popup window is not wide enough to read the full path AND it is not scrollable with Atom Material theme (bug).

Is there a reason to have a kernel per file?

This makes my workflow much tougher - I'm copying and pasting code into a file to run it in the existing kernel!

Same for me.

On 2 Nov 2017 18:28, "Maximilian Roos" notifications@github.com wrote:

Is there a reason to have a kernel per file?

This makes my workflow much tougher - I'm copying and pasting code into a
file to run it in the existing kernel!

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/nteract/hydrogen/issues/1057#issuecomment-341497982,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ASwgYd3BHCltUyLN4-2s6I1BFMkEcnJVks5syfusgaJpZM4P_FZb
.

I think there is definitely a happy medium to be worked out on this as the 2.0 release is only a couple weeks old. I still think independent kernels are most intuitive and should be the default, but I'm hoping ideas from this thread result in making this better through config or other enhancements. I'm interested in working on that or helping anyone else who wants to contribute.

Is there a reason to have a kernel per file?

In my opinion (and I think this is a matter or preference), the reason each file should start its own kernel by default is because if you want your file to run outside of hydrogen, say in a script or an app, you'd have to pay attention to namespaces and what you import/require/using etc. It's also how jupyter notebook works unless additional setup is done to connect to existing kernels.

but it is not how Spyder works. For example I switched from spyder to atom.

I am not asking to change the default, but at least giving me the option to
recover the behaviour I need should be really easy...

On 3 Nov 2017 05:01, "Ben Russert" notifications@github.com wrote:

I think there is definitely a happy medium to be worked out on this as the
2.0 release is only a couple weeks old. I still think independent kernels
are most intuitive and should be the default, but I'm hoping ideas from
this thread result in making this better through config or other
enhancements. I'm interested in working on that or helping anyone else who
wants to contribute.

Is there a reason to have a kernel per file?

In my opinion (and I think this is a matter or preference), the reason
each file should start its own kernel by default is because if you want
your file to run outside of hydrogen, say in a script or an app, you'd have
to pay attention to namespaces and what you import/require/using etc. It's
also how jupyter notebook works unless additional setup is done to connect
to existing kernels.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/nteract/hydrogen/issues/1057#issuecomment-341618358,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ASwgYfUbtukZu-FQyGylrcuzfrWuCm66ks5sypARgaJpZM4P_FZb
.

I agree it's not a complete unadulterated slam dunk and there are multiple perspectives...

I think a couple of changes we could make that would help everyone:

  • An option to have a global kernel
  • A way of setting a default kernel. I use a docker setup, and in order to get a kernel running in a new file, I need to run through 4-5 prompts (rather than Cmd-Enter if using a local kernel). Much of the frustration of the multiple kernels is around getting any kernel set up, not necessarily having the same kernel in that file

Checkout #40 for more information about this topic.

I'm open for contributions adding a config option to have a global kernel.

Indeed, it could be very useful feature bringing Hydrogen a bit closer to Spyder. A simple checkbox in configuration that run silently Connect to existing kernel for each new file would be enough.

I messed around with the global kernel mode option last night and was able to get something rough working. I'll PR sometime this week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

homocomputeris picture homocomputeris  Â·  4Comments

gepcel picture gepcel  Â·  3Comments

ekoepplin picture ekoepplin  Â·  4Comments

onyxfish picture onyxfish  Â·  4Comments

Mungoid picture Mungoid  Â·  4Comments