Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove ipythonrc references from documentation #664

Merged
merged 4 commits into from

3 participants

@eteq

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"""
search.
-i/-c: make the pattern case insensitive/sensitive. If neither of
- these options is given, the default is read from your ipythonrc
- file. The option name which sets this value is
- 'wildcards_case_sensitive'. If this option is not specified in your
- ipythonrc file, IPython's internal default is to do a case sensitive
- search.
+ these options are given, the default is read from your configuration
+ file, with the option name 'wildcards_case_sensitive'. If this option
@takluyver Owner

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

@eteq
eteq added a note

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?

@takluyver Owner

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.

@eteq
eteq added a note

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
@takluyver takluyver commented on the diff
docs/source/interactive/tips.txt
@@ -127,5 +127,9 @@ the IPython user list.
.. Now I have a nice little directory with everything I ever type in,
organized by project and date.
+.. warning::
+
+ This example uses the outdated ipythonrc-style configuration files, which no
+ longer work as of IPython 0.11
@takluyver Owner

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.

@eteq
eteq added a note

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

@takluyver Owner

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.

@eteq
eteq added a note

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).

@takluyver Owner

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
@fperez
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::
System command aliases
----------------------
-The %alias magic function and the alias option in the ipythonrc
-configuration file allow you to define magic functions which are in fact
+The %alias magic functionallows you to define magic functions which are in fact
@takluyver Owner

"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):
docstring for how to change the editor hook.
You can also set the value of this editor via the command line option
- '-editor' or in your ipythonrc file. This is useful if you wish to use
- specifically for IPython an editor different from your typical default
- (and for Windows users who typically don't set environment variables).
+ '-editor' or via the 'editor' option in your configuration file.
@takluyver Owner

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"""
docstring for how to change the editor hook.
You can also set the value of this editor via the command line option
- '-editor' or in your ipythonrc file. This is useful if you wish to use
- specifically for IPython an editor different from your typical default
- (and for Windows users who typically don't set environment variables).
+ '-editor' or in your configuration file (via the
@takluyver Owner

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
@takluyver
Owner

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.

@eteq

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...

@takluyver
Owner

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.

@takluyver takluyver merged commit 00e96ae into from
@takluyver
Owner

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
Commits on Aug 2, 2011
  1. @eteq
  2. @eteq

    updated references to configuration file options to specify the class…

    eteq authored
    … as well as the option itself
Commits on Aug 16, 2011
  1. @eteq
  2. @eteq

    fix for removed '-editor' command line option and clarification of co…

    eteq authored
    …nfiguration file option for TerminalInteractiveShell.editor
This page is out of date. Refresh to see the latest.
View
2  IPython/core/hooks.py
@@ -13,7 +13,7 @@
If you wish to define a new hook and activate it, you need to put the
necessary code into a python file which can be either imported or execfile()'d
-from within your ipythonrc configuration.
+from within your profile's ipython_config.py configuration.
For example, suppose that you have a module called 'myiphooks' in your
PYTHONPATH, which contains the following definition:
View
22 IPython/core/magic.py
@@ -640,11 +640,10 @@ def magic_psearch(self, parameter_s=''):
search.
-i/-c: make the pattern case insensitive/sensitive. If neither of
- these options is given, the default is read from your ipythonrc
- file. The option name which sets this value is
- 'wildcards_case_sensitive'. If this option is not specified in your
- ipythonrc file, IPython's internal default is to do a case sensitive
- search.
+ these options are given, the default is read from your configuration
+ file, with the option ``InteractiveShell.wildcards_case_sensitive``.
+ If this option is not specified in your configuration file, IPython's
+ internal default is to do a case sensitive search.
-e/-s NAMESPACE: exclude/search a given namespace. The pattern you
specifiy can be searched in any of the following namespaces:
@@ -1230,8 +1229,8 @@ def magic_pdb(self, parameter_s=''):
interactive pdb debugger after the traceback printout. %pdb toggles
this feature on and off.
- The initial state of this feature is set in your ipythonrc
- configuration file (the variable is called 'pdb').
+ The initial state of this feature is set in your configuration
+ file (the option is ``InteractiveShell.pdb``).
If you want to just activate the debugger AFTER an exception has fired,
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=['','']):
vi under Linux/Unix and to notepad under Windows. See the end of this
docstring for how to change the editor hook.
- You can also set the value of this editor via the command line option
- '-editor' or in your ipythonrc file. This is useful if you wish to use
- specifically for IPython an editor different from your typical default
- (and for Windows users who typically don't set environment variables).
+ You can also set the value of this editor via the
+ ``TerminalInteractiveShell.editor`` option in your configuration file.
+ This is useful if you wish to use a different editor from your typical
+ default with IPython (and for Windows users who typically don't set
+ environment variables).
This command allows you to conveniently edit multi-line code right in
your IPython session.
View
2  IPython/core/usage.py
@@ -81,7 +81,7 @@
* Magic commands: type %magic for information on the magic subsystem.
-* System command aliases, via the %alias command or the ipythonrc config file.
+* System command aliases, via the %alias command or the configuration file(s).
* Dynamic object information:
View
7 IPython/lib/irunner.py
@@ -328,9 +328,10 @@ def __init__(self,program='python',args=None,out=sys.stdout,echo=True):
class SAGERunner(InteractiveRunner):
"""Interactive SAGE runner.
- WARNING: this runner only works if you manually configure your SAGE copy
- to use 'colors NoColor' in the ipythonrc config file, since currently the
- prompt matching regexp does not identify color sequences."""
+ WARNING: this runner only works if you manually adjust your SAGE
+ configuration so that the 'color' option in the configuration file is set to
+ 'NoColor', because currently the prompt matching regexp does not identify
+ color sequences."""
def __init__(self,program='sage',args=None,out=sys.stdout,echo=True):
"""New runner, optionally passing the sage command to use."""
View
8 IPython/testing/plugin/ipdoctest.py
@@ -3,10 +3,10 @@
Limitations:
- When generating examples for use as doctests, make sure that you have
- pretty-printing OFF. This can be done either by starting ipython with the
- flag '--nopprint', by setting pprint to 0 in your ipythonrc file, or by
- interactively disabling it with %Pprint. This is required so that IPython
- output matches that of normal Python, which is used by doctest for internal
+ pretty-printing OFF. This can be done either by setting the
+ ``PlainTextFormatter.pprint`` option in your configuration file to False, or
+ by interactively disabling it with %Pprint. This is required so that IPython
+ output matches that of normal Python, which is used by doctest for internal
execution.
- Do not rely on specific prompt numbers for results (such as using
View
11 IPython/zmq/zmqshell.py
@@ -236,15 +236,16 @@ def magic_edit(self,parameter_s='',last_call=['','']):
%edit [options] [args]
%edit runs IPython's editor hook. The default version of this hook is
- set to call the __IPYTHON__.rc.editor command. This is read from your
+ set to call the __IPYTHON__.rc.dditor command. This is read from your
environment variable $EDITOR. If this isn't found, it will default to
vi under Linux/Unix and to notepad under Windows. See the end of this
docstring for how to change the editor hook.
- You can also set the value of this editor via the command line option
- '-editor' or in your ipythonrc file. This is useful if you wish to use
- specifically for IPython an editor different from your typical default
- (and for Windows users who typically don't set environment variables).
+ You can also set the value of this editor via the
+ ``TerminalInteractiveShell.editor`` option in your configuration file.
+ This is useful if you wish to use a different editor from your typical
+ default with IPython (and for Windows users who typically don't set
+ environment variables).
This command allows you to conveniently edit multi-line code right in
your IPython session.
View
28 docs/source/interactive/reference.txt
@@ -19,10 +19,12 @@ file and ignore your configuration setup.
Please note that some of the configuration options are not available at
the command line, simply because they are not practical here. Look into
-your ipythonrc configuration file for details on those. This file is typically
-installed in the IPYTHON_DIR directory. For Linux
-users, this will be $HOME/.config/ipython, and for other users it will be
-$HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and
+your configuration files for details on those. There are separate configuration
+files for each profile, and the files look like "ipython_config.py" or
+"ipython_config_<frontendname>.py". Profile directories look like
+"profile_profilename" and are typically installed in the IPYTHON_DIR directory.
+For Linux users, this will be $HOME/.config/ipython, and for other users it
+will be $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and
Settings\\YourUserName in most instances.
@@ -46,9 +48,9 @@ follow in any order. All options can be abbreviated to their shortest
non-ambiguous form and are case-sensitive. One or two dashes can be
used. Some options have an alternate short form, indicated after a ``|``.
-Most options can also be set from your ipythonrc configuration file. See
-the provided example for more details on what the options do. Options
-given at the command line override the values set in the ipythonrc file.
+Most options can also be set from your configuration file. See the provided
+example for more details on what the options do. Options given at the command
+line override the values set in the configuration file.
All options with a [no] prepended can be specified in negated form
(--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
code and various other elements. However, because this information is
passed through a pager (like 'less') and many pagers get confused with
color codes, this option is off by default. You can test it and turn
- it on permanently in your ipythonrc file if it works for you. As a
+ it on permanently in your configuration file if it works for you. As a
reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
that in RedHat 7.2 doesn't.
@@ -569,7 +571,7 @@ syntax for this can be found in the readline documentation available
with your system or on the Internet. IPython doesn't read this file (if
it exists) directly, but it does support passing to readline valid
options via a simple interface. In brief, you can customize readline by
-setting the following options in your ipythonrc configuration file (note
+setting the following options in your configuration file (note
that these options can not be specified at the command line):
* **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):
This option is off by default so that new users see all
attributes of any objects they are dealing with.
-You will find the default values along with a corresponding detailed
-explanation in your ipythonrc file.
+You will find the default values in your configuration file.
Session logging and restoring
@@ -696,8 +697,7 @@ Even object attributes can be expanded::
System command aliases
----------------------
-The %alias magic function and the alias option in the ipythonrc
-configuration file allow you to define magic functions which are in fact
+The %alias magic function allows you to define magic functions which are in fact
system shell commands. These aliases can have parameters.
``%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
This system obviously can potentially put heavy memory demands on your
system, since it prevents Python's garbage collector from removing any
previously computed results. You can control how many results are kept
-in memory with the option (at the command line or in your ipythonrc
+in memory with the option (at the command line or in your configuration
file) cache_size. If you set it to 0, the whole system is completely
disabled and the prompts revert to the classic '>>>' of normal Python.
View
4 docs/source/interactive/tips.txt
@@ -127,5 +127,9 @@ the IPython user list.
.. Now I have a nice little directory with everything I ever type in,
organized by project and date.
+.. warning::
+
+ This example uses the outdated ipythonrc-style configuration files, which no
+ longer work as of IPython 0.11
@takluyver Owner

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.

@eteq
eteq added a note

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

@takluyver Owner

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.

@eteq
eteq added a note

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).

@takluyver Owner

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
Something went wrong with that request. Please try again.