Opened 4 years ago
Closed 4 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: |
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 4 years ago by
comment:2 Changed 4 years ago by
notebook() should rather be changed to launch the jupyter notebook
comment:3 Changed 4 years ago by
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 4 years ago by
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.
comment:5 Changed 4 years ago by
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 4 years ago by
- Branch set to u/chapoton/26460
- Commit set to 578554c5a7918fe58e66ebf32704f7a252b93a9e
- Status changed from new to needs_review
comment:7 follow-up: ↓ 11 Changed 4 years ago by
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 4 years ago by
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 4 years ago by
- Milestone changed from sage-8.4 to sage-8.5
comment:10 Changed 4 years ago by
+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.
comment:11 in reply to: ↑ 7 Changed 4 years ago by
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 4 years ago by
- Commit changed from 578554c5a7918fe58e66ebf32704f7a252b93a9e to 476633d50aa9d72aeb6ab07b04caf92c92611724
Branch pushed to git repo; I updated commit sha1. New commits:
476633d | trac 26460 banner with full python version
|
comment:13 Changed 4 years ago by
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 4 years ago by
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.
comment:15 Changed 4 years ago by
I have not removed the copyright info. It was commented since long.
comment:16 Changed 4 years ago by
comment:17 Changed 4 years ago by
- Reviewers set to Jeroen Demeyer
- Status changed from needs_review to positive_review
comment:18 Changed 4 years ago by
- Branch changed from u/chapoton/26460 to 476633d50aa9d72aeb6ab07b04caf92c92611724
- Resolution set to fixed
- Status changed from positive_review to closed
For instance, instead of
the banner could look like