diff --git a/docs/source/parallel/parallel_task_old.txt b/docs/source/attic/parallel_task_old.txt similarity index 100% rename from docs/source/parallel/parallel_task_old.txt rename to docs/source/attic/parallel_task_old.txt diff --git a/docs/source/conf.py b/docs/source/conf.py index 4b2c078..e759549 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # -# IPython documentation build configuration file, created by -# sphinx-quickstart on Thu May 8 16:45:02 2008. +# IPython documentation build configuration file. # NOTE: This file has been edited manually from the auto-generated one from # sphinx. Do NOT delete and re-generate. If any changes from sphinx are @@ -21,7 +20,11 @@ import sys, os # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -#sys.path.append(os.path.abspath('some/directory')) +sys.path.append(os.path.abspath('../sphinxext')) + +# Import support for ipython console session syntax highlighting (lives +# in the sphinxext directory defined above) +import ipython_console_highlighting # We load the ipython release info into a dict by explicit execution iprelease = {} @@ -32,7 +35,10 @@ execfile('../../IPython/Release.py',iprelease) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -#extensions = [] +extensions = ['sphinx.ext.autodoc', + 'inheritance_diagram', 'only_directives', 'plot_directive', + 'ipython_console_highlighting', + ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -67,7 +73,7 @@ today_fmt = '%B %d, %Y' # List of directories, relative to source directories, that shouldn't be searched # for source files. -#exclude_dirs = [] +exclude_dirs = ['attic'] # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True @@ -135,7 +141,7 @@ html_last_updated_fmt = '%b %d, %Y' #html_file_suffix = '' # Output file base name for HTML help builder. -htmlhelp_basename = 'IPythondoc' +htmlhelp_basename = 'ipythondoc' # Options for LaTeX output @@ -173,5 +179,8 @@ latex_documents = [ ('index', 'ipython.tex', 'IPython Documentation', #latex_use_modindex = True -# Cleanup: delete release info to avoid pickling errors from sphinx +# Cleanup +# ------- +# delete release info to avoid pickling errors from sphinx + del iprelease diff --git a/docs/source/config/customization.txt b/docs/source/config/customization.txt index 907ae3e..8211b4c 100644 --- a/docs/source/config/customization.txt +++ b/docs/source/config/customization.txt @@ -18,6 +18,8 @@ time. A hybrid approach of specifying a few options in ipythonrc and doing the more advanced configuration in ipy_user_conf.py is also possible. +.. _ipythonrc: + The ipythonrc approach ====================== @@ -36,11 +38,11 @@ fairly primitive). Note that these are not python files, and this is deliberate, because it allows us to do some things which would be quite tricky to implement if they were normal python files. -First, an rcfile can contain permanent default values for almost all -command line options (except things like -help or -Version). Sec -`command line options`_ contains a description of all command-line -options. However, values you explicitly specify at the command line -override the values defined in the rcfile. +First, an rcfile can contain permanent default values for almost all command +line options (except things like -help or -Version). :ref:`This section +` contains a description of all command-line +options. However, values you explicitly specify at the command line override +the values defined in the rcfile. Besides command line option values, the rcfile can specify values for certain extra special options which are not available at the command @@ -266,13 +268,13 @@ which look like this:: IPython profiles ================ -As we already mentioned, IPython supports the -profile command-line -option (see sec. `command line options`_). A profile is nothing more -than a particular configuration file like your basic ipythonrc one, -but with particular customizations for a specific purpose. When you -start IPython with 'ipython -profile ', it assumes that in your -IPYTHONDIR there is a file called ipythonrc- or -ipy_profile_.py, and loads it instead of the normal ipythonrc. +As we already mentioned, IPython supports the -profile command-line option (see +:ref:`here `). A profile is nothing more than a +particular configuration file like your basic ipythonrc one, but with +particular customizations for a specific purpose. When you start IPython with +'ipython -profile ', it assumes that in your IPYTHONDIR there is a file +called ipythonrc- or ipy_profile_.py, and loads it instead of the +normal ipythonrc. This system allows you to maintain multiple configurations which load modules, set options, define functions, etc. suitable for different diff --git a/docs/source/config/initial_config.txt b/docs/source/config/initial_config.txt index 0620f83..eec4dd0 100644 --- a/docs/source/config/initial_config.txt +++ b/docs/source/config/initial_config.txt @@ -11,28 +11,27 @@ in a directory named by default $HOME/.ipython. You can change this by defining the environment variable IPYTHONDIR, or at runtime with the command line option -ipythondir. -If all goes well, the first time you run IPython it should -automatically create a user copy of the config directory for you, -based on its builtin defaults. You can look at the files it creates to -learn more about configuring the system. The main file you will modify -to configure IPython's behavior is called ipythonrc (with a .ini -extension under Windows), included for reference in `ipythonrc`_ -section. This file is very commented and has many variables you can -change to suit your taste, you can find more details in -Sec. customization_. Here we discuss the basic things you will want to -make sure things are working properly from the beginning. +If all goes well, the first time you run IPython it should automatically create +a user copy of the config directory for you, based on its builtin defaults. You +can look at the files it creates to learn more about configuring the +system. The main file you will modify to configure IPython's behavior is called +ipythonrc (with a .ini extension under Windows), included for reference +:ref:`here `. This file is very commented and has many variables you +can change to suit your taste, you can find more details :ref:`here +`. Here we discuss the basic things you will want to make sure +things are working properly from the beginning. -.. _Accessing help: +.. _accessing_help: Access to the Python help system ================================ -This is true for Python in general (not just for IPython): you should -have an environment variable called PYTHONDOCS pointing to the directory -where your HTML Python documentation lives. In my system it's -/usr/share/doc/python-docs-2.3.4/html, check your local details or ask -your systems administrator. +This is true for Python in general (not just for IPython): you should have an +environment variable called PYTHONDOCS pointing to the directory where your +HTML Python documentation lives. In my system it's +:file:`/usr/share/doc/python-doc/html`, check your local details or ask your +systems administrator. This is the directory which holds the HTML version of the Python manuals. Unfortunately it seems that different Linux distributions @@ -40,8 +39,9 @@ package these files differently, so you may have to look around a bit. Below I show the contents of this directory on my system for reference:: [html]> ls - about.dat acks.html dist/ ext/ index.html lib/ modindex.html - stdabout.dat tut/ about.html api/ doc/ icons/ inst/ mac/ ref/ style.css + about.html dist/ icons/ lib/ python2.5.devhelp.gz whatsnew/ + acks.html doc/ index.html mac/ ref/ + api/ ext/ inst/ modindex.html tut/ You should really make sure this variable is correctly set so that Python's pydoc-based help system works. It is a powerful and convenient @@ -108,6 +108,8 @@ The following terminals seem to handle the color sequences fine: support under cygwin, please post to the IPython mailing list so this issue can be resolved for all users. +.. _pyreadline: https://code.launchpad.net/pyreadline + These have shown problems: * Windows command prompt in WinXP/2k logged into a Linux machine via @@ -157,13 +159,12 @@ $HOME/.ipython/ipythonrc and set the colors option to the desired value. Object details (types, docstrings, source code, etc.) ===================================================== -IPython has a set of special functions for studying the objects you -are working with, discussed in detail in Sec. `dynamic object -information`_. But this system relies on passing information which is -longer than your screen through a data pager, such as the common Unix -less and more programs. In order to be able to see this information in -color, your pager needs to be properly configured. I strongly -recommend using less instead of more, as it seems that more simply can +IPython has a set of special functions for studying the objects you are working +with, discussed in detail :ref:`here `. But this system +relies on passing information which is longer than your screen through a data +pager, such as the common Unix less and more programs. In order to be able to +see this information in color, your pager needs to be properly configured. I +strongly recommend using less instead of more, as it seems that more simply can not understand colored text correctly. In order to configure less as your default pager, do the following: diff --git a/docs/source/development/development.txt b/docs/source/development/development.txt index 36ebacb..7e2afd0 100644 --- a/docs/source/development/development.txt +++ b/docs/source/development/development.txt @@ -357,15 +357,19 @@ This section outlines the various scenarios that we need to test before we relea Installation scenarios under Linux and OS X ------------------------------------------- - 1. Install from tarball using `python setup.py install`. + 1. Install from tarball using ``python setup.py install``. a. With only readline+nose dependencies installed. - b. With all dependencies installed (readline, zope.interface, - Twisted, foolscap, Sphinx, nose, pyOpenSSL). + b. With all dependencies installed (readline, zope.interface, Twisted, + foolscap, Sphinx, nose, pyOpenSSL). + 2. Install using easy_install. + a. With only readline+nose dependencies installed. - i. Default dependencies: `easy_install ipython-0.9.beta3-py2.5.egg` - ii. Optional dependency sets: `easy_install -f ipython-0.9.beta3-py2.5.egg IPython[kernel,doc,test,security]` + i. Default dependencies: ``easy_install ipython-0.9.beta3-py2.5.egg`` + ii. Optional dependency sets: ``easy_install -f ipython-0.9.beta3-py2.5.egg IPython[kernel,doc,test,security]`` + b. With all dependencies already installed. + Installation scenarios under Win32 ---------------------------------- @@ -381,6 +385,7 @@ Tests to run for these scenarios 2. Start a controller and engines and try a few things by hand. a. Using ipcluster. b. Using ipcontroller/ipengine by hand. + 3. Run a few of the parallel examples. 4. Try the kernel with and without security with and without PyOpenSSL installed. diff --git a/docs/source/interactive/reference.txt b/docs/source/interactive/reference.txt index 72a1011..b3a873b 100644 --- a/docs/source/interactive/reference.txt +++ b/docs/source/interactive/reference.txt @@ -8,7 +8,7 @@ IPython reference .. contents:: -.. _Command line options: +.. _command_line_options: Command-line usage ================== @@ -288,12 +288,13 @@ All options with a [no] prepended can be specified in negated form recursive inclusions. -prompt_in1, pi1 - Specify the string used for input prompts. Note that if you - are using numbered prompts, the number is represented with a - '\#' in the string. Don't forget to quote strings with spaces - embedded in them. Default: 'In [\#]:'. Sec. Prompts_ - discusses in detail all the available escapes to customize - your prompts. + + Specify the string used for input prompts. Note that if you are using + numbered prompts, the number is represented with a '\#' in the + string. Don't forget to quote strings with spaces embedded in + them. Default: 'In [\#]:'. The :ref:`prompts section ` + discusses in detail all the available escapes to customize your + prompts. -prompt_in2, pi2 Similar to the previous option, but used for the continuation @@ -2077,13 +2078,14 @@ customizations. Access to the standard Python help ---------------------------------- -As of Python 2.1, a help system is available with access to object -docstrings and the Python manuals. Simply type 'help' (no quotes) to -access it. You can also type help(object) to obtain information about a -given object, and help('keyword') for information on a keyword. As noted -in sec. `accessing help`_, you need to properly configure -your environment variable PYTHONDOCS for this feature to work correctly. +As of Python 2.1, a help system is available with access to object docstrings +and the Python manuals. Simply type 'help' (no quotes) to access it. You can +also type help(object) to obtain information about a given object, and +help('keyword') for information on a keyword. As noted :ref:`here +`, you need to properly configure your environment variable +PYTHONDOCS for this feature to work correctly. +.. _dynamic_object_info: Dynamic object information -------------------------- @@ -2126,7 +2128,7 @@ are not really defined as separate identifiers. Try for example typing {}.get? or after doing import os, type os.path.abspath??. -.. _Readline: +.. _readline: Readline-based features ----------------------- @@ -2240,10 +2242,9 @@ explanation in your ipythonrc file. Session logging and restoring ----------------------------- -You can log all input from a session either by starting IPython with -the command line switches -log or -logfile (see sec. `command line -options`_) or by activating the logging at any moment with the magic -function %logstart. +You can log all input from a session either by starting IPython with the +command line switches -log or -logfile (see :ref:`here `) +or by activating the logging at any moment with the magic function %logstart. Log files can later be reloaded with the -logplay option and IPython will attempt to 'replay' the log by executing all the lines in it, thus @@ -2279,6 +2280,8 @@ resume logging to a file which had previously been started with %logstart. They will fail (with an explanation) if you try to use them before logging has been started. +.. _system_shell_access: + System shell access ------------------- @@ -2389,7 +2392,7 @@ These features are basically a terminal version of Ka-Ping Yee's cgitb module, now part of the standard Python library. -.. _Input caching: +.. _input_caching: Input caching system -------------------- @@ -2429,7 +2432,7 @@ sec. 6.2 <#sec:magic> for more details on the macro system. A history function %hist allows you to see any part of your input history by printing a range of the _i variables. -.. _Output caching: +.. _output_caching: Output caching system --------------------- @@ -3034,7 +3037,7 @@ which is being shared by the interactive IPython loop and your GUI thread, you should really handle it with thread locking and syncrhonization properties. The Python documentation discusses these. -.. _Interactive demos: +.. _interactive_demos: Interactive demos with IPython ============================== @@ -3143,21 +3146,17 @@ toolkits, including Tk, GTK and WXPython. It also provides a number of commands useful for scientific computing, all with a syntax compatible with that of the popular Matlab program. -IPython accepts the special option -pylab (Sec. `Command line -options`_). This configures it to support matplotlib, honoring the -settings in the .matplotlibrc file. IPython will detect the user's -choice of matplotlib GUI backend, and automatically select the proper -threading model to prevent blocking. It also sets matplotlib in -interactive mode and modifies %run slightly, so that any -matplotlib-based script can be executed using %run and the final -show() command does not block the interactive shell. - -The -pylab option must be given first in order for IPython to -configure its threading mode. However, you can still issue other -options afterwards. This allows you to have a matplotlib-based -environment customized with additional modules using the standard -IPython profile mechanism (Sec. Profiles_): ''ipython -pylab -p -myprofile'' will load the profile defined in ipythonrc-myprofile after -configuring matplotlib. - - +IPython accepts the special option -pylab (see :ref:`here +`). This configures it to support matplotlib, honoring +the settings in the .matplotlibrc file. IPython will detect the user's choice +of matplotlib GUI backend, and automatically select the proper threading model +to prevent blocking. It also sets matplotlib in interactive mode and modifies +%run slightly, so that any matplotlib-based script can be executed using %run +and the final show() command does not block the interactive shell. + +The -pylab option must be given first in order for IPython to configure its +threading mode. However, you can still issue other options afterwards. This +allows you to have a matplotlib-based environment customized with additional +modules using the standard IPython profile mechanism (see :ref:`here +`): ``ipython -pylab -p myprofile`` will load the profile defined in +ipythonrc-myprofile after configuring matplotlib. diff --git a/docs/source/interactive/tutorial.txt b/docs/source/interactive/tutorial.txt index 69f5b16..e7271d5 100644 --- a/docs/source/interactive/tutorial.txt +++ b/docs/source/interactive/tutorial.txt @@ -24,11 +24,11 @@ Tab completion -------------- TAB-completion, especially for attributes, is a convenient way to explore the -structure of any object you're dealing with. Simply type object_name. -and a list of the object's attributes will be printed (see readline_ for -more). Tab completion also works on file and directory names, which combined -with IPython's alias system allows you to do from within IPython many of the -things you normally would need the system shell for. +structure of any object you're dealing with. Simply type object_name. and +a list of the object's attributes will be printed (see :ref:`the readline +section ` for more). Tab completion also works on file and directory +names, which combined with IPython's alias system allows you to do from within +IPython many of the things you normally would need the system shell for. Explore your objects -------------------- @@ -39,18 +39,18 @@ constructor details for classes. The magic commands %pdoc, %pdef, %psource and %pfile will respectively print the docstring, function definition line, full source code and the complete file for any object (when they can be found). If automagic is on (it is by default), you don't need to type the '%' -explicitly. See sec. `dynamic object information`_ for more. +explicitly. See :ref:`this section ` for more. The `%run` magic command ------------------------ -The %run magic command allows you to run any python script and load all of -its data directly into the interactive namespace. Since the file is re-read -from disk each time, changes you make to it are reflected immediately (in -contrast to the behavior of import). I rarely use import for code I am -testing, relying on %run instead. See magic_ section for more on this and -other magic commands, or type the name of any magic command and ? to get -details on it. See also sec. dreload_ for a recursive reload command. %run +The %run magic command allows you to run any python script and load all of its +data directly into the interactive namespace. Since the file is re-read from +disk each time, changes you make to it are reflected immediately (in contrast +to the behavior of import). I rarely use import for code I am testing, relying +on %run instead. See :ref:`this section ` for more on this and other +magic commands, or type the name of any magic command and ? to get details on +it. See also :ref:`this section ` for a recursive reload command. %run also has special flags for timing the execution of your scripts (-t) and for executing them under the control of either Python's pdb debugger (-d) or profiler (-p). With all of these, %run can be used as the main tool for @@ -60,21 +60,21 @@ choice. Debug a Python script --------------------- -Use the Python debugger, pdb. The %pdb command allows you to toggle on and -off the automatic invocation of an IPython-enhanced pdb debugger (with -coloring, tab completion and more) at any uncaught exception. The advantage -of this is that pdb starts inside the function where the exception occurred, -with all data still available. You can print variables, see code, execute -statements and even walk up and down the call stack to track down the true -source of the problem (which often is many layers in the stack above where -the exception gets triggered). Running programs with %run and pdb active can -be an efficient to develop and debug code, in many cases eliminating the need -for print statements or external debugging tools. I often simply put a 1/0 in -a place where I want to take a look so that pdb gets called, quickly view -whatever variables I need to or test various pieces of code and then remove -the 1/0. Note also that '%run -d' activates pdb and automatically sets -initial breakpoints for you to step through your code, watch variables, etc. -See Sec. `Output caching`_ for details. +Use the Python debugger, pdb. The %pdb command allows you to toggle on and off +the automatic invocation of an IPython-enhanced pdb debugger (with coloring, +tab completion and more) at any uncaught exception. The advantage of this is +that pdb starts inside the function where the exception occurred, with all data +still available. You can print variables, see code, execute statements and even +walk up and down the call stack to track down the true source of the problem +(which often is many layers in the stack above where the exception gets +triggered). Running programs with %run and pdb active can be an efficient to +develop and debug code, in many cases eliminating the need for print statements +or external debugging tools. I often simply put a 1/0 in a place where I want +to take a look so that pdb gets called, quickly view whatever variables I need +to or test various pieces of code and then remove the 1/0. Note also that '%run +-d' activates pdb and automatically sets initial breakpoints for you to step +through your code, watch variables, etc. The :ref:`output caching section +` has more details. Use the output cache -------------------- @@ -84,7 +84,8 @@ and variables named _1, _2, etc. alias them. For example, the result of input line 4 is available either as Out[4] or as _4. Additionally, three variables named _, __ and ___ are always kept updated with the for the last three results. This allows you to recall any previous result and further use it for -new calculations. See Sec. `Output caching`_ for more. +new calculations. See :ref:`the output caching section ` for +more. Suppress output --------------- @@ -102,7 +103,7 @@ A similar system exists for caching input. All input is stored in a global list called In , so you can re-execute lines 22 through 28 plus line 34 by typing 'exec In[22:29]+In[34]' (using Python slicing notation). If you need to execute the same set of lines often, you can assign them to a macro with -the %macro function. See sec. `Input caching`_ for more. +the %macro function. See :ref:`here ` for more. Use your input history ---------------------- @@ -134,17 +135,18 @@ into Python variables. Use Python variables when calling the shell ------------------------------------------- -Expand python variables when calling the shell (either via '!' and '!!' or -via aliases) by prepending a $ in front of them. You can also expand complete -python expressions. See `System shell access`_ for more. +Expand python variables when calling the shell (either via '!' and '!!' or via +aliases) by prepending a $ in front of them. You can also expand complete +python expressions. See :ref:`our shell section ` for +more details. Use profiles ------------ Use profiles to maintain different configurations (modules to load, function definitions, option settings) for particular tasks. You can then have -customized versions of IPython for specific purposes. See sec. profiles_ for -more. +customized versions of IPython for specific purposes. :ref:`This section +` has more details. Embed IPython in your programs @@ -152,7 +154,7 @@ Embed IPython in your programs A few lines of code are enough to load a complete IPython inside your own programs, giving you the ability to work with your data interactively after -automatic processing has been completed. See sec. embedding_ for more. +automatic processing has been completed. See :ref:`here ` for more. Use the Python profiler ----------------------- @@ -166,8 +168,8 @@ Use IPython to present interactive demos ---------------------------------------- Use the IPython.demo.Demo class to load any Python script as an interactive -demo. With a minimal amount of simple markup, you can control the execution -of the script, stopping as needed. See sec. `interactive demos`_ for more. +demo. With a minimal amount of simple markup, you can control the execution of +the script, stopping as needed. See :ref:`here ` for more. Run doctests ------------