Transition from jupyter notebook to jupyterlab

234 views
Skip to first unread message

Matthias Koeppe

unread,
Aug 19, 2020, 5:55:22 PM8/19/20
to sage-devel
The Jupyter notebook developers encourage users to transition to using JupyterLab, see https://github.com/jupyter/notebook#notice

For Sage 9.2 it would be good to already have jupyterlab as an optional package, and to make sure that all interactive features including documentation and graphics work.

See https://trac.sagemath.org/ticket/30399


Samuel Lelievre

unread,
Aug 19, 2020, 9:59:45 PM8/19/20
to sage-devel
2020-08-19 21:55:22 UTC, Matthias Koeppe:
Note that JupyterCon-2020 is fully online next October.

It ends with a "Jupyter Sprints" day on 2020-10-27.
The deadline for submitting a sprint is 2020-09-11.
Registration to the sprints day is free.

Would anyone want to lead a "Math software and Jupyter",
or possibly just a "SageMath and Jupyter" sprint?

kcrisman

unread,
Aug 20, 2020, 8:54:55 AM8/20/20
to sage-devel
On Wednesday, August 19, 2020 at 5:55:22 PM UTC-4 Matthias Koeppe wrote:
The Jupyter notebook developers encourage users to transition to using JupyterLab, see https://github.com/jupyter/notebook#notice


Hi - just for informational purposes, exactly what effect does this have on end users?  Can they still open .ipynb files?  The link you give is a little vague on this, and the picture at https://jupyter.org makes it seems like the new version is more of an RStudio type IDE, which is a lot for students to handle in non-programming courses. 

Matthias Koeppe

unread,
Aug 20, 2020, 9:12:18 AM8/20/20
to sage-devel
On Thursday, August 20, 2020 at 5:54:55 AM UTC-7, kcrisman wrote:
On Wednesday, August 19, 2020 at 5:55:22 PM UTC-4 Matthias Koeppe wrote:
The Jupyter notebook developers encourage users to transition to using JupyterLab, see https://github.com/jupyter/notebook#notice


just for informational purposes, exactly what effect does this have on end users?  Can they still open .ipynb files?  The link you give is a little vague on this, and the picture at https://jupyter.org makes it seems like the new version is more of an RStudio type IDE, which is a lot for students to handle in non-programming courses. 

 I am hoping actual users of these systems can help answer this question. (I use neither.)


Samuel Lelievre

unread,
Aug 20, 2020, 9:28:16 AM8/20/20
to sage-devel
2020-08-20 12:54:55 UTC, kcrisman:
>
> On Wednesday, August 19, 2020 at 5:55:22 PM UTC-4 Matthias Koeppe wrote:
>
> > The Jupyter notebook developers encourage users to transition to
>
> Hi - just for informational purposes, exactly what effect does this
> have on end users?  Can they still open .ipynb files?  The link you
> give is a little vague on this, and the picture at
> makes it seems like the new version is more of an RStudio type IDE,
> which is a lot for students to handle in non-programming courses.

## The .ipynb format stays the same

JupyterLab is a new interface: it is still browser-based,
but it allows to open several files (or terminal sessions)
as sub-tabs in a same browser tab, and to tile them.

The .ipynb format stays exactly the same and documents
are completely compatible.

## Install

Install using:
```
$ sage --pip install jupyterlab
```

## Use

Then you can use either or both of Jupyter Notebook and JupyerLab.

To start JupyterLab use one of:
```
$ sage -n jupyterlab
$ sage --jupyter lab
```

To start Jupyter Notebook use one of:
```
$ sage -n jupyter
$ sage --jupyter notebook
```
as usual.

## Videos

Some videos presenting JupyterLab:

- PyData 2017

- JupyterCon 2017

- PLOTCON 2017: Sylvain Corlay,
  Interactive Data Visualization in JupyterLab
  May 2017

## Localisation

JupyterLab 3 will have localisation, helping make Jupyter
more accessible to non-English speakers:


Translations are crowdsourced using Crowdin:


## Still missing: presentations in .ipynb with RISE

The RISE extension (for notebook-based presentations)
so far has not been ported to JupyterLab.

Tickets on the RISE side and on the JupyterLab side:

- Make RISE work in JupyterLab

- Integrate RISE into JupyterLab

TB

unread,
Aug 20, 2020, 7:05:45 PM8/20/20
to sage-...@googlegroups.com
On 20/08/2020 16:28, Samuel Lelievre wrote:
2020-08-20 12:54:55 UTC, kcrisman:
>
> On Wednesday, August 19, 2020 at 5:55:22 PM UTC-4 Matthias Koeppe wrote:
>
> > The Jupyter notebook developers encourage users to transition to
>
> Hi - just for informational purposes, exactly what effect does this
> have on end users?  Can they still open .ipynb files?  The link you
> give is a little vague on this, and the picture at
> makes it seems like the new version is more of an RStudio type IDE,
> which is a lot for students to handle in non-programming courses.


Regarding the more complicated interface (which I also wonder about), the second item from the above notice is:

"2. To address JupyterLab feature parity issues. As part of this effort, we are also working on a better notebook-only experience in JupyterLab for users who prefer the UI of the classic Jupyter Notebook."


Thanks for all the info below.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/3eb29ecf-6da7-4d7d-ad8a-c747cac02180o%40googlegroups.com.

Nathan Dunfield

unread,
Aug 21, 2020, 10:19:29 AM8/21/20
to sage-devel
I use Jupyter with Sage somewhat regularly, and have tried out JupyterLab on several occasions.  I use Jupyter notebooks only when making a lot of plots as otherwise I prefer an editor+REPL setup.  In particular, I have not used it in any of my classes.

As mentioned, JupyterLab is more like an IDE than the classic Jupyter and so has a rather different feel.  Possibly as a consequence, my understanding is that adoption of JupyterLab over Jupyter classic in the general scientific computing community has been quite slow, with many people trying Lab and then sticking with Classic [1, 2, 3].  Classic Jupyter has a relatively simple interface that's good for beginning programers and other non-developers, but the editor in JupyterLab isn't as sophisticated as Emacs or VS Code and so it also doesn't appeal to many hard-core developers.  I tried Lab fairly early (around the first non-beta release) and at the time there were enough rough edges that I went back to Classic which had all the features I needed anyway.

I think Sage would be better off sticking with Jupyter Classic until a version of JupyterLab is available that can emulate Classic; otherwise, the interface switch will be fairly jarring to users, especially the less experienced ones for whom notebook interfaces are particularly appealing, in addition to all the technical hurdles.

Best,

Nathan

P.S. That said, one thing Lab is really great for is pulling a basic but serviceable development environment out of a Docker container.  I know people who have had success with this approach for undergraduate computational research projects.


kcrisman

unread,
Aug 21, 2020, 11:00:43 AM8/21/20
to sage-devel
I think Sage would be better off sticking with Jupyter Classic until a version of JupyterLab is available that can emulate Classic; otherwise, the interface switch will be fairly jarring to users, especially the less experienced ones for whom notebook interfaces are particularly appealing, in addition to all the technical hurdles.

Thanks, Nathan, that is what I had suspected after looking at the screenshots. Unfortunately I don't have time even to even test packages people kindly cc: me on on Trac, much less test this one out :-(  but given that we didn't really deprecate sagenb *that* long ago, a second change might not be so great quite yet unless necessary for some other reason.

Matthias Koeppe

unread,
Aug 21, 2020, 1:46:28 PM8/21/20
to sage-devel
Thanks all for sharing your insights!

I agree that seems a good plan to wait until JupyterLab has implemented the classic notebook. So there is no urgency in making this change.

However, we should make sure that Sage works in its entirety with JupyterLab - ideally for Sage 9.2 already.

A key shortcoming is that interacts currently don't work - https://trac.sagemath.org/ticket/30246
Is someone here able to fix this?

Matthias Koeppe

unread,
Sep 2, 2020, 8:22:10 PM9/2/20
to sage-devel
Thanks to Joshua Campbell's work in https://trac.sagemath.org/ticket/30246
the current beta (9.2.beta11) has a fully functional JupyterLab as an optional package - including interacts.

This could use broader testing now. See https://wiki.sagemath.org/ReleaseTours/sage-9.2#IPython.2C_Jupyter_notebook.2C_JupyterLab for (brief) instructions.

Would someone be interested in expanding this section in the release tour, describing 1) the upgraded jupyter notebook, and 2) jupyterlab?

Samuel Lelièvre

unread,
Sep 2, 2020, 8:59:18 PM9/2/20
to Sage-devel
2020-08-03 00:22 UTC, Matthias Koeppe:
>
> Thanks to Joshua Campbell's work in
> https://trac.sagemath.org/ticket/30246
> the current beta (9.2.beta11) has a fully functional
> JupyterLab as an optional package - including interacts.

Wonderful.

> This could use broader testing now. See
> https://wiki.sagemath.org/ReleaseTours/sage-9.2#IPython.2C_Jupyter_notebook.2C_JupyterLab
> for (brief) instructions.

I will do some testing. On my wishlist would be,
both in Jupyter Notebook and in JupyterLab,
to make it so the text editor will apply Python
syntax highlighting to .sage file as it does to
.py and .pyx files. Someone asked about it at

- Ask Sage question 52334
Syntax Highlight in JupyterLab Editor
https://ask.sagemath.org/question/52334

Questions to this effect remained unanswered
on the Jupyter mailing list and discourse server:

- https://groups.google.com/d/topic/jupyter/G_euKH35vU0/discussion
- https://discourse.jupyter.org/t/associate-a-file-type-with-a-specific-syntax-highlighting-in-the-text-editor/965
- https://discourse.jupyter.org/t/syntax-highlighting-for-text-files-in-jupyter-notebook-and-jupyterlab/5186

If someone can figure that out, that would be great!

Jason Grout

unread,
Sep 2, 2020, 11:07:28 PM9/2/20
to sage-devel
Hi everyone,

First, it's really great to post here again :). Sorry I didn't see this thread earlier, but thanks to the recent activity it surfaced again in my inbox. I really love seeing the discussion here! Feel free to reach out to ping me or other JupyterLab developers on topics like this.

Disclaimer: I'm one of the principal developers of JupyterLab.

A few thoughts:

1. It is awesome to see Sage offer JupyterLab as an option for notebooks. Eventually the classic notebook will be retired, so working on offering JupyterLab is a good thing to do. JupyterLab 3.0 will drop support for python 3.5, so (if I'm reading things right) it's great Sage is supporting Python 3.6.

2. Karl-Dieter, to answer your question about notebooks: we've worked really hard to make the transition from "classic Notebook" to JupyterLab smooth, so yes, it not only opens notebook files, but we also went to great lengths to have feature parity with notebook.

3. (I'm also helping organize JupyterCon.) I think it would be great to have a sprint at JupyterCon on math and JupyterLab, or integrating Sage and Jupyter. We'll be posting the program schedule and list of talks soon. The sprint organization is happening separately from the talks, so if you want to propose one, make sure to get it in by the sprint proposal deadline.

4. We're really excited about some of the improvements coming in JupyterLab 3.0 (targeted for release before JupyterCon), especially in the single-document mode that makes it much more approachable, similar to the simplicity you get in the classic Notebook. You can try the JupyterLab 3.0 beta (released a few days ago) with `pip install --pre jupyterlab`.

6. For syntax highlighting - here is a comment showing how to add syntax highlighting for a filetype: https://github.com/jupyterlab/jupyterlab/issues/4223#issuecomment-547934247. However, I agree it's not very elegant, and we should make that a better api.

Thanks,

Jason





--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

Samuel Lelièvre

unread,
Sep 3, 2020, 5:56:07 AM9/3/20
to Sage-devel
2020-08-03 03:07 UTC, Jason Grout:
>
> Hi everyone,
>
> First, it's really great to post here again :). Sorry I didn't see this thread earlier,
> but thanks to the recent activity it surfaced again in my inbox. I really love
> seeing the discussion here! Feel free to reach out to ping me or other
> JupyterLab developers on topics like this.
>
> Disclaimer: I'm one of the principal developers of JupyterLab.

Hi Jason! Fantastic to read you here again! And thanks for the
offer to ping you and other JupyterLab developers on such topics!

> A few thoughts:
>
> 1. It is awesome to see Sage offer JupyterLab as an option for notebooks.
> Eventually the classic notebook will be retired, so working on offering
> JupyterLab is a good thing to do. JupyterLab 3.0 will drop support for
> Python 3.5, so (if I'm reading things right) it's great Sage is supporting
> Python 3.6.

Yes, Sage 9.2 will support Python 3.6, 3.7, 3.8, but drops support
for Python 2 and for Python <= 3.5. See also

- #30184 - Support Python 3.9
https://trac.sagemath.org/ticket/30184

- #30384 - Adopt the “time window-based” policy for support of Python
versions from NEP 29
https://trac.sagemath.org/ticket/30384

> 2. Karl-Dieter, to answer your question about notebooks: we've worked
> really hard to make the transition from "classic Notebook" to JupyterLab
> smooth, so yes, it not only opens notebook files, but we also went to
> great lengths to have feature parity with notebook.

That's very nice!

> 3. (I'm also helping organize JupyterCon.) I think it would be great to have
> a sprint at JupyterCon on math and JupyterLab, or integrating Sage and
> Jupyter. We'll be posting the program schedule and list of talks soon.
> The sprint organization is happening separately from the talks, so if you
> want to propose one, make sure to get it in by the sprint proposal deadline.

I really hope there will be a sprint on "Jupyter and math software".

- The deadline for submitting a sprint is Friday 11 Sep 2020.
- The day for JupyterCon sprints will be Saturday 17 Oct 2020.

Links:
- https://jupytercon.com
- https://jupytercon.com/sprint/

I might be able to participate ... but also might not, so in any case
I cannot offer to be an organiser.

> 4. We're really excited about some of the improvements coming
> in JupyterLab 3.0 (targeted for release before JupyterCon),
> especially in the single-document mode that makes it much more
> approachable, similar to the simplicity you get in the classic Notebook.
> You can try the JupyterLab 3.0 beta (released a few days ago)
> with `pip install --pre jupyterlab`.

Wow, excellent news! Will definitely give it a try!

> 6. For syntax highlighting - here is a comment showing how to add
> syntax highlighting for a filetype:
> https://github.com/jupyterlab/jupyterlab/issues/4223#issuecomment-547934247.
> However, I agree it's not very elegant, and we should make that a better api.

Great to read. I was wondering if there was an official ticket for that,
so thanks for the pointer to the relevant GitHub issue. Do you know
whether this works both for JupyterLab and Jupyter Notebook?

kcrisman

unread,
Sep 3, 2020, 8:39:46 AM9/3/20
to sage-devel

Always great to hear from you, Jason!  
 
2. Karl-Dieter, to answer your question about notebooks: we've worked really hard to make the transition from "classic Notebook" to JupyterLab smooth, so yes, it not only opens notebook files, but we also went to great lengths to have feature parity with notebook.


As you know, my primary concern remains with those who are not using Sage via administered solutions, but who will have had to change notebook format/style possibly twice within five years.  For research mathematicians, data scientists, etc., that is nothing; for someone who only teaches a certain course once every two or three years, that could make someone prefer to stay with a "more stable" notebook interface - say, one that starts with an M, not to put too fine a point on it.

To make a positive suggestion, would it be possible for whatever the Sage default behavior for opening a worksheet is to have some sort of backward compatibility as well?  As an example, if we can get someone to update the Mac app to launch a Jupyterlab server instead of a Jupyter server whenever that would become the default, that would be useful.  (Otherwise the Mac app may have to be dropped, since its primary usefulness is in being able to "just start a worksheet" and have it paired to .sws or .ipynb files through the GUI, though there are many quite useful secondary features as well.)  Ideally a user who only interacts via single-user worksheets, no matter how they launch them, might never even notice the difference, though maybe that's not possible.

"We're really excited about some of the improvements coming in JupyterLab 3.0 (targeted for release before JupyterCon), especially in the single-document mode that makes it much more approachable, similar to the simplicity you get in the classic Notebook."

That sounds great.  Are there screenshots available for those who might not have time to test out Jupyterlab properly?

Concluding unscientific postscript: I do continue to also state the minority opinion that (non-corporate, e.g. not certain Linux distros, the biggest programming languages, some R solutions) open source technology needs to worry a little more about long-term support if it is to ever go beyond the cognoscenti.  Maybe that isn't the goal.  But that would be a shame.

Jason Grout

unread,
Sep 4, 2020, 2:01:35 PM9/4/20
to sage-devel
On Thu, Sep 3, 2020 at 2:56 AM Samuel Lelièvre <samuel....@gmail.com> wrote:
2020-08-03 03:07 UTC, Jason Grout:

> 6. For syntax highlighting - here is a comment showing how to add
> syntax highlighting for a filetype:
> https://github.com/jupyterlab/jupyterlab/issues/4223#issuecomment-547934247.
> However, I agree it's not very elegant, and we should make that a better api.

Great to read. I was wondering if there was an official ticket for that,
so thanks for the pointer to the relevant GitHub issue. Do you know
whether this works both for JupyterLab and Jupyter Notebook?


While the same basic mode works for both (since both are using codemirror), how to access the codemirror and how to deploy that bit of javascript to the browser is different between JupyterLab and Jupyter Notebook.

Jason

 

Jason Grout

unread,
Sep 4, 2020, 2:57:31 PM9/4/20
to sage-devel
On Thu, Sep 3, 2020 at 5:39 AM kcrisman <kcri...@gmail.com> wrote:

Always great to hear from you, Jason!  
 
2. Karl-Dieter, to answer your question about notebooks: we've worked really hard to make the transition from "classic Notebook" to JupyterLab smooth, so yes, it not only opens notebook files, but we also went to great lengths to have feature parity with notebook.


As you know, my primary concern remains with those who are not using Sage via administered solutions, but who will have had to change notebook format/style possibly twice within five years.  For research mathematicians, data scientists, etc., that is nothing; for someone who only teaches a certain course once every two or three years, that could make someone prefer to stay with a "more stable" notebook interface - say, one that starts with an M, not to put too fine a point on it.

To make a positive suggestion, would it be possible for whatever the Sage default behavior for opening a worksheet is to have some sort of backward compatibility as well?  As an example, if we can get someone to update the Mac app to launch a Jupyterlab server instead of a Jupyter server whenever that would become the default, that would be useful.  (Otherwise the Mac app may have to be dropped, since its primary usefulness is in being able to "just start a worksheet" and have it paired to .sws or .ipynb files through the GUI, though there are many quite useful secondary features as well.)  Ideally a user who only interacts via single-user worksheets, no matter how they launch them, might never even notice the difference, though maybe that's not possible.

As you may know, you can launch Jupyter Notebook with a specific file to open with `jupyter notebook myfile.ipynb`

I would love to have something similar for jupyterlab, as well as a command-line switch to enable this single-document mode: `jupyter lab --single-doc myfile.ipynb`

FYI, here is more discussion about the single-document mode, including several other community experiments for this: https://github.com/jupyterlab/jupyterlab/issues/8450

I've opened an issue for opening files from the command line: https://github.com/jupyterlab/jupyterlab/issues/8959

 

"We're really excited about some of the improvements coming in JupyterLab 3.0 (targeted for release before JupyterCon), especially in the single-document mode that makes it much more approachable, similar to the simplicity you get in the classic Notebook."

That sounds great.  Are there screenshots available for those who might not have time to test out Jupyterlab properly?


Not yet, but Steve Silvester said he'd start working on the changelog and release highlights soon :)


Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages