Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple notebook to one kernel? #1699

Closed
cqcn1991 opened this issue Aug 22, 2016 · 16 comments
Closed

Multiple notebook to one kernel? #1699

cqcn1991 opened this issue Aug 22, 2016 · 16 comments

Comments

@cqcn1991
Copy link

I'm doing some complicated works with Jupyter Notebook, so the notebook is very long (https://github.com/cqcn1991/Wind-Speed-Analysis).

Sometimes, during the middle of the notebook, I want to do some additional analysis. Adding them directly into the current notebook may make it more complex, and breaks its current structure. I think it would be amazing if I can simply open another notebook, connect it to the existing notebook's kernel, then to do the additional analysis.

Maybe something like

# In the new notebook
connect_to 'exisiting_notebook_name' # get access to the existing notebook
df.describe()
# ...
# some additional analysis works

I have asked it here, but didn't get any response. so I post here again to get some idea.

@takluyver
Copy link
Member

You may be able to hack something together, but I think its's something we've considered before and aren't interested in supporting; the mechanisms to see and change which kernel a notebook is connected to would be a significant extra piece of user-facing complexity.

@cqcn1991
Copy link
Author

@takluyver Then if there is any clue on this? I have no idea how to start to hack this.

@takluyver
Copy link
Member

Sessionmanager is what maintains the mapping between notebooks and kernels. I haven't thought at all about how you'd adapt it to do what you want, though.

@gshiba
Copy link

gshiba commented Aug 25, 2016

Not a separate notebook, and one cell only, but this extension may be useful: https://github.com/minrk/nbextension-scratchpad

@gnestor gnestor added this to the No action milestone Sep 14, 2016
@foice
Copy link

foice commented Jan 19, 2018

Let me add that splitting one's work on several notebooks helps to locate things end edit them. I think is the same basic principle why in any complex progam (e.g. in C) one uses many files to define stuff. I know that I can push code into some .py and import it, but what if I need to see graphics? (lots of graphics)

Furthermore by splitting notebook on several browser tabs might solve issues to java-script timeouts such as those of this issue.

I am trying to transition to jupyter from Wolfram Mathematica (or similar closed source program) and it's quite a show stopper to be limited to one-notebook work.

@cqcn1991
Copy link
Author

@foice same thinking, and I think it's not very difficult to implement this feature.

@ran-z
Copy link

ran-z commented Jul 4, 2018

I agree, this feature could be very helpful at keeping different aspects of analysis or research separate and compartmentalized.

I'm thinking perhaps another approach which could achieve a similar outcome but will be easier to implement, is to create an extension which allows to define regions in the notebook - and then you could use one cell to start a region and give it a name, and another cell to end the region, and the extension can allow region collapse, execution, etc.

@foice
Copy link

foice commented Jul 5, 2018

ok, I am not alone then! even the fact that cut and paste of cells works only within the same notebook is a bit of a limitation ...

@mennowitteveen
Copy link

Would like to have a feature like this too. Maybe there is a way to make it less user facing?

@yusosov
Copy link

yusosov commented Aug 16, 2019

@takluyver
Multiple notebook to one kernel?
"...I think it's something we've considered before and aren't interested in supporting..."

Even 20 years ago in 1999 this feature was already present in "Wolfram Mathematica 3.0". It was absolutely obvious to the Wolfram team that it is not possible to manage anything complex enough in one only notebook. Even for Mathematica presentations that time I used several notebooks connected to one kernel.

For now Jupyter is just "a presentation tool" rather then "a development tool", inconvenient for anything larger then a thousand lines of code.

I support "Multiple notebook to one kernel" request, and will have to move on to see how to organize my code without Jupyter.

==Addition: I installed JupyterLab.
"Multiple notebook to one kernel" is supported in JupyterLab, so have to move there.

@alancalvitti
Copy link

yusosov, which version JupyterLab supports this? Can't find in 1.0.2 Can you share link to documentation?

@yusosov
Copy link

yusosov commented Aug 21, 2019

@alancalvitti
hopefully you've already found it. If not
I am on JupyterLab Version 1.0.2
to attach to an existing Kernel click on
whatever is to the left of the small circle in the upper right corner.
(For me it says Python 3). From there you can choose to which of the existing kernels to attach.
Or you can choose to stay not attached or shut down the kernel also.
Or you can execute another notebook like %run /path/to/anotherNotebook.ipynb from an existing notebook.
I have not read any documentation. I just found and started using it. For me today's JupyterLab 1.0.2 looks much like a "clumsy" version of Mathematica 3.1 from 1999 so I kind of new it had to be there =))).

@alancalvitti
Copy link

alancalvitti commented Aug 23, 2019 via email

@yusosov
Copy link

yusosov commented Aug 23, 2019 via email

@alancalvitti
Copy link

alancalvitti commented Sep 3, 2019 via email

@tonyfast
Copy link
Collaborator

This is solved in JupyterLab and will be solved in the future Notebook v7 release.

For more information about this new release, checkout the Notebook v7 Enhancement Proposal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests