Opened 3 years ago

Closed 3 years ago

#26460 closed enhancement (fixed)

Modify the banner for Python3-based Sage

Reported by: slelievre Owned by:
Priority: minor Milestone: sage-8.5
Component: python3 Keywords:
Cc: chapoton, embray, saraedum, slelievre Merged in:
Authors: Frédéric Chapoton Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 476633d (Commits, GitHub, GitLab) Commit: 476633d50aa9d72aeb6ab07b04caf92c92611724
Dependencies: Stopgaps:

Status badges

Description

This ticket is about modifying the banner for Python3-based Sage, if others agree.

For example, if the SageNB notebook does not work in Python3-based Sage, we could replace

Type "notebook()" for the browser-based notebook interface.

by

Powered by Python 3.

Change History (18)

comment:1 Changed 3 years ago by slelievre

For instance, instead of

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.4.rc0, Release Date: 2018-10-07                 │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘

the banner could look like

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.4.rc0, Release Date: 2018-10-07                 │
│ Powered by Python 3. Type "?" for help.                            │
└────────────────────────────────────────────────────────────────────┘

comment:2 Changed 3 years ago by chapoton

notebook() should rather be changed to launch the jupyter notebook

comment:3 Changed 3 years ago by jhpalmieri

Is it possible to start the Jupyter notebook from Python? I mean, it must be, but it is not documented in any obvious place.

comment:4 Changed 3 years ago by slelievre

From the Sage REPL, providing sage is in the PATH, one can run

sage: os.system('sage -n jupyter')

or just

sage: !sage -n jupyter

In case JupyterLab is also present, one could also do

sage: os.system('sage -n jupyterlab')

or just

sage: !sage -n jupyterlab

Installing JupyterLab can be achieved by running

$ sage --pip install jupyterlab

in a terminal.

Last edited 3 years ago by slelievre (previous) (diff)

comment:5 Changed 3 years ago by embray

I would rather simply put the Python version in the banner, if at all. I would just drop the message about notebook() in general; that or change notebook() to launch Jupyter notebook by default.

comment:6 Changed 3 years ago by chapoton

  • Branch set to u/chapoton/26460
  • Commit set to 578554c5a7918fe58e66ebf32704f7a252b93a9e
  • Status changed from new to needs_review

here is a proposal


New commits:

578554cchange the banner : no more notebook(), show python version

comment:7 follow-up: Changed 3 years ago by chapoton

My proposal looks like that:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.5.beta1, Release Date: 2018-10-27               │
│ Using Python 3.6. Type "help()" for help.                          │
└────────────────────────────────────────────────────────────────────┘

comment:8 Changed 3 years ago by embray

Fine by me. Maybe bring this up on the mailing list. People tend to have a lot of opinions about this banner, for some reason... (I mean, it is the first thing you see when you start Sage so I guess that makes sense)

comment:9 Changed 3 years ago by chapoton

  • Milestone changed from sage-8.4 to sage-8.5

comment:10 Changed 3 years ago by jdemeyer

+1 to this except that I would mention the complete Python version number (2.7.15 instead of 2.7). It's more informative and I don't see any reason to not use the complete version number.

Last edited 3 years ago by jdemeyer (previous) (diff)

comment:11 in reply to: ↑ 7 Changed 3 years ago by klee

Jupyter seems to prefer narrower banner, as you can see in About ... Kernel menu.

So how about?

│ SageMath 8.5.beta1, released 2018-10-27     |  
│ Using Python 3.6. Type "help()" for help.   │

On the other hand, "Running with" reads better than "Using", though this makes it longer...

comment:12 Changed 3 years ago by git

  • Commit changed from 578554c5a7918fe58e66ebf32704f7a252b93a9e to 476633d50aa9d72aeb6ab07b04caf92c92611724

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

476633dtrac 26460 banner with full python version

comment:13 Changed 3 years ago by chapoton

Now with the full python version. For the width, we are constrained by the beta releases message, so no change. And we do not have any clean command to replace "notebook()"

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.5.beta1, Release Date: 2018-10-27               │
│ Using Python 2.7.15. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

comment:14 Changed 3 years ago by dimpase

You've removed the copyright info, which is not so good. How about mimicking the CPython, which has Type "help", "copyright", "credits" or "license" for more information..

So we could have a line saying

Type "help()", "copyright()", or "credits()" for more information.

And Using Python... can be squeezed into the end of the 1st line.

Last edited 3 years ago by dimpase (previous) (diff)

comment:15 Changed 3 years ago by chapoton

I have not removed the copyright info. It was commented since long.

Last edited 3 years ago by chapoton (previous) (diff)

comment:16 Changed 3 years ago by chapoton

  • Authors set to Frédéric Chapoton

comment:17 Changed 3 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to positive_review

comment:18 Changed 3 years ago by vbraun

  • Branch changed from u/chapoton/26460 to 476633d50aa9d72aeb6ab07b04caf92c92611724
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.