Skip to content
This repository

Remove ipythonrc references from documentation #664

Merged
merged 4 commits into from over 2 years ago

3 participants

Erik Tollerud Fernando Perez Thomas Kluyver
Erik Tollerud
eteq commented August 02, 2011

This pull request should remove all references to the old-style ipythonrc from the ipython documentation and docstrings (except where it is intentionally referring to an old version).

Note that I've left everything in quarantine and deathrow untouched, as well as docs/source/config/old.txt .

There was one reference to setting aliases in ipythonrc that I simply deleted, as the new ipython_config.py file does not seem to mention aliases. If there's some way of adding aliases that isn't in the default ipython_config.py, I can easily add that in.

IPython/core/magic.py
@@ -640,11 +640,10 @@ Currently the magic system has the following functions:\n"""
640 640
           search.
641 641
 
642 642
           -i/-c: make the pattern case insensitive/sensitive.  If neither of
643  
-          these options is given, the default is read from your ipythonrc
644  
-          file.  The option name which sets this value is
645  
-          'wildcards_case_sensitive'.  If this option is not specified in your
646  
-          ipythonrc file, IPython's internal default is to do a case sensitive
647  
-          search.
  643
+          these options are given, the default is read from your configuration
  644
+          file, with the option name 'wildcards_case_sensitive'. If this option
4
Thomas Kluyver Collaborator
takluyver added a note August 02, 2011

We should probably give the full option name, like InteractiveShell.wildcards_case_sensitive, assuming it still exists.

Erik Tollerud
eteq added a note August 02, 2011

I thought about that, but the problem is that it's different depending on which configuration file you're looking at - that is, in ipython_config.py it's TerminalInteractiveShell.wildcards_case_sensitive but in ipython_qtconsole_config.py it's ZMQInteractiveShell.wildcards_case_sensitive ... I could put both, but that seems a bit overly verbose. Alternatively, it could be (ShellClassName).wildcards_case_sensitive or something like that?

Thomas Kluyver Collaborator
takluyver added a note August 02, 2011

I think they're both inheriting it from InteractiveShell, so changing it for InteractiveShell should change it for each subclass. The question of configuring them separately can probably be left for the config section.

Erik Tollerud
eteq added a note August 02, 2011

The changes I just committed (eteq/ipython@25f147e) address this and adjust similar places to reference more precisely what class the option belongs to. Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Thomas Kluyver takluyver commented on the diff August 02, 2011
docs/source/interactive/tips.txt
@@ -127,5 +127,9 @@ the IPython user list.
127 127
 .. Now I have a nice little directory with everything I ever type in,
128 128
    organized by project and date.
129 129
 
  130
+.. warning::
  131
+   
  132
+   This example uses the outdated ipythonrc-style configuration files, which no
  133
+   longer work as of IPython 0.11
5
Thomas Kluyver Collaborator
takluyver added a note August 02, 2011

Don't worry, this section is already commented out (see http://ipython.org/ipython-doc/stable/interactive/tips.html ). But if you feel like updating it for the new system (look for exec_lines in the ipython_config file), please do.

Erik Tollerud
eteq added a note August 02, 2011

I've used exec_lines, but I don't actually understand what that example is doing or what configuration file it's referring to...

Thomas Kluyver Collaborator
takluyver added a note August 02, 2011

I think it's just dropping logs into a particular directory, with filenames including the date. Actually, looking at it, I'm not sure if it's still needed - now all your history for a given profile is recorded in a database, and each session has a timestamp.

Erik Tollerud
eteq added a note August 02, 2011

Ah, so it is - there might be something similar to be done to be able to tie entries in the database to a particular project of some sort, but that would be executed totally differently than what is shown here.

I could send up a commit that gets rid of it completely as part of this pull request if desired (although it's easy enough to have a committer like yourself do it directly).

Thomas Kluyver Collaborator
takluyver added a note August 02, 2011

You get a separate history database per profile, so all you'd need is a profile for the project. It's not quite as neat as having logs in your folder, but that's a matter for another day.

I think it can go for now. If we want to update it, it feels like more of a cookbook thing than part of the main documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Fernando Perez
Owner

@takluyver, I'll leave this one to you since you've already started working on it. Is it ready to merge? I'm just trying to flush the queue a little before euroscipy...

docs/source/interactive/reference.txt
@@ -696,8 +697,7 @@ Even object attributes can be expanded::
696 697
 System command aliases
697 698
 ----------------------
698 699
 
699  
-The %alias magic function and the alias option in the ipythonrc
700  
-configuration file allow you to define magic functions which are in fact
  700
+The %alias magic functionallows you to define magic functions which are in fact
1
Thomas Kluyver Collaborator
takluyver added a note August 16, 2011

"functionallows" --> "function allows"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
IPython/zmq/zmqshell.py
@@ -242,9 +242,10 @@ class ZMQInteractiveShell(InteractiveShell):
242 242
         docstring for how to change the editor hook.
243 243
 
244 244
         You can also set the value of this editor via the command line option
245  
-        '-editor' or in your ipythonrc file. This is useful if you wish to use
246  
-        specifically for IPython an editor different from your typical default
247  
-        (and for Windows users who typically don't set environment variables).
  245
+        '-editor' or via the 'editor' option in your configuration file. 
1
Thomas Kluyver Collaborator
takluyver added a note August 16, 2011

These names are out of date. Looking at the config file, it's c.TerminalInteractiveShell.editor. And it doesn't look like it has a short alias at the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
IPython/core/magic.py
@@ -2270,9 +2269,11 @@ Currently the magic system has the following functions:\n"""
2270 2269
         docstring for how to change the editor hook.
2271 2270
 
2272 2271
         You can also set the value of this editor via the command line option
2273  
-        '-editor' or in your ipythonrc file. This is useful if you wish to use
2274  
-        specifically for IPython an editor different from your typical default
2275  
-        (and for Windows users who typically don't set environment variables).
  2272
+        '-editor' or in your configuration file (via the 
1
Thomas Kluyver Collaborator
takluyver added a note August 16, 2011

I don't think this command line option will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Thomas Kluyver
Collaborator

Just spotted a few more things. Also, I think we can lose the last section of docs/source/interactive/tips.txt (which is already commented out). If someone wants to update it, I think it's a better fit for the cookbook.

Erik Tollerud
eteq commented August 16, 2011

All 3 items should now be fixed.

One other thing that seems odd (although probably not for this pull request): despite the editor magic being present in ZMQInteractiveShell, there seems to be no editor variable associated with ZMQInteractiveShell (it's defined in TerminalInteractiveShell rather than InteractiveShell). I'm not sure if this is a problem as I haven't looked at the edit magic internals, but it seems a bit strange...

Thomas Kluyver
Collaborator

That's deliberate. The editor option is intended to be a terminal editor like vi or nano. It works a bit differently with ZMQ - it just sends the code to the frontend for editing. For the Qt console, there's an IPythonWidget.editor option to invoke a GUI editor.

Thomas Kluyver takluyver merged commit 00e96ae into from September 03, 2011
Thomas Kluyver takluyver closed this September 03, 2011
Thomas Kluyver
Collaborator

Thanks, @eteq - I've merged this in now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  IPython/core/hooks.py
@@ -13,7 +13,7 @@
13 13
 
14 14
 If you wish to define a new hook and activate it, you need to put the
15 15
 necessary code into a python file which can be either imported or execfile()'d
16  
-from within your ipythonrc configuration.
  16
+from within your profile's ipython_config.py configuration.
17 17
 
18 18
 For example, suppose that you have a module called 'myiphooks' in your
19 19
 PYTHONPATH, which contains the following definition:
22  IPython/core/magic.py
@@ -640,11 +640,10 @@ def magic_psearch(self, parameter_s=''):
640 640
           search.
641 641
 
642 642
           -i/-c: make the pattern case insensitive/sensitive.  If neither of
643  
-          these options is given, the default is read from your ipythonrc
644  
-          file.  The option name which sets this value is
645  
-          'wildcards_case_sensitive'.  If this option is not specified in your
646  
-          ipythonrc file, IPython's internal default is to do a case sensitive
647  
-          search.
  643
+          these options are given, the default is read from your configuration
  644
+          file, with the option ``InteractiveShell.wildcards_case_sensitive``. 
  645
+          If this option is not specified in your configuration file, IPython's 
  646
+          internal default is to do a case sensitive search.
648 647
 
649 648
           -e/-s NAMESPACE: exclude/search a given namespace.  The pattern you
650 649
           specifiy can be searched in any of the following namespaces:
@@ -1230,8 +1229,8 @@ def magic_pdb(self, parameter_s=''):
1230 1229
         interactive pdb debugger after the traceback printout. %pdb toggles
1231 1230
         this feature on and off.
1232 1231
 
1233  
-        The initial state of this feature is set in your ipythonrc
1234  
-        configuration file (the variable is called 'pdb').
  1232
+        The initial state of this feature is set in your configuration
  1233
+        file (the option is ``InteractiveShell.pdb``).
1235 1234
 
1236 1235
         If you want to just activate the debugger AFTER an exception has fired,
1237 1236
         without having to type '%pdb on' and rerunning your code, you can use
@@ -2269,10 +2268,11 @@ def magic_edit(self,parameter_s='',last_call=['','']):
2269 2268
         vi under Linux/Unix and to notepad under Windows.  See the end of this
2270 2269
         docstring for how to change the editor hook.
2271 2270
 
2272  
-        You can also set the value of this editor via the command line option
2273  
-        '-editor' or in your ipythonrc file. This is useful if you wish to use
2274  
-        specifically for IPython an editor different from your typical default
2275  
-        (and for Windows users who typically don't set environment variables).
  2271
+        You can also set the value of this editor via the 
  2272
+        ``TerminalInteractiveShell.editor`` option in your configuration file. 
  2273
+        This is useful if you wish to use a different editor from your typical 
  2274
+        default with IPython (and for Windows users who typically don't set 
  2275
+        environment variables).
2276 2276
 
2277 2277
         This command allows you to conveniently edit multi-line code right in
2278 2278
         your IPython session.
2  IPython/core/usage.py
@@ -81,7 +81,7 @@
81 81
 
82 82
 * Magic commands: type %magic for information on the magic subsystem.
83 83
 
84  
-* System command aliases, via the %alias command or the ipythonrc config file.
  84
+* System command aliases, via the %alias command or the configuration file(s).
85 85
 
86 86
 * Dynamic object information:
87 87
 
7  IPython/lib/irunner.py
@@ -328,9 +328,10 @@ def __init__(self,program='python',args=None,out=sys.stdout,echo=True):
328 328
 class SAGERunner(InteractiveRunner):
329 329
     """Interactive SAGE runner.
330 330
     
331  
-    WARNING: this runner only works if you manually configure your SAGE copy
332  
-    to use 'colors NoColor' in the ipythonrc config file, since currently the
333  
-    prompt matching regexp does not identify color sequences."""
  331
+    WARNING: this runner only works if you manually adjust your SAGE 
  332
+    configuration so that the 'color' option in the configuration file is set to
  333
+    'NoColor', because currently the prompt matching regexp does not identify 
  334
+    color sequences."""
334 335
 
335 336
     def __init__(self,program='sage',args=None,out=sys.stdout,echo=True):
336 337
         """New runner, optionally passing the sage command to use."""
8  IPython/testing/plugin/ipdoctest.py
@@ -3,10 +3,10 @@
3 3
 Limitations:
4 4
 
5 5
 - When generating examples for use as doctests, make sure that you have
6  
-  pretty-printing OFF.  This can be done either by starting ipython with the
7  
-  flag '--nopprint', by setting pprint to 0 in your ipythonrc file, or by
8  
-  interactively disabling it with %Pprint.  This is required so that IPython
9  
-  output matches that of normal Python, which is used by doctest for internal
  6
+  pretty-printing OFF.  This can be done either by setting the 
  7
+  ``PlainTextFormatter.pprint`` option in your configuration file to  False, or 
  8
+  by interactively disabling it with  %Pprint.  This is required so that IPython
  9
+  output matches that of normal Python, which is used by doctest for internal 
10 10
   execution.
11 11
 
12 12
 - Do not rely on specific prompt numbers for results (such as using
11  IPython/zmq/zmqshell.py
@@ -236,15 +236,16 @@ def magic_edit(self,parameter_s='',last_call=['','']):
236 236
           %edit [options] [args]
237 237
 
238 238
         %edit runs IPython's editor hook.  The default version of this hook is
239  
-        set to call the __IPYTHON__.rc.editor command.  This is read from your
  239
+        set to call the __IPYTHON__.rc.dditor command.  This is read from your
240 240
         environment variable $EDITOR.  If this isn't found, it will default to
241 241
         vi under Linux/Unix and to notepad under Windows.  See the end of this
242 242
         docstring for how to change the editor hook.
243 243
 
244  
-        You can also set the value of this editor via the command line option
245  
-        '-editor' or in your ipythonrc file. This is useful if you wish to use
246  
-        specifically for IPython an editor different from your typical default
247  
-        (and for Windows users who typically don't set environment variables).
  244
+        You can also set the value of this editor via the 
  245
+        ``TerminalInteractiveShell.editor`` option in your configuration file. 
  246
+        This is useful if you wish to use a different editor from your typical 
  247
+        default with IPython (and for Windows users who typically don't set 
  248
+        environment variables).
248 249
 
249 250
         This command allows you to conveniently edit multi-line code right in
250 251
         your IPython session.
28  docs/source/interactive/reference.txt
@@ -19,10 +19,12 @@ file and ignore your configuration setup.
19 19
 
20 20
 Please note that some of the configuration options are not available at
21 21
 the command line, simply because they are not practical here. Look into
22  
-your ipythonrc configuration file for details on those. This file is typically 
23  
-installed in the IPYTHON_DIR directory. For Linux
24  
-users, this will be $HOME/.config/ipython, and for other users it will be
25  
-$HOME/.ipython.  For Windows users, $HOME resolves to C:\\Documents and
  22
+your configuration files for details on those. There are separate configuration 
  23
+files for each profile, and the files look like "ipython_config.py" or 
  24
+"ipython_config_<frontendname>.py".  Profile directories look like 
  25
+"profile_profilename" and are typically installed in the IPYTHON_DIR directory. 
  26
+For Linux users, this will be $HOME/.config/ipython, and for other users it 
  27
+will be $HOME/.ipython.  For Windows users, $HOME resolves to C:\\Documents and
26 28
 Settings\\YourUserName in most instances.
27 29
 
28 30
 
@@ -46,9 +48,9 @@ follow in any order. All options can be abbreviated to their shortest
46 48
 non-ambiguous form and are case-sensitive. One or two dashes can be
47 49
 used. Some options have an alternate short form, indicated after a ``|``.
48 50
 
49  
-Most options can also be set from your ipythonrc configuration file. See
50  
-the provided example for more details on what the options do. Options
51  
-given at the command line override the values set in the ipythonrc file.
  51
+Most options can also be set from your configuration file. See the provided
  52
+example for more details on what the options do. Options given at the command
  53
+line override the values set in the configuration file.
52 54
 
53 55
 All options with a [no] prepended can be specified in negated form
54 56
 (--no-option instead of --option) to turn the feature off.
@@ -110,7 +112,7 @@ All options with a [no] prepended can be specified in negated form
110 112
 	code and various other elements.  However, because this information is
111 113
 	passed through a pager (like 'less') and many pagers get confused with
112 114
 	color codes, this option is off by default. You can test it and turn
113  
-	it on permanently in your ipythonrc file if it works for you. As a
  115
+	it on permanently in your configuration file if it works for you. As a
114 116
 	reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
115 117
 	that in RedHat 7.2 doesn't.
116 118
 
@@ -569,7 +571,7 @@ syntax for this can be found in the readline documentation available
569 571
 with your system or on the Internet. IPython doesn't read this file (if
570 572
 it exists) directly, but it does support passing to readline valid
571 573
 options via a simple interface. In brief, you can customize readline by
572  
-setting the following options in your ipythonrc configuration file (note
  574
+setting the following options in your configuration file (note
573 575
 that these options can not be specified at the command line):
574 576
 
575 577
     * **readline_parse_and_bind**: this option can appear as many times as
@@ -594,8 +596,7 @@ that these options can not be specified at the command line):
594 596
       This option is off by default so that new users see all
595 597
       attributes of any objects they are dealing with.
596 598
 
597  
-You will find the default values along with a corresponding detailed
598  
-explanation in your ipythonrc file.
  599
+You will find the default values in your configuration file.
599 600
 
600 601
 
601 602
 Session logging and restoring
@@ -696,8 +697,7 @@ Even object attributes can be expanded::
696 697
 System command aliases
697 698
 ----------------------
698 699
 
699  
-The %alias magic function and the alias option in the ipythonrc
700  
-configuration file allow you to define magic functions which are in fact
  700
+The %alias magic function allows you to define magic functions which are in fact
701 701
 system shell commands. These aliases can have parameters.
702 702
 
703 703
 ``%alias alias_name cmd`` defines 'alias_name' as an alias for 'cmd'
@@ -828,7 +828,7 @@ accidentally overwrite the Out variable you can recover it by typing
828 828
 This system obviously can potentially put heavy memory demands on your
829 829
 system, since it prevents Python's garbage collector from removing any
830 830
 previously computed results. You can control how many results are kept
831  
-in memory with the option (at the command line or in your ipythonrc
  831
+in memory with the option (at the command line or in your configuration
832 832
 file) cache_size. If you set it to 0, the whole system is completely
833 833
 disabled and the prompts revert to the classic '>>>' of normal Python.
834 834
 
4  docs/source/interactive/tips.txt
@@ -127,5 +127,9 @@ the IPython user list.
127 127
 .. Now I have a nice little directory with everything I ever type in,
128 128
    organized by project and date.
129 129
 
  130
+.. warning::
  131
+   
  132
+   This example uses the outdated ipythonrc-style configuration files, which no
  133
+   longer work as of IPython 0.11
130 134
 
131 135
 
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.