Opened 23 months ago

Last modified 3 weeks ago

#25837 closed task

Make the sage notebook optional — at Version 11

Reported by: gh-timokau Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: packages: standard Keywords: notebook, sagenb
Cc: embray, vbraun, jdemeyer, kcrisman, fbissey, arojas, gh-timokau, infinity0, novoselt, pcpa, nthiery, slelievre, saraedum, schilly, strogdon, thansen, tmonteil, was Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by gh-timokau)

If you're coming from the deprecation notice in the notebook

The legacy sage notebook has been effectively deprecated for quite some time. We are now making that official. But that does not mean that sage will not have notebook functionality. In fact, most of the functionality of the sage notebook can already be replaced by using the Juypter Notebook instead. For an introduction on how to use the new notebook and convert existing notebooks, see the documentation.

There are *some* features that are not yet ported to the new notebook hovever. We will not completely stop supporting the legacy notebook until those issues are resolved. Those features are listed below. If there is some feature you're missing that is not listed or you want to give general feedback, feel free to leave a comment on this ticket. If you do not have an account yet, you can log in with a GitHub account.

Implementation details

Reasons to make sagenb optional

  • most of its functionality has been replaced for a while by Jupyter
  • it is not actively maintained -- merely on life support
  • and for me personally: I don't want to package it. I feel like it causes an unproportional amount of issues considering its relatively low value in todays sage.

Reasons to keep sagenb around

  • there are still some features depending on it

In making it optional, we still make it possible to use it for now. An when it inevitably breaks further, the people relying on it can weigh the effort of keeping it alive themselves against the effort of switching to the new notebook.

Tickets and issues tracking progress/going in that direction

Necessary to keep all tested behaviour in tact without sagenb ("pass the doctests")

  • port/remove the graph editor
  • port/remove the graph database navigator
  • port/remove the interactive debugger
  • #25382: do not include sagenb docs in sage

Misc changes

  • #25852: add a deprecation warning to the sage notebook
  • actually make sagenb optional

Functionality sagenb currently does better than Jupyter

  • #25015: object introspection (<obj>?) in the Jupyter notebook does not display HTML-formatted docs (esp. with latex formatting), while sagenb does
  • #24784: search_doc does not work in the Jupyter notebook
  • #9048: automatic_names only works in sagenb

Otherwise relevant

  • #22431: first step in making sagenb python3 compatible

Change History (11)

comment:1 follow-up: Changed 23 months ago by embray

Some issues I'm aware of related to features that are only in sagenb:

  • #25015 - object introspection (<obj>?) in the Jupyter notebook does not display HTML-formatted docs (esp. with latex formatting), while sagenb does. I believe Odile might be looking into this now. Not a significantly difficult issue but not trivial either.
  • #24784 - search_doc does not work in the Jupyter notebook

I think at a minimum these issues should be fixed before taking further steps at abandoning the old sagenb.

comment:2 Changed 23 months ago by kcrisman

I would also say that something "official" when one uses sagenb even when directly that says it is deprecated is necessary.

comment:3 in reply to: ↑ 1 Changed 23 months ago by gh-timokau

  • Description modified (diff)

comment:4 Changed 23 months ago by gh-timokau

I modified the ticket description to incorporate (read: shamelessly copy) your additions.

It would be nice if we could get the deprecation warning into 8.3 so that users will have at least one release to prepare. Thats a very optimistic estimate of course, but getting it in 8.3 would be nice either way.

comment:5 Changed 23 months ago by gh-timokau

  • Description modified (diff)

I have opened #25852 for that. I have only ever actually started the notebook once. Do you have an idea where best to add such a message? Just print it on the command line?

comment:6 Changed 23 months ago by kcrisman

Probably on the notebook itself as well, which would require changes in sagenb.

comment:7 Changed 23 months ago by slelievre

  • Cc arojas gh-timokau infinity0 novoselt pcpa nthiery slelievre saraedum schilly strogdon thansen tmonteil was added
  • Keywords sagenb added

cc a few people who package Sage in various ways

comment:8 Changed 23 months ago by embray

Another issue that was brought up here: https://ask.sagemath.org/question/43051/file-download-as-latex/

Converting a Jupyter notebook to PDF kind of sucks at the moment for notebooks that contain a lot of math in latex. There are two main cases in the notebook where latex can appear, and both have issues in sage:

1) If an object output from a code cell has _render_latex_ then the notebook will display the rendered latex with mathjax. However, when converting the notebook to PDF, nbconvert just takes the plain-text representation of the output, not the latex, and puts it in a verbatim block. Not good, especially not for Sage.

2) If a markdown cell contains equations in latex, nbconvert *will* render them correctly, but only if you have pandoc installed. This is already a known issue, but since pandoc does not come with Sage and is not a dependency this makes for a sucky user experience for something that should Just Work.

I'm not sure what to do about the first case; it seems like an issue for nbconvert but I haven't explored it too deeply. For the latter case (which probably also affects the first case) I wonder if we shouldn't just make pandoc another sage dependency.

comment:9 Changed 23 months ago by gh-timokau

  • Description modified (diff)

I've updated the ticket. The flask issue was resolved (thanks @fchapoton!), I added the pdf complaint and improved formatting.

comment:10 Changed 23 months ago by jdemeyer

  • Description modified (diff)

comment:11 Changed 23 months ago by gh-timokau

  • Description modified (diff)

I've added a section intended for end users. Please improve on that if you have more knowledge about sagenb or the Jupyter Notebook, which you probably do.

Note: See TracTickets for help on using tickets.