Skip to content
This repository

fix pylab StartMenu item #1128

Merged
merged 2 commits into from over 2 years ago

3 participants

Min RK Thomas Kluyver Fernando Perez
Min RK
Owner

I do this as a PR rather than pushing straight, because we need to make a small decision.

The Start Menu item we create for pylab mode with the Windows previously loaded the pylab profile , rather than using --pylab (it had a typo preventing it from working at all, hence the PR). This conflicts with the fact that the pylab profile we ship seems meant as an example for non-standard pylab init, and really expects to be edited. For instance, it explicitly sets qt, ignoring matplotlib config, and does not use %pylab, in favor of %gui qt and some custom imports.

We should decide whether it should use --pylab or --profile=pylab. I would lean towards the former, but if we go with the latter, we must change the pylab profile to no longer be an example of weird config, but an example of simple/common config.

Min RK
Owner

pinging @fperez, based on his reply on-list. We previously shipped a pylab profile, which set the backend to Qt, among other things, and showed an example of inheriting config from the default profile. In this PR, I've removed the profile, and changed the Start Menu item to use the default profile. Does that sound good? Another option would be for the Start Menu item to still load --profile=pylab, even if that doesn't exist. This would allow users to have separate config triggered by each menu item, which not be enabled in the current state of the PR.

Thomas Kluyver
Collaborator

If config is inherited, the most obvious effect of using a separate profile is a separate history. On the one hand, it's quite natural to have a separate history for pylab, because you're using a lot of names that aren't present in the default IPython shell. On the other hand, a unified history is possibly the 'least surprise' option, and is handy if you want to take code from non-pylab to pylab.

I'm currently mildly in favour of using the default profile (the current state of the PR), but I've flip flopped twice in writing this comment.

Fernando Perez
Owner

I agree that it's great to have a separate profile to distinguish the histories, but we should go for simplicity and generality. I think the cleanest solution is to go with --pylab, nuke the weird pylab profile, and then simply have a clean explanation of how to create a profile that inherits from another, along with explaining how this impacts history. This gives the benefits of these ideas to anyone (not just those using pylab), and makes the out-of-the-box behavior simpler and closer to what people do in the command-line (where they've learned to type ipython --pylab from countless tutorials).

Fernando Perez
Owner

In summary, +1 to the PR as it stands, and bonus points for a little blurb in the docs explaining config inheritance with a .. note:: box for the fact that history is per-profile. I don't think we need anything else here.

Min RK
Owner

The docs already mention that history is per-profile, and show config file inheritance, so I'll merge this as-is.

Min RK minrk merged commit d6447c1 into from December 12, 2011
Min RK minrk closed this December 12, 2011
Fernando Perez
Owner

Agreed, there's enough already in there. Thanks!

Brian E. Granger ellisonbg referenced this pull request from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Dec 12, 2011
Min RK fix pylab StartMenu item 6ac95f7
Min RK remove pylab profile beff82d
This page is out of date. Refresh to see the latest.
23  IPython/config/profile/pylab/ipython_config.py
... ...
@@ -1,23 +0,0 @@
1  
-c = get_config()
2  
-app = c.InteractiveShellApp
3  
-
4  
-# This can be used at any point in a config file to load a sub config
5  
-# and merge it into the current one.
6  
-load_subconfig('ipython_config.py', profile='default')
7  
-
8  
-lines = """
9  
-import matplotlib
10  
-%gui qt
11  
-matplotlib.use('qt4agg')
12  
-matplotlib.interactive(True)
13  
-from matplotlib import pyplot as plt
14  
-from matplotlib.pyplot import *
15  
-"""
16  
-
17  
-# You have to make sure that attributes that are containers already
18  
-# exist before using them.  Simple assigning a new list will override
19  
-# all previous values.
20  
-if hasattr(app, 'exec_lines'):
21  
-    app.exec_lines.append(lines)
22  
-else:
23  
-    app.exec_lines = [lines]
4  scripts/ipython_win_post_install.py
@@ -95,8 +95,8 @@ def install():
95 95
     # mkshortcut(python, 'IPython (command prompt mode)', link, cmd, workdir)
96 96
     
97 97
     link = pjoin(ip_start_menu, 'pylab.lnk')
98  
-    cmd = '"%s" profile=pylab --init' % ipybase
99  
-    mkshortcut(python, 'IPython (pylab profile)', link, cmd, workdir)
  98
+    cmd = '"%s" --pylab' % ipybase
  99
+    mkshortcut(python, 'IPython (pylab mode)', link, cmd, workdir)
100 100
         
101 101
     link = pjoin(ip_start_menu, 'ipcontroller.lnk')
102 102
     cmdbase = suffix(pjoin(scripts, 'ipcontroller'))
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.