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

modified ipython banner #8773

Closed
wants to merge 17 commits into from
Closed

modified ipython banner #8773

wants to merge 17 commits into from

Conversation

Achifaifa
Copy link

Modified the ipython banner, as suggested in issue #4556

I've opted for the format IPython <version> (Python <version>) -- An enhanced Interactive Python. since I got no feedback in the issue page and seemed like the cleanest way. This can be updated easily by changing the default_banner_parts variable in IPython/core/usage.py.

@Carreau
Copy link
Member

Carreau commented Aug 26, 2015

$ ipython
Python 3.4.3 |Anaconda 2.3.0 (x86_64)| (default, Mar  6 2015, 12:07:41)
Type "copyright", "credits" or "license" for more information.

IPython 4.1.0-dev -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

After

$ ipython
IPython 4.0.0-dev (Python 3.4.3) -- An enhanced Interactive Python.

In [1]:

I'm +1 on shortening, though this might be a bit short ,and we might want at least a line
like an about or something else that give user a bit more to hold onto.

As this is highly historical, I would like to ping @fperez and @ellisonbg

FYI julia prompt (has color):

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.11 (2015-07-27 06:18 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-unknown-linux-gnu

julia> 
$ irb
irb(main):001:0>

$ pry
[1] pry(main)>

elixir

$ iex
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (1.0.5) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>

@ellisonbg
Copy link
Member

I am +1 on shortening it as much as possible.

On Wed, Aug 26, 2015 at 7:45 AM, Matthias Bussonnier <
notifications@github.com> wrote:

$ ipython
Python 3.4.3 |Anaconda 2.3.0 (x86_64)| (default, Mar 6 2015, 12:07:41)
Type "copyright", "credits" or "license" for more information.

IPython 4.1.0-dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

After

$ ipython
IPython 4.0.0-dev (Python 3.4.3) -- An enhanced Interactive Python.

In [1]:

I'm +1 on shortening, though this might be a bit short ,and we might want
at least a line
like an about or something else that give user a bit more to hold onto.

As this is highly historical, I would like to ping @fperez
https://github.com/fperez and @ellisonbg https://github.com/ellisonbg

FYI julia prompt (has color):

           _

_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" for help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.3.11 (2015-07-27 06:18 UTC)
/ |_'|||__'| | Official http://julialang.org/ release
|__/ | x86_64-unknown-linux-gnu

julia>

$ irb
irb(main):001:0>

$ pry
[1] pry(main)>

elixir

$ iex
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (1.0.5) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>


Reply to this email directly or view it on GitHub
#8773 (comment).

Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

@fperez
Copy link
Member

fperez commented Aug 26, 2015

I think it should at least leave one line telling the new user what to type to get more information and how to quit, like the Elixir one, for example. It could be as simple as:

Type ? for more information and "quit" to quit

The --no-banner option should always be there for the experts to get absolutely zero output, but new/inexperienced users at the command line should get some guidance.

@fperez
Copy link
Member

fperez commented Aug 26, 2015

And I'd be curious to hear what others think.. I personally don't find our current banner to be too verbose, actually, and find that I like it more than a one-liner. I'd like to hear a bit more input before we go culling too hard. If I'm the lone holdout I'm not going to oppose some trimming (though I will oppose reducing it to zero), but at least I would like to hear more opinions first.

@Carreau
Copy link
Member

Carreau commented Aug 26, 2015

On small screen, (understand retina screen divided in 2 vertically). the banner might be a bit big, i wouldn't mind up to 5.

One thing that does annoy me is the extra blank line in interactive shell which is 33% less information density :

In [1]: 1
Out[1]: 1

In [2]: 2
Out[2]: 2

In [3]: 3
Out[3]: 3

In [4]: 4
Out[4]: 4
>>> 1
1
>>> 2
2
>>> 3
3
>>> 4
4

@fperez
Copy link
Member

fperez commented Aug 26, 2015

That extra blank line was an early, deliberate decision... It's less information density, but I found many cases where it made for a lot more readable output in more complex cases than the one you're showing.

I did put a lot of thought into that, and tested it a lot with my own workflow.

But it's configurable, it's a parameter in the prompt classes, and can be removed.

@ellisonbg
Copy link
Member

Yeah, I think the blank line serves a useful visual purpose.

@ellisonbg
Copy link
Member

For the simplification of the banner - this is where usage stats and usability testing would come in useful - otherwise we can only speculate on if users actually find the current banner helpful.

@fperez
Copy link
Member

fperez commented Aug 26, 2015

+1

@ellisonbg
Copy link
Member

But with out formal data in the usage of the banner does anyone have any anecdotal evidence about the banner from working with users?

@rgbkrk
Copy link
Member

rgbkrk commented Aug 26, 2015

I've enjoyed knowing whether I'm in my default Python or Continuum python when using the console. That bit is helpful (This is the python version bit that no longer exists from this PR).

@fperez
Copy link
Member

fperez commented Aug 26, 2015

My own anecdotal evidence is that, in its current form, it provides relatively minimal but useful information: versions of python and ipython, the banner data for python (the copyright/license stuff for python that I don't think we should drop), and four lines that help beginners get going.

And I do use those lines when teaching beginners, to show them how to get started. I tell them: look around, IPython is telling you what to do...

Command-line interfaces can be intimidating, and I think it's important not to make them overly hostile to the new user. The expert can always alias ip="ipython --no-banner and be done with it.

@rgbkrk
Copy link
Member

rgbkrk commented Aug 26, 2015

That extra blank line was an early, deliberate decision... It's less information density, but I found many cases where it made for a lot more readable output in more complex cases than the one you're showing.

The extra blank line is one of the unconscious reasons I switched to IPython over the default repl a bajillion years ago now. Regular repl always seemed crowded when I had a lot of output to work with. ❤️ whitespace

@Achifaifa
Copy link
Author

What about

IPython 4.0.0-dev (Python 3.4.3) -- An enhanced Interactive Python.
Type '?', '%quickref' or 'help' for help, and 'object?'/'object??' for object details

That would include exactly the same information as it currently does, but wouldn't be as bloated as the current one.

I understand that line helps beginners and to be honest the banner thing stopped bothering me once I realised I could add c.TerminalIPythonApp.display_banner=False to my config file, but 5 lines seem excessive, specially when you are only going to need them the first times you launch ipython and when you consider people will see that banner quite a lot of times throughout the day.

It would be nice to ask people who have recently used ipython for the first time for feedback. I remember making an internet search for a doubt I was having instead of using the actual ipython help :P

@fperez
Copy link
Member

fperez commented Aug 27, 2015

Note that the last suggestion throws away the python platform info, which is useful. Knowing that you're running say the Anaconda python vs the system one is often very important:

Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar 6 2015, 12:07:41)

and I also don't think, as a deference to Python itself, that we should wipe out the Python banner completely:

Type "copyright", "credits" or "license" for more information.

@Carreau
Copy link
Member

Carreau commented Aug 28, 2015

I did put a lot of thought into that, and tested it a lot with my own workflow.

Sorry didn't meant to upset people, I understand the use. It was just my point of view that was nt a request for change. I understand that it help for readability etc...

@fperez
Copy link
Member

fperez commented Aug 28, 2015

No worries, I'm not upset at all, I'm just indicating that there's a very good, well-thought out reasoning behind why IPython's command-line 'look and feel' is the way it is. It may feel a bit 'bloated' to someone, but each and every one of those lines has been thoroughly thought through. It's not the 21 lines of the default R console prompt:

$ R

R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin14.3.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> q()

but they are there for a reason. I think we can tighten the info as proposed above into

Type '?', '%quickref' or 'help' for help, and 'object?'/'object??' for object details

which will save a few lines, that sounds very good, if people want to go in that direction...

But again, people who really want minimalism, should just keep in their .bashrc:

alias ip='ipython --no-banner'

less to type, less to see, less to remember ;)

Cheers

f

@Achifaifa
Copy link
Author

So,

Python 3.4.3 |Anaconda 2.3.0 (x86_64)| (default, Mar  6 2015, 12:07:41)
Type "copyright", "credits" or "license" for more information.
IPython 4.1.0-dev -- An enhanced Interactive Python.
Type '?', '%quickref' or 'help' for help, and 'object?'/'object??' for object details

then? It has exactly the same things but it's less bulky

@fperez
Copy link
Member

fperez commented Aug 28, 2015

Better! I might suggest now shortening to just " 'x?/x??' for object details" to keep the overall line under 80 columns, as it is, it's 85. Replacing object with X makes the line 75 chars. long (since the word is used twice).

Thoughts?

@Achifaifa
Copy link
Author

There, done. To be honest, if all that information has to be in the banner there is nothing else to improve/change/chop off.

@fperez
Copy link
Member

fperez commented Aug 28, 2015

Thanks! As I said, experts can always alias.

@Carreau
Copy link
Member

Carreau commented Sep 3, 2015

+1, should we merge for a minor release, or is that to be consider only for major ?

@Carreau Carreau added this to the 5.0 milestone Sep 3, 2015
@Carreau
Copy link
Member

Carreau commented Sep 3, 2015

(i've marked as major for now)

@fperez
Copy link
Member

fperez commented Sep 3, 2015

5.0 is fine, thanks!

),
quick_guide
default_banner_parts = ["Python %s\n"%sys.version.split("\n")[0],
"Type 'copyryight', 'credits' or 'license' for more information\n" ,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyryight -> copyright

@Achifaifa
Copy link
Author

My bad, sorry about that.

@takluyver
Copy link
Member

That was quick for a PR that's been waiting months - thanks! :-)

I'm not a big fan of how this line has turned out now:

Type '?', '%quickref' or 'help' for help, and 'object?'/'object??' for object details
  1. There are three things 'for help', and no explanation of how they relate to one another. If a user does need help, this immediately presents them with a confusing choice that they don't have the information to make.
  2. Aesthetically, all those quotes look ugly.

I have looked into shortening the banner before, and concluded there's nothing that can easily be cut. I'll have a play around to see if I can improve on this sentence at all.

@takluyver
Copy link
Member

Text mockup

Python 3.4.3 |Anaconda 2.3.0 (x86_64)| (default, Mar  6 2015, 12:07:41)
Type 'help', 'copyright', 'credits' or 'license' for more information.

IPython 4.1.0-dev
Type '?' for an overview of IPython features, or 'x?' for information about x

@Achifaifa
Copy link
Author

No problem! I also think it looks weird now that I see it after all this time. It doesn't bother me personally, but maybe we should ask people who actually see it every time they launch ipython.

And as a side note, I'm also interested in knowing if the new users read the help lines and type those things when having trouble or just look their issues up in StackOverflow. Looks like they are there for them and feedback on this would be great.

@Achifaifa
Copy link
Author

This has kinda exploded on my face, hang on a minute while I fix it...

@Achifaifa
Copy link
Author

I honestly can't tell if I've fixed it or not. Would you please mind making sure it's all OK before merging?

Sorry about the mess.

@takluyver
Copy link
Member

Looking at the diff, I think you've accidentally restored stuff that was recently deleted in master. In general, we recommend rebasing rather than merging master into branches.

However, I remain unconvinced about the changes that this is actually trying to introduce.

@Achifaifa
Copy link
Author

Oh, the gui_reference? I thought that deletion was some mistake of the conflict I was trying to solve. I'll update it.

About the changes... I don't think I've much say on this. I worked on it after reading the suggestion because it's one of the things I'd have liked to see when I started using ipython. I'm happy with the result but I understand people have strong opinions about it.

Just let me know of any further updates to include. And if it turns out to just be a bad idea just close the PR, I'd feel bad if people used too much time arguing about this not-so-important thing when there are other bugs/things to fix.

object? -> Details about 'object', use 'object??' for extra details.
quick_guide = "Type '?', '%quickref' or 'help' for help, and 'x?/x??' for object details\n"

gui_note = """\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit was deleted in master as well.

@takluyver
Copy link
Member

My biggest concern with the new text is that it offers the user three completely different options 'for help', when they have no idea which one they want. We either need to differentiate what kind of help they are (which is what the current banner does), or pick just one 'help' resource to point out (which is really hard).

@Carreau Carreau modified the milestones: 6.0, 5.0 May 25, 2016
@klonuo
Copy link
Contributor

klonuo commented Jun 25, 2016

My 2c to old PR... I'd vote for:

Type ? for more information and "quit" to quit

besides one line of version info.

Other variants look complicated, and all that info can be presented in introductory section when user types ?

@fperez
Copy link
Member

fperez commented Aug 25, 2016

OK, I'm willing to go with much smaller banner, that looks like this (i.e., down to even removing blank lines). It becomes three lines altogether, the same as the plain python prompt:

denali[~]> ip
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:52:12) 
Type "copyright", "credits" or "license" for more information.
IPython 6.0.0.dev -- An enhanced Interactive Python. Type '?' for help.

In [1]: 

But I will only sign off on this IF the ? help text is rewritten so that very early on at the start, it explains help, foo?/foo?? and mentions %quickref. That's why I'm not making the fixed PR myself: the above is taken from my actual screen where I changed the banner to this, but I don't have time right now to fix the ? text.

If we do that, then I'm OK: the main banner would get much smaller, it would funnel new users into ? right off the bat, and ? would say at the start how to get more info, before diving into a longer explanation.

I think that would satisfy what I want to preserve, which is that we need to show something that always helps users at the command line. The argument about the notebook doesn't fully apply here, because given it's a web application, it can have a full-blown help menu and other tools to assist new users. At the cmd line, we need to show some hint of how to get information always, since we can't know in advance if the user is new or experienced.

So, if anyone makes the banner as above and does a bit of word-smithing on the ? text to convey what we're removing early on (before users have had to read pages of info), then I'm ok.

@fperez
Copy link
Member

fperez commented Aug 25, 2016

Thanks @stefanv for the feedback!

Carreau added a commit to Carreau/ipython that referenced this pull request Aug 25, 2016
Carreau added a commit to Carreau/ipython that referenced this pull request Aug 25, 2016
@Carreau Carreau mentioned this pull request Aug 25, 2016
@Carreau
Copy link
Member

Carreau commented Aug 25, 2016

Submitted #9912 with @fperez suggestions.

Carreau pushed a commit to Carreau/ipython that referenced this pull request Aug 29, 2016
This is a squash of all the commits found in

    `ipython#8773

 - updated banner
 - updated banner again
 - fixed type
 - modified ipython banner
 - attempt at fixing rebase issues
 - modified ipython banner
 - fixed git screwup
 - updated banner
 - updated banner again
 - fixed type
 - fixed accidental deleted gui_reference restoration
Carreau added a commit to Carreau/ipython that referenced this pull request Aug 29, 2016
@Carreau
Copy link
Member

Carreau commented Aug 30, 2016

Merged in #9912 ,

Thanks all for the hard work and apology for a PR to have taken that long to be merged !

@Carreau Carreau closed this Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants