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

Notebook: run ExportSageNB by default #19740

Closed
vbraun opened this issue Dec 18, 2015 · 76 comments
Closed

Notebook: run ExportSageNB by default #19740

vbraun opened this issue Dec 18, 2015 · 76 comments

Comments

@vbraun
Copy link
Member

vbraun commented Dec 18, 2015

Change the default notebook application in Sage to be sagenb_export. This small web application, built on top of Jupyter, acts as migration wizard which can convert legacy Sage notebooks to Jupyter. It also has buttons to run either the legacy Sage notebook server or the new Jupyter notebook server.

Tarball: http://sage.ugent.be/www/jdemeyer/sage/sagenb_export-3.1.tar.gz

Depends on #22458

CC: @novoselt @gvol

Component: notebook

Author: Volker Braun, Jeroen Demeyer

Branch/Commit: 4d838d0

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/19740

@vbraun vbraun added this to the sage-7.0 milestone Dec 18, 2015
@vbraun
Copy link
Member Author

vbraun commented Dec 18, 2015

@vbraun
Copy link
Member Author

vbraun commented Dec 18, 2015

New commits:

580482cUse Jupyter notebook by default

@vbraun
Copy link
Member Author

vbraun commented Dec 18, 2015

Author: Volker Braun

@vbraun
Copy link
Member Author

vbraun commented Dec 18, 2015

Commit: 580482c

@jdemeyer
Copy link

comment:3

Shouldn't the DEPRECATION_NOTICE be shown only when the "default" notebook is run?

And I certainly think this ticket needs a discussion on sage-devel (I have no opinion on the matter).

@jdemeyer
Copy link

comment:4

I would also suggest to upgrade the relevant IPython/Jupyter packages and to get #19571 in too.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 18, 2015

Changed commit from 580482c to a119f6e

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 18, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

a119f6eShow deprecation notice only when launched for default

@sagetrac-tmonteil

This comment has been minimized.

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Jan 1, 2016

comment:8

Modfiy description to point to the discussion threads.

@jhpalmieri
Copy link
Member

comment:9

Small wording suggestion: change "The default notebook implementation changed" to "The default notebook implementation has changed".

Maybe it should say "The default notebook implementation has changed to Jupyter notebooks". I would prefer it if there were a method to convert old-style notebooks to new ones and that the deprecation notice described this method. I'm not sure if this is important enough to hold up a positive review for this ticket.

What happens to the Sage app on OS X? It starts a SageNB notebook server by default. Shouldn't that change, too? And print some sort of deprecation warning? I don't even see a way directly from the app to start a Jupyter server.

@kcrisman
Copy link
Member

comment:10

Maybe it should say "The default notebook implementation has changed to Jupyter notebooks". I would prefer it if there were a method to convert old-style notebooks to new ones and that the deprecation notice described this method. I'm not sure if this is important enough to hold up a positive review for this ticket.

I would more than prefer it.

What happens to the Sage app on OS X? It starts a SageNB notebook server by default. Shouldn't that change, too? And print some sort of deprecation warning? I don't even see a way directly from the app to start a Jupyter server.

Well, I guess you can launch any terminal command from the app, but I don't think it's been updated to have a script dedicated to launching ipynb (though you can get some terminals). Maybe at least adding this should be part of this as well as changing its launch page to note the new situation; I think it's unlikely to be good to change behavior for this audience without a clear "abort" situation and very clear instructions on how to migrate at a later time.

@vbraun
Copy link
Member Author

vbraun commented Jan 12, 2016

comment:11

The SageNB migration is at #19877

@gvol
Copy link

gvol commented Jan 13, 2016

comment:12

I created #19881 to track the Mac app changes.

@jdemeyer
Copy link

Changed author from Volker Braun to Volker Braun, Jeroen Demeyer

@jdemeyer
Copy link

comment:51

Replying to @kcrisman:

  • I have similar problems with %%cython though it completes running such a cell.

What do you mean? Which problems do you have?

@jdemeyer
Copy link

comment:52

Replying to @kcrisman:

  • More importantly, the button to the Jupyter just gives you a file listing - again, maybe not so helpful.

That's the way how Jupyter works and see no reason to change that.

@jdemeyer
Copy link

comment:53

Replying to @kcrisman:

@interact(layout=[['v1','v2','v3','v4'],['v12','v13','v14','v23','v24','v34'],['v123','v124','v134','v234']])

I was not aware of the interact(layout) parameter (it does not appear on the many examples from the Sage interacts wiki page that I tried). I need to see if this can be ported to Jupyter.

@jdemeyer
Copy link

comment:54

Replying to @kcrisman:

Interacts library fails.

interacts.calculus.simpson_integration()

(To be fair, I'm not sure whether this works right in the sagenb any more either.)

See #22636

@jdemeyer
Copy link

comment:55

Replying to @kcrisman:

Also, there doesn't seem to be a "batch" way to convert notebooks - one could imagine someone who used worksheets for daily class and now has to convert dozens at once. I know that the command-line interface to this should, or at least I thought I tried that out once. Could the converter support this?

I am really a beginner when it comes to web development. If somebody else wants to implement the user interface for this, I will gladly implement the server part of that feature.

@nthiery
Copy link
Contributor

nthiery commented Mar 18, 2017

comment:56

Replying to @kcrisman:

Interesting that the sws2rst and rst2ipynb double conversion is robust!

Is it? That would be good news. And a surprise to me indeed, at least
for the second part which I still consider as a quick hack.

@kcrisman
Copy link
Member

comment:57

What's wrong with the Mac app bundle (I am not a Mac user)?

Nothing is wrong with it (or maybe it is? I didn't test it yet), but people who had used it would be completely clueless as to this since they wouldn't have been exposed to command line at all, in principle, much less having to save it somewhere.

... %%cython

What do you mean? Which problems do you have?

The cell runs, but then I can't use the function defined in it. %%fortran is not recognized; %%r works but no graphics.

I was not aware of the interact(layout) parameter (it does not appear on the many examples from the Sage interacts wiki page that I tried). I need to see if this can be ported to Jupyter.

That is very understandable, as it is not used there much, more in later things. I do know a fair number of people who have used it, and if it can't be emulated it means multi-input interacts become far less useful (because too hard to see all the controls at once).

I am really a beginner when it comes to web development. If somebody else wants to implement the user interface for this, I will gladly implement the server part of that feature.

Hmm, I guess I am even more of a beginner there :) What I would say is that the UI at a very minimum could have a warning the top saying something like "Want to export several worksheets at once? Click here for precise instructions on how to do this." and then have said precise instructions, including giving them the custom path to use with the scripts in question.

Otherwise one would have to implement checkboxes, some sort of GET (?) operation, and then have an interface for where to save them (presumably not ALL at once in the usual directory, but a sub-directory) and now you're getting complicated. Plus then one wouldn't have the once-off "click on this worksheet to export it" feature, which is very nice, unless you separated that from the checkboxes ...

@kcrisman
Copy link
Member

comment:58

(To be fair, I'm not sure whether this works right in the sagenb any more either.)

Update - works in sagenb still, though some stuff does not pretty print any more, as that was apparently not updated.

See #22636

Yup. See also #22644.

@jdemeyer
Copy link

comment:59

Replying to @kcrisman:

... %%cython

What do you mean? Which problems do you have?

The cell runs, but then I can't use the function defined in it.

I regularly use %%cython myself and never found any problems with it in Jupyer.

Still, if it does not work for you, please open a ticket with more details (in particular an actual .ipynb file demonstrating the problem).

@jdemeyer
Copy link

comment:60

I created #22654 for %%fortran.

@jdemeyer
Copy link

comment:61

kcrisman: what would be needed for you to give positive review to this ticket?

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2017

comment:62

For batch conversion, how about just a link to download all notebooks (converted and zipped up). That would be easy to implement (ideally not on this ticket).

I'll merge this ticket when 7.6 is out...

@kcrisman
Copy link
Member

comment:63

kcrisman: what would be needed for you to give positive review to this ticket?

List (modulo merging this ticket and opening new 8.0 blockers for these):

  • Some kind of batch conversion option (perhaps as Volker suggests), including detailed instructions as to exactly where they end up. Opening a dialog as to where to save them would be really by far the best. Here's why: any user who has not used the command line except to start the notebook (in particular, Mac app users) will be completely lost trying to find them if they are sent to the pwd. In the Mac app that is in the midst of the bundle.
  • Probably more wording on the export main page about exactly what it's doing, where things end up. That wouldn't be too hard to get feedback on once one sends a beta out for testing. Maybe that would include instructions on what to do to start a new notebook in Jupyter, how to get "text cells", typesetting as in the recent sage-devel post, etc.
  • Testing whether this works properly with Mac app bundle at startup etc. I have no idea how this interfaces with it (haven't had time to test that), but if we send 8.0 and basically drop GUI Mac support, that is really bad marketing.
  • I would say that supporting remaining interact stuff (beyond what Jeroen has already fixed) would not be blocker, except that I think that Jupyter would be the only interface not supporting the layout parameter - is that correct?

A lot of this will be revealed in heavy testing. We should definitely recruit non-Jupyter users to test this out. Don't skimp!

@nthiery
Copy link
Contributor

nthiery commented Mar 22, 2017

comment:64

Replying to @vbraun:

For batch conversion, how about just a link to download all notebooks (converted and zipped up). That would be easy to implement

I like that; it falls in a usual workflow for users, with an explicit flexibility to choose where to store the notebooks.

@jdemeyer
Copy link

comment:65

Replying to @kcrisman:

  • Probably more wording on the export main page about exactly what it's doing, where things end up. That wouldn't be too hard to get feedback on once one sends a beta out for testing. Maybe that would include instructions on what to do to start a new notebook in Jupyter, how to get "text cells", typesetting as in the recent sage-devel post, etc.

I don't think all that should be on the export page. "more wording on the export main page about exactly what it's doing" sounds like a good idea, but explaining everything about Jupyter notebooks not.

@jdemeyer
Copy link

comment:66

I created #22663 for interact(layout=...).

@nthiery
Copy link
Contributor

nthiery commented Mar 22, 2017

comment:67

Replying to @jdemeyer:

I don't think all that should be on the export page. "more wording on the export main page about exactly what it's doing" sounds like a good idea, but explaining everything about Jupyter notebooks not.

Yup; better link to a good existing notebook tutorial rather than duplicating one there. One option would be to link to existing thematic tutorial after having updated it w.r.t. the Jupyter notebook.

With Sébastien, we will be running this tutorial at the upcoming Sage Days in Montréal at the end of April; this would be a good occasion to beta test it (and work on it beforehand).

@jdemeyer
Copy link

comment:68

Replying to @nthiery:

better link to a good existing notebook tutorial rather than duplicating one there. One option would be to link to existing thematic tutorial after having updated it w.r.t. the Jupyter notebook.

Well, to be honest, none of this can be done easily in Jupyter:

Making this help page into a worksheet

If you are browsing this document as a static web page, you can see all the examples; however you need to copy-paste them one by one to experiment with them. Use the Upload worksheet button of the notebook and copy-paste the URL of this page to obtain an editable copy in your notebook.

If you are browsing this document as part of Sage’s live documentation, you can play with the examples directly here; however your changes will be lost when you close this page. Use Copy worksheet from the File... menu at the top of this page to get an editable copy in your notebook.

@nthiery
Copy link
Contributor

nthiery commented Mar 22, 2017

comment:69

Replying to @jdemeyer:

Well, to be honest, none of this can be done easily in Jupyter

Indeed. That's why we need a round of beta test to see in practice
what's the best way to present a tutorial with similar aims but using
the Jupyter notebook.

@kcrisman
Copy link
Member

comment:70

I don't think all that should be on the export page. "more wording on the export main page about exactly what it's doing" sounds like a good idea, but explaining everything about Jupyter notebooks not.

Yup; better link to a good existing notebook tutorial rather than duplicating one there. One option would be to link to existing thematic tutorial after having updated it w.r.t. the Jupyter notebook.

Sure, that is fine, I didn't mean that you needed a ridiculously long first page, but making info easy to find is important.

Well, to be honest, none of this can be done easily in Jupyter

Indeed. That's why we need a round of beta test to see in practice what's the best way to present a tutorial with similar aims but using the Jupyter notebook.

Yeah, I would hope we could have a pretty lengthy beta period for this 8.0, even if that means a few tickets have to wait to get in as I guess 8.0 is only about this and a few attendant things. There are a few lists I'd like to spam about testing this out once a download of a beta becomes available (preferably also a Mac app version of the download, only for testing purposes).

@kcrisman
Copy link
Member

comment:71

Yeah, I would hope we could have a pretty lengthy beta period for this 8.0, even if that means a few tickets have to wait to get in as I guess 8.0 is only about this and a few attendant things. There are a few lists I'd like to spam about testing this out once a download of a beta becomes available (preferably also a Mac app version of the download, only for testing purposes).

See #19881 which was merged quite a while ago - I have never tried that out but perhaps it would be easy to integrate with this.

@vbraun
Copy link
Member Author

vbraun commented Mar 22, 2017

comment:72

Replying to @kcrisman:

Here's why: any user who has not used the command line except to start the notebook (in particular, Mac app users) will be completely lost trying to find them if they are sent to the pwd. In the Mac app that is in the midst of the bundle.

That should be fixable by chdir-ing to $HOME in the mac app...

@kcrisman
Copy link
Member

comment:73

Here's why: any user who has not used the command line except to start the notebook (in particular, Mac app users) will be completely lost trying to find them if they are sent to the pwd. In the Mac app that is in the midst of the bundle.

That should be fixable by chdir-ing to $HOME in the mac app...

Absolutely, but would have to be implemented - I don't want to ask a user who thinks dollar signs are for money to do it :-)

@kcrisman
Copy link
Member

comment:74

What happens with this in Jupyter? Is it a supported thing (whether single or double percent)?

%hide

Same question for #auto/%auto. These will be in many converted worksheets.

@vbraun
Copy link
Member Author

vbraun commented Mar 27, 2017

Changed branch from u/jdemeyer/use_jupyter_notebook_by_default to 4d838d0

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

No branches or pull requests

6 participants