Show More
@@ -1,149 +1,151 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """Release data for the IPython project.""" |
|
2 | """Release data for the IPython project.""" | |
3 |
|
3 | |||
4 | #----------------------------------------------------------------------------- |
|
4 | #----------------------------------------------------------------------------- | |
5 | # Copyright (c) 2008, IPython Development Team. |
|
5 | # Copyright (c) 2008, IPython Development Team. | |
6 | # Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu> |
|
6 | # Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu> | |
7 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> |
|
7 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> | |
8 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> |
|
8 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> | |
9 | # |
|
9 | # | |
10 | # Distributed under the terms of the Modified BSD License. |
|
10 | # Distributed under the terms of the Modified BSD License. | |
11 | # |
|
11 | # | |
12 | # The full license is in the file COPYING.txt, distributed with this software. |
|
12 | # The full license is in the file COPYING.txt, distributed with this software. | |
13 | #----------------------------------------------------------------------------- |
|
13 | #----------------------------------------------------------------------------- | |
14 |
|
14 | |||
15 | # Name of the package for release purposes. This is the name which labels |
|
15 | # Name of the package for release purposes. This is the name which labels | |
16 | # the tarballs and RPMs made by distutils, so it's best to lowercase it. |
|
16 | # the tarballs and RPMs made by distutils, so it's best to lowercase it. | |
17 | name = 'ipython' |
|
17 | name = 'ipython' | |
18 |
|
18 | |||
19 | # IPython version information. An empty _version_extra corresponds to a full |
|
19 | # IPython version information. An empty _version_extra corresponds to a full | |
20 | # release. 'dev' as a _version_extra string means this is a development |
|
20 | # release. 'dev' as a _version_extra string means this is a development | |
21 | # version |
|
21 | # version | |
22 | _version_major = 1 |
|
22 | _version_major = 1 | |
23 | _version_minor = 0 |
|
23 | _version_minor = 0 | |
24 | _version_patch = 0 |
|
24 | _version_patch = 0 | |
25 | _version_extra = 'dev' |
|
25 | _version_extra = 'dev' | |
26 | #_version_extra = 'rc1' |
|
26 | #_version_extra = 'rc1' | |
27 | # _version_extra = '' # Uncomment this for full releases |
|
27 | # _version_extra = '' # Uncomment this for full releases | |
28 |
|
28 | |||
|
29 | codename = 'An Afternoon Hack' | |||
|
30 | ||||
29 | # Construct full version string from these. |
|
31 | # Construct full version string from these. | |
30 | _ver = [_version_major, _version_minor, _version_patch] |
|
32 | _ver = [_version_major, _version_minor, _version_patch] | |
31 |
|
33 | |||
32 | __version__ = '.'.join(map(str, _ver)) |
|
34 | __version__ = '.'.join(map(str, _ver)) | |
33 | if _version_extra: |
|
35 | if _version_extra: | |
34 | __version__ = __version__ + '-' + _version_extra |
|
36 | __version__ = __version__ + '-' + _version_extra | |
35 |
|
37 | |||
36 | version = __version__ # backwards compatibility name |
|
38 | version = __version__ # backwards compatibility name | |
37 | version_info = (_version_major, _version_minor, _version_patch, _version_extra) |
|
39 | version_info = (_version_major, _version_minor, _version_patch, _version_extra) | |
38 |
|
40 | |||
39 | # Change this when incrementing the kernel protocol version |
|
41 | # Change this when incrementing the kernel protocol version | |
40 | kernel_protocol_version_info = (4, 0) |
|
42 | kernel_protocol_version_info = (4, 0) | |
41 |
|
43 | |||
42 | description = "IPython: Productive Interactive Computing" |
|
44 | description = "IPython: Productive Interactive Computing" | |
43 |
|
45 | |||
44 | long_description = \ |
|
46 | long_description = \ | |
45 | """ |
|
47 | """ | |
46 | IPython provides a rich toolkit to help you make the most out of using Python |
|
48 | IPython provides a rich toolkit to help you make the most out of using Python | |
47 | interactively. Its main components are: |
|
49 | interactively. Its main components are: | |
48 |
|
50 | |||
49 | * Powerful interactive Python shells (terminal- and Qt-based). |
|
51 | * Powerful interactive Python shells (terminal- and Qt-based). | |
50 | * A web-based interactive notebook environment with all shell features plus |
|
52 | * A web-based interactive notebook environment with all shell features plus | |
51 | support for embedded figures, animations and rich media. |
|
53 | support for embedded figures, animations and rich media. | |
52 | * Support for interactive data visualization and use of GUI toolkits. |
|
54 | * Support for interactive data visualization and use of GUI toolkits. | |
53 | * Flexible, embeddable interpreters to load into your own projects. |
|
55 | * Flexible, embeddable interpreters to load into your own projects. | |
54 | * A high-performance library for high level and interactive parallel computing |
|
56 | * A high-performance library for high level and interactive parallel computing | |
55 | that works in multicore systems, clusters, supercomputing and cloud scenarios. |
|
57 | that works in multicore systems, clusters, supercomputing and cloud scenarios. | |
56 |
|
58 | |||
57 | The enhanced interactive Python shells have the following main features: |
|
59 | The enhanced interactive Python shells have the following main features: | |
58 |
|
60 | |||
59 | * Comprehensive object introspection. |
|
61 | * Comprehensive object introspection. | |
60 |
|
62 | |||
61 | * Input history, persistent across sessions. |
|
63 | * Input history, persistent across sessions. | |
62 |
|
64 | |||
63 | * Caching of output results during a session with automatically generated |
|
65 | * Caching of output results during a session with automatically generated | |
64 | references. |
|
66 | references. | |
65 |
|
67 | |||
66 | * Extensible tab completion, with support by default for completion of python |
|
68 | * Extensible tab completion, with support by default for completion of python | |
67 | variables and keywords, filenames and function keywords. |
|
69 | variables and keywords, filenames and function keywords. | |
68 |
|
70 | |||
69 | * Extensible system of 'magic' commands for controlling the environment and |
|
71 | * Extensible system of 'magic' commands for controlling the environment and | |
70 | performing many tasks related either to IPython or the operating system. |
|
72 | performing many tasks related either to IPython or the operating system. | |
71 |
|
73 | |||
72 | * A rich configuration system with easy switching between different setups |
|
74 | * A rich configuration system with easy switching between different setups | |
73 | (simpler than changing $PYTHONSTARTUP environment variables every time). |
|
75 | (simpler than changing $PYTHONSTARTUP environment variables every time). | |
74 |
|
76 | |||
75 | * Session logging and reloading. |
|
77 | * Session logging and reloading. | |
76 |
|
78 | |||
77 | * Extensible syntax processing for special purpose situations. |
|
79 | * Extensible syntax processing for special purpose situations. | |
78 |
|
80 | |||
79 | * Access to the system shell with user-extensible alias system. |
|
81 | * Access to the system shell with user-extensible alias system. | |
80 |
|
82 | |||
81 | * Easily embeddable in other Python programs and GUIs. |
|
83 | * Easily embeddable in other Python programs and GUIs. | |
82 |
|
84 | |||
83 | * Integrated access to the pdb debugger and the Python profiler. |
|
85 | * Integrated access to the pdb debugger and the Python profiler. | |
84 |
|
86 | |||
85 | The parallel computing architecture has the following main features: |
|
87 | The parallel computing architecture has the following main features: | |
86 |
|
88 | |||
87 | * Quickly parallelize Python code from an interactive Python/IPython session. |
|
89 | * Quickly parallelize Python code from an interactive Python/IPython session. | |
88 |
|
90 | |||
89 | * A flexible and dynamic process model that be deployed on anything from |
|
91 | * A flexible and dynamic process model that be deployed on anything from | |
90 | multicore workstations to supercomputers. |
|
92 | multicore workstations to supercomputers. | |
91 |
|
93 | |||
92 | * An architecture that supports many different styles of parallelism, from |
|
94 | * An architecture that supports many different styles of parallelism, from | |
93 | message passing to task farming. |
|
95 | message passing to task farming. | |
94 |
|
96 | |||
95 | * Both blocking and fully asynchronous interfaces. |
|
97 | * Both blocking and fully asynchronous interfaces. | |
96 |
|
98 | |||
97 | * High level APIs that enable many things to be parallelized in a few lines |
|
99 | * High level APIs that enable many things to be parallelized in a few lines | |
98 | of code. |
|
100 | of code. | |
99 |
|
101 | |||
100 | * Share live parallel jobs with other users securely. |
|
102 | * Share live parallel jobs with other users securely. | |
101 |
|
103 | |||
102 | * Dynamically load balanced task farming system. |
|
104 | * Dynamically load balanced task farming system. | |
103 |
|
105 | |||
104 | * Robust error handling in parallel code. |
|
106 | * Robust error handling in parallel code. | |
105 |
|
107 | |||
106 | The latest development version is always available from IPython's `GitHub |
|
108 | The latest development version is always available from IPython's `GitHub | |
107 | site <http://github.com/ipython>`_. |
|
109 | site <http://github.com/ipython>`_. | |
108 | """ |
|
110 | """ | |
109 |
|
111 | |||
110 | license = 'BSD' |
|
112 | license = 'BSD' | |
111 |
|
113 | |||
112 | authors = {'Fernando' : ('Fernando Perez','fperez.net@gmail.com'), |
|
114 | authors = {'Fernando' : ('Fernando Perez','fperez.net@gmail.com'), | |
113 | 'Janko' : ('Janko Hauser','jhauser@zscout.de'), |
|
115 | 'Janko' : ('Janko Hauser','jhauser@zscout.de'), | |
114 | 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'), |
|
116 | 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'), | |
115 | 'Ville' : ('Ville Vainio','vivainio@gmail.com'), |
|
117 | 'Ville' : ('Ville Vainio','vivainio@gmail.com'), | |
116 | 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'), |
|
118 | 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'), | |
117 | 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com'), |
|
119 | 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com'), | |
118 | 'Thomas' : ('Thomas A. Kluyver', 'takowl@gmail.com'), |
|
120 | 'Thomas' : ('Thomas A. Kluyver', 'takowl@gmail.com'), | |
119 | 'Jorgen' : ('Jorgen Stenarson', 'jorgen.stenarson@bostream.nu'), |
|
121 | 'Jorgen' : ('Jorgen Stenarson', 'jorgen.stenarson@bostream.nu'), | |
120 | 'Matthias' : ('Matthias Bussonnier', 'bussonniermatthias@gmail.com'), |
|
122 | 'Matthias' : ('Matthias Bussonnier', 'bussonniermatthias@gmail.com'), | |
121 | } |
|
123 | } | |
122 |
|
124 | |||
123 | author = 'The IPython Development Team' |
|
125 | author = 'The IPython Development Team' | |
124 |
|
126 | |||
125 | author_email = 'ipython-dev@scipy.org' |
|
127 | author_email = 'ipython-dev@scipy.org' | |
126 |
|
128 | |||
127 | url = 'http://ipython.org' |
|
129 | url = 'http://ipython.org' | |
128 |
|
130 | |||
129 | download_url = 'https://github.com/ipython/ipython/downloads' |
|
131 | download_url = 'https://github.com/ipython/ipython/downloads' | |
130 |
|
132 | |||
131 | platforms = ['Linux','Mac OSX','Windows XP/Vista/7/8'] |
|
133 | platforms = ['Linux','Mac OSX','Windows XP/Vista/7/8'] | |
132 |
|
134 | |||
133 | keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed', |
|
135 | keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed', | |
134 | 'Web-based computing', 'Qt console', 'Embedding'] |
|
136 | 'Web-based computing', 'Qt console', 'Embedding'] | |
135 |
|
137 | |||
136 | classifiers = [ |
|
138 | classifiers = [ | |
137 | 'Intended Audience :: Developers', |
|
139 | 'Intended Audience :: Developers', | |
138 | 'Intended Audience :: Science/Research', |
|
140 | 'Intended Audience :: Science/Research', | |
139 | 'License :: OSI Approved :: BSD License', |
|
141 | 'License :: OSI Approved :: BSD License', | |
140 | 'Programming Language :: Python', |
|
142 | 'Programming Language :: Python', | |
141 | 'Programming Language :: Python :: 2', |
|
143 | 'Programming Language :: Python :: 2', | |
142 | 'Programming Language :: Python :: 2.6', |
|
144 | 'Programming Language :: Python :: 2.6', | |
143 | 'Programming Language :: Python :: 2.7', |
|
145 | 'Programming Language :: Python :: 2.7', | |
144 | 'Programming Language :: Python :: 3', |
|
146 | 'Programming Language :: Python :: 3', | |
145 | 'Programming Language :: Python :: 3.2', |
|
147 | 'Programming Language :: Python :: 3.2', | |
146 | 'Programming Language :: Python :: 3.3', |
|
148 | 'Programming Language :: Python :: 3.3', | |
147 | 'Topic :: System :: Distributed Computing', |
|
149 | 'Topic :: System :: Distributed Computing', | |
148 | 'Topic :: System :: Shells' |
|
150 | 'Topic :: System :: Shells' | |
149 | ] |
|
151 | ] |
@@ -1,569 +1,571 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """Usage information for the main IPython applications. |
|
2 | """Usage information for the main IPython applications. | |
3 | """ |
|
3 | """ | |
4 | #----------------------------------------------------------------------------- |
|
4 | #----------------------------------------------------------------------------- | |
5 | # Copyright (C) 2008-2011 The IPython Development Team |
|
5 | # Copyright (C) 2008-2011 The IPython Development Team | |
6 | # Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu> |
|
6 | # Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu> | |
7 | # |
|
7 | # | |
8 | # Distributed under the terms of the BSD License. The full license is in |
|
8 | # Distributed under the terms of the BSD License. The full license is in | |
9 | # the file COPYING, distributed as part of this software. |
|
9 | # the file COPYING, distributed as part of this software. | |
10 | #----------------------------------------------------------------------------- |
|
10 | #----------------------------------------------------------------------------- | |
11 |
|
11 | |||
12 | import sys |
|
12 | import sys | |
13 | from IPython.core import release |
|
13 | from IPython.core import release | |
14 |
|
14 | |||
15 | cl_usage = """\ |
|
15 | cl_usage = """\ | |
16 | ========= |
|
16 | ========= | |
17 | IPython |
|
17 | IPython | |
18 | ========= |
|
18 | ========= | |
19 |
|
19 | |||
20 | Tools for Interactive Computing in Python |
|
20 | Tools for Interactive Computing in Python | |
21 | ========================================= |
|
21 | ========================================= | |
22 |
|
22 | |||
23 | A Python shell with automatic history (input and output), dynamic object |
|
23 | A Python shell with automatic history (input and output), dynamic object | |
24 | introspection, easier configuration, command completion, access to the |
|
24 | introspection, easier configuration, command completion, access to the | |
25 | system shell and more. IPython can also be embedded in running programs. |
|
25 | system shell and more. IPython can also be embedded in running programs. | |
26 |
|
26 | |||
27 |
|
27 | |||
28 | Usage |
|
28 | Usage | |
29 |
|
29 | |||
30 | ipython [subcommand] [options] [-c cmd | -m mod | file] [--] [arg] ... |
|
30 | ipython [subcommand] [options] [-c cmd | -m mod | file] [--] [arg] ... | |
31 |
|
31 | |||
32 | If invoked with no options, it executes the file and exits, passing the |
|
32 | If invoked with no options, it executes the file and exits, passing the | |
33 | remaining arguments to the script, just as if you had specified the same |
|
33 | remaining arguments to the script, just as if you had specified the same | |
34 | command with python. You may need to specify `--` before args to be passed |
|
34 | command with python. You may need to specify `--` before args to be passed | |
35 | to the script, to prevent IPython from attempting to parse them. If you |
|
35 | to the script, to prevent IPython from attempting to parse them. If you | |
36 | specify the option `-i` before the filename, it will enter an interactive |
|
36 | specify the option `-i` before the filename, it will enter an interactive | |
37 | IPython session after running the script, rather than exiting. Files ending |
|
37 | IPython session after running the script, rather than exiting. Files ending | |
38 | in .py will be treated as normal Python, but files ending in .ipy can |
|
38 | in .py will be treated as normal Python, but files ending in .ipy can | |
39 | contain special IPython syntax (magic commands, shell expansions, etc.). |
|
39 | contain special IPython syntax (magic commands, shell expansions, etc.). | |
40 |
|
40 | |||
41 | Almost all configuration in IPython is available via the command-line. Do |
|
41 | Almost all configuration in IPython is available via the command-line. Do | |
42 | `ipython --help-all` to see all available options. For persistent |
|
42 | `ipython --help-all` to see all available options. For persistent | |
43 | configuration, look into your `ipython_config.py` configuration file for |
|
43 | configuration, look into your `ipython_config.py` configuration file for | |
44 | details. |
|
44 | details. | |
45 |
|
45 | |||
46 | This file is typically installed in the `IPYTHONDIR` directory, and there |
|
46 | This file is typically installed in the `IPYTHONDIR` directory, and there | |
47 | is a separate configuration directory for each profile. The default profile |
|
47 | is a separate configuration directory for each profile. The default profile | |
48 | directory will be located in $IPYTHONDIR/profile_default. For Linux users, |
|
48 | directory will be located in $IPYTHONDIR/profile_default. For Linux users, | |
49 | IPYTHONDIR defaults to `$HOME/.config/ipython`, and for other Unix systems |
|
49 | IPYTHONDIR defaults to `$HOME/.config/ipython`, and for other Unix systems | |
50 | to `$HOME/.ipython`. For Windows users, $HOME resolves to C:\\Documents |
|
50 | to `$HOME/.ipython`. For Windows users, $HOME resolves to C:\\Documents | |
51 | and Settings\\YourUserName in most instances. |
|
51 | and Settings\\YourUserName in most instances. | |
52 |
|
52 | |||
53 | To initialize a profile with the default configuration file, do:: |
|
53 | To initialize a profile with the default configuration file, do:: | |
54 |
|
54 | |||
55 | $> ipython profile create |
|
55 | $> ipython profile create | |
56 |
|
56 | |||
57 | and start editing `IPYTHONDIR/profile_default/ipython_config.py` |
|
57 | and start editing `IPYTHONDIR/profile_default/ipython_config.py` | |
58 |
|
58 | |||
59 | In IPython's documentation, we will refer to this directory as |
|
59 | In IPython's documentation, we will refer to this directory as | |
60 | `IPYTHONDIR`, you can change its default location by creating an |
|
60 | `IPYTHONDIR`, you can change its default location by creating an | |
61 | environment variable with this name and setting it to the desired path. |
|
61 | environment variable with this name and setting it to the desired path. | |
62 |
|
62 | |||
63 | For more information, see the manual available in HTML and PDF in your |
|
63 | For more information, see the manual available in HTML and PDF in your | |
64 | installation, or online at http://ipython.org/documentation.html. |
|
64 | installation, or online at http://ipython.org/documentation.html. | |
65 | """ |
|
65 | """ | |
66 |
|
66 | |||
67 | interactive_usage = """ |
|
67 | interactive_usage = """ | |
68 | IPython -- An enhanced Interactive Python |
|
68 | IPython -- An enhanced Interactive Python | |
69 | ========================================= |
|
69 | ========================================= | |
70 |
|
70 | |||
71 | IPython offers a combination of convenient shell features, special commands |
|
71 | IPython offers a combination of convenient shell features, special commands | |
72 | and a history mechanism for both input (command history) and output (results |
|
72 | and a history mechanism for both input (command history) and output (results | |
73 | caching, similar to Mathematica). It is intended to be a fully compatible |
|
73 | caching, similar to Mathematica). It is intended to be a fully compatible | |
74 | replacement for the standard Python interpreter, while offering vastly |
|
74 | replacement for the standard Python interpreter, while offering vastly | |
75 | improved functionality and flexibility. |
|
75 | improved functionality and flexibility. | |
76 |
|
76 | |||
77 | At your system command line, type 'ipython -h' to see the command line |
|
77 | At your system command line, type 'ipython -h' to see the command line | |
78 | options available. This document only describes interactive features. |
|
78 | options available. This document only describes interactive features. | |
79 |
|
79 | |||
80 | MAIN FEATURES |
|
80 | MAIN FEATURES | |
81 | ------------- |
|
81 | ------------- | |
82 |
|
82 | |||
83 | * Access to the standard Python help. As of Python 2.1, a help system is |
|
83 | * Access to the standard Python help. As of Python 2.1, a help system is | |
84 | available with access to object docstrings and the Python manuals. Simply |
|
84 | available with access to object docstrings and the Python manuals. Simply | |
85 | type 'help' (no quotes) to access it. |
|
85 | type 'help' (no quotes) to access it. | |
86 |
|
86 | |||
87 | * Magic commands: type %magic for information on the magic subsystem. |
|
87 | * Magic commands: type %magic for information on the magic subsystem. | |
88 |
|
88 | |||
89 | * System command aliases, via the %alias command or the configuration file(s). |
|
89 | * System command aliases, via the %alias command or the configuration file(s). | |
90 |
|
90 | |||
91 | * Dynamic object information: |
|
91 | * Dynamic object information: | |
92 |
|
92 | |||
93 | Typing ?word or word? prints detailed information about an object. If |
|
93 | Typing ?word or word? prints detailed information about an object. If | |
94 | certain strings in the object are too long (docstrings, code, etc.) they get |
|
94 | certain strings in the object are too long (docstrings, code, etc.) they get | |
95 | snipped in the center for brevity. |
|
95 | snipped in the center for brevity. | |
96 |
|
96 | |||
97 | Typing ??word or word?? gives access to the full information without |
|
97 | Typing ??word or word?? gives access to the full information without | |
98 | snipping long strings. Long strings are sent to the screen through the less |
|
98 | snipping long strings. Long strings are sent to the screen through the less | |
99 | pager if longer than the screen, printed otherwise. |
|
99 | pager if longer than the screen, printed otherwise. | |
100 |
|
100 | |||
101 | The ?/?? system gives access to the full source code for any object (if |
|
101 | The ?/?? system gives access to the full source code for any object (if | |
102 | available), shows function prototypes and other useful information. |
|
102 | available), shows function prototypes and other useful information. | |
103 |
|
103 | |||
104 | If you just want to see an object's docstring, type '%pdoc object' (without |
|
104 | If you just want to see an object's docstring, type '%pdoc object' (without | |
105 | quotes, and without % if you have automagic on). |
|
105 | quotes, and without % if you have automagic on). | |
106 |
|
106 | |||
107 | Both %pdoc and ?/?? give you access to documentation even on things which are |
|
107 | Both %pdoc and ?/?? give you access to documentation even on things which are | |
108 | not explicitely defined. Try for example typing {}.get? or after import os, |
|
108 | not explicitely defined. Try for example typing {}.get? or after import os, | |
109 | type os.path.abspath??. The magic functions %pdef, %source and %file operate |
|
109 | type os.path.abspath??. The magic functions %pdef, %source and %file operate | |
110 | similarly. |
|
110 | similarly. | |
111 |
|
111 | |||
112 | * Completion in the local namespace, by typing TAB at the prompt. |
|
112 | * Completion in the local namespace, by typing TAB at the prompt. | |
113 |
|
113 | |||
114 | At any time, hitting tab will complete any available python commands or |
|
114 | At any time, hitting tab will complete any available python commands or | |
115 | variable names, and show you a list of the possible completions if there's |
|
115 | variable names, and show you a list of the possible completions if there's | |
116 | no unambiguous one. It will also complete filenames in the current directory. |
|
116 | no unambiguous one. It will also complete filenames in the current directory. | |
117 |
|
117 | |||
118 | This feature requires the readline and rlcomplete modules, so it won't work |
|
118 | This feature requires the readline and rlcomplete modules, so it won't work | |
119 | if your Python lacks readline support (such as under Windows). |
|
119 | if your Python lacks readline support (such as under Windows). | |
120 |
|
120 | |||
121 | * Search previous command history in two ways (also requires readline): |
|
121 | * Search previous command history in two ways (also requires readline): | |
122 |
|
122 | |||
123 | - Start typing, and then use Ctrl-p (previous,up) and Ctrl-n (next,down) to |
|
123 | - Start typing, and then use Ctrl-p (previous,up) and Ctrl-n (next,down) to | |
124 | search through only the history items that match what you've typed so |
|
124 | search through only the history items that match what you've typed so | |
125 | far. If you use Ctrl-p/Ctrl-n at a blank prompt, they just behave like |
|
125 | far. If you use Ctrl-p/Ctrl-n at a blank prompt, they just behave like | |
126 | normal arrow keys. |
|
126 | normal arrow keys. | |
127 |
|
127 | |||
128 | - Hit Ctrl-r: opens a search prompt. Begin typing and the system searches |
|
128 | - Hit Ctrl-r: opens a search prompt. Begin typing and the system searches | |
129 | your history for lines that match what you've typed so far, completing as |
|
129 | your history for lines that match what you've typed so far, completing as | |
130 | much as it can. |
|
130 | much as it can. | |
131 |
|
131 | |||
132 | - %hist: search history by index (this does *not* require readline). |
|
132 | - %hist: search history by index (this does *not* require readline). | |
133 |
|
133 | |||
134 | * Persistent command history across sessions. |
|
134 | * Persistent command history across sessions. | |
135 |
|
135 | |||
136 | * Logging of input with the ability to save and restore a working session. |
|
136 | * Logging of input with the ability to save and restore a working session. | |
137 |
|
137 | |||
138 | * System escape with !. Typing !ls will run 'ls' in the current directory. |
|
138 | * System escape with !. Typing !ls will run 'ls' in the current directory. | |
139 |
|
139 | |||
140 | * The reload command does a 'deep' reload of a module: changes made to the |
|
140 | * The reload command does a 'deep' reload of a module: changes made to the | |
141 | module since you imported will actually be available without having to exit. |
|
141 | module since you imported will actually be available without having to exit. | |
142 |
|
142 | |||
143 | * Verbose and colored exception traceback printouts. See the magic xmode and |
|
143 | * Verbose and colored exception traceback printouts. See the magic xmode and | |
144 | xcolor functions for details (just type %magic). |
|
144 | xcolor functions for details (just type %magic). | |
145 |
|
145 | |||
146 | * Input caching system: |
|
146 | * Input caching system: | |
147 |
|
147 | |||
148 | IPython offers numbered prompts (In/Out) with input and output caching. All |
|
148 | IPython offers numbered prompts (In/Out) with input and output caching. All | |
149 | input is saved and can be retrieved as variables (besides the usual arrow |
|
149 | input is saved and can be retrieved as variables (besides the usual arrow | |
150 | key recall). |
|
150 | key recall). | |
151 |
|
151 | |||
152 | The following GLOBAL variables always exist (so don't overwrite them!): |
|
152 | The following GLOBAL variables always exist (so don't overwrite them!): | |
153 | _i: stores previous input. |
|
153 | _i: stores previous input. | |
154 | _ii: next previous. |
|
154 | _ii: next previous. | |
155 | _iii: next-next previous. |
|
155 | _iii: next-next previous. | |
156 | _ih : a list of all input _ih[n] is the input from line n. |
|
156 | _ih : a list of all input _ih[n] is the input from line n. | |
157 |
|
157 | |||
158 | Additionally, global variables named _i<n> are dynamically created (<n> |
|
158 | Additionally, global variables named _i<n> are dynamically created (<n> | |
159 | being the prompt counter), such that _i<n> == _ih[<n>] |
|
159 | being the prompt counter), such that _i<n> == _ih[<n>] | |
160 |
|
160 | |||
161 | For example, what you typed at prompt 14 is available as _i14 and _ih[14]. |
|
161 | For example, what you typed at prompt 14 is available as _i14 and _ih[14]. | |
162 |
|
162 | |||
163 | You can create macros which contain multiple input lines from this history, |
|
163 | You can create macros which contain multiple input lines from this history, | |
164 | for later re-execution, with the %macro function. |
|
164 | for later re-execution, with the %macro function. | |
165 |
|
165 | |||
166 | The history function %hist allows you to see any part of your input history |
|
166 | The history function %hist allows you to see any part of your input history | |
167 | by printing a range of the _i variables. Note that inputs which contain |
|
167 | by printing a range of the _i variables. Note that inputs which contain | |
168 | magic functions (%) appear in the history with a prepended comment. This is |
|
168 | magic functions (%) appear in the history with a prepended comment. This is | |
169 | because they aren't really valid Python code, so you can't exec them. |
|
169 | because they aren't really valid Python code, so you can't exec them. | |
170 |
|
170 | |||
171 | * Output caching system: |
|
171 | * Output caching system: | |
172 |
|
172 | |||
173 | For output that is returned from actions, a system similar to the input |
|
173 | For output that is returned from actions, a system similar to the input | |
174 | cache exists but using _ instead of _i. Only actions that produce a result |
|
174 | cache exists but using _ instead of _i. Only actions that produce a result | |
175 | (NOT assignments, for example) are cached. If you are familiar with |
|
175 | (NOT assignments, for example) are cached. If you are familiar with | |
176 | Mathematica, IPython's _ variables behave exactly like Mathematica's % |
|
176 | Mathematica, IPython's _ variables behave exactly like Mathematica's % | |
177 | variables. |
|
177 | variables. | |
178 |
|
178 | |||
179 | The following GLOBAL variables always exist (so don't overwrite them!): |
|
179 | The following GLOBAL variables always exist (so don't overwrite them!): | |
180 | _ (one underscore): previous output. |
|
180 | _ (one underscore): previous output. | |
181 | __ (two underscores): next previous. |
|
181 | __ (two underscores): next previous. | |
182 | ___ (three underscores): next-next previous. |
|
182 | ___ (three underscores): next-next previous. | |
183 |
|
183 | |||
184 | Global variables named _<n> are dynamically created (<n> being the prompt |
|
184 | Global variables named _<n> are dynamically created (<n> being the prompt | |
185 | counter), such that the result of output <n> is always available as _<n>. |
|
185 | counter), such that the result of output <n> is always available as _<n>. | |
186 |
|
186 | |||
187 | Finally, a global dictionary named _oh exists with entries for all lines |
|
187 | Finally, a global dictionary named _oh exists with entries for all lines | |
188 | which generated output. |
|
188 | which generated output. | |
189 |
|
189 | |||
190 | * Directory history: |
|
190 | * Directory history: | |
191 |
|
191 | |||
192 | Your history of visited directories is kept in the global list _dh, and the |
|
192 | Your history of visited directories is kept in the global list _dh, and the | |
193 | magic %cd command can be used to go to any entry in that list. |
|
193 | magic %cd command can be used to go to any entry in that list. | |
194 |
|
194 | |||
195 | * Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython) |
|
195 | * Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython) | |
196 |
|
196 | |||
197 | 1. Auto-parentheses |
|
197 | 1. Auto-parentheses | |
198 |
|
198 | |||
199 | Callable objects (i.e. functions, methods, etc) can be invoked like |
|
199 | Callable objects (i.e. functions, methods, etc) can be invoked like | |
200 | this (notice the commas between the arguments):: |
|
200 | this (notice the commas between the arguments):: | |
201 |
|
201 | |||
202 | In [1]: callable_ob arg1, arg2, arg3 |
|
202 | In [1]: callable_ob arg1, arg2, arg3 | |
203 |
|
203 | |||
204 | and the input will be translated to this:: |
|
204 | and the input will be translated to this:: | |
205 |
|
205 | |||
206 | callable_ob(arg1, arg2, arg3) |
|
206 | callable_ob(arg1, arg2, arg3) | |
207 |
|
207 | |||
208 | This feature is off by default (in rare cases it can produce |
|
208 | This feature is off by default (in rare cases it can produce | |
209 | undesirable side-effects), but you can activate it at the command-line |
|
209 | undesirable side-effects), but you can activate it at the command-line | |
210 | by starting IPython with `--autocall 1`, set it permanently in your |
|
210 | by starting IPython with `--autocall 1`, set it permanently in your | |
211 | configuration file, or turn on at runtime with `%autocall 1`. |
|
211 | configuration file, or turn on at runtime with `%autocall 1`. | |
212 |
|
212 | |||
213 | You can force auto-parentheses by using '/' as the first character |
|
213 | You can force auto-parentheses by using '/' as the first character | |
214 | of a line. For example:: |
|
214 | of a line. For example:: | |
215 |
|
215 | |||
216 | In [1]: /globals # becomes 'globals()' |
|
216 | In [1]: /globals # becomes 'globals()' | |
217 |
|
217 | |||
218 | Note that the '/' MUST be the first character on the line! This |
|
218 | Note that the '/' MUST be the first character on the line! This | |
219 | won't work:: |
|
219 | won't work:: | |
220 |
|
220 | |||
221 | In [2]: print /globals # syntax error |
|
221 | In [2]: print /globals # syntax error | |
222 |
|
222 | |||
223 | In most cases the automatic algorithm should work, so you should |
|
223 | In most cases the automatic algorithm should work, so you should | |
224 | rarely need to explicitly invoke /. One notable exception is if you |
|
224 | rarely need to explicitly invoke /. One notable exception is if you | |
225 | are trying to call a function with a list of tuples as arguments (the |
|
225 | are trying to call a function with a list of tuples as arguments (the | |
226 | parenthesis will confuse IPython):: |
|
226 | parenthesis will confuse IPython):: | |
227 |
|
227 | |||
228 | In [1]: zip (1,2,3),(4,5,6) # won't work |
|
228 | In [1]: zip (1,2,3),(4,5,6) # won't work | |
229 |
|
229 | |||
230 | but this will work:: |
|
230 | but this will work:: | |
231 |
|
231 | |||
232 | In [2]: /zip (1,2,3),(4,5,6) |
|
232 | In [2]: /zip (1,2,3),(4,5,6) | |
233 | ------> zip ((1,2,3),(4,5,6)) |
|
233 | ------> zip ((1,2,3),(4,5,6)) | |
234 | Out[2]= [(1, 4), (2, 5), (3, 6)] |
|
234 | Out[2]= [(1, 4), (2, 5), (3, 6)] | |
235 |
|
235 | |||
236 | IPython tells you that it has altered your command line by |
|
236 | IPython tells you that it has altered your command line by | |
237 | displaying the new command line preceded by -->. e.g.:: |
|
237 | displaying the new command line preceded by -->. e.g.:: | |
238 |
|
238 | |||
239 | In [18]: callable list |
|
239 | In [18]: callable list | |
240 | -------> callable (list) |
|
240 | -------> callable (list) | |
241 |
|
241 | |||
242 | 2. Auto-Quoting |
|
242 | 2. Auto-Quoting | |
243 |
|
243 | |||
244 | You can force auto-quoting of a function's arguments by using ',' as |
|
244 | You can force auto-quoting of a function's arguments by using ',' as | |
245 | the first character of a line. For example:: |
|
245 | the first character of a line. For example:: | |
246 |
|
246 | |||
247 | In [1]: ,my_function /home/me # becomes my_function("/home/me") |
|
247 | In [1]: ,my_function /home/me # becomes my_function("/home/me") | |
248 |
|
248 | |||
249 | If you use ';' instead, the whole argument is quoted as a single |
|
249 | If you use ';' instead, the whole argument is quoted as a single | |
250 | string (while ',' splits on whitespace):: |
|
250 | string (while ',' splits on whitespace):: | |
251 |
|
251 | |||
252 | In [2]: ,my_function a b c # becomes my_function("a","b","c") |
|
252 | In [2]: ,my_function a b c # becomes my_function("a","b","c") | |
253 | In [3]: ;my_function a b c # becomes my_function("a b c") |
|
253 | In [3]: ;my_function a b c # becomes my_function("a b c") | |
254 |
|
254 | |||
255 | Note that the ',' MUST be the first character on the line! This |
|
255 | Note that the ',' MUST be the first character on the line! This | |
256 | won't work:: |
|
256 | won't work:: | |
257 |
|
257 | |||
258 | In [4]: x = ,my_function /home/me # syntax error |
|
258 | In [4]: x = ,my_function /home/me # syntax error | |
259 | """ |
|
259 | """ | |
260 |
|
260 | |||
261 | interactive_usage_min = """\ |
|
261 | interactive_usage_min = """\ | |
262 | An enhanced console for Python. |
|
262 | An enhanced console for Python. | |
263 | Some of its features are: |
|
263 | Some of its features are: | |
264 | - Readline support if the readline library is present. |
|
264 | - Readline support if the readline library is present. | |
265 | - Tab completion in the local namespace. |
|
265 | - Tab completion in the local namespace. | |
266 | - Logging of input, see command-line options. |
|
266 | - Logging of input, see command-line options. | |
267 | - System shell escape via ! , eg !ls. |
|
267 | - System shell escape via ! , eg !ls. | |
268 | - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.) |
|
268 | - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.) | |
269 | - Keeps track of locally defined variables via %who, %whos. |
|
269 | - Keeps track of locally defined variables via %who, %whos. | |
270 | - Show object information with a ? eg ?x or x? (use ?? for more info). |
|
270 | - Show object information with a ? eg ?x or x? (use ?? for more info). | |
271 | """ |
|
271 | """ | |
272 |
|
272 | |||
273 | quick_reference = r""" |
|
273 | quick_reference = r""" | |
274 | IPython -- An enhanced Interactive Python - Quick Reference Card |
|
274 | IPython -- An enhanced Interactive Python - Quick Reference Card | |
275 | ================================================================ |
|
275 | ================================================================ | |
276 |
|
276 | |||
277 | obj?, obj?? : Get help, or more help for object (also works as |
|
277 | obj?, obj?? : Get help, or more help for object (also works as | |
278 | ?obj, ??obj). |
|
278 | ?obj, ??obj). | |
279 | ?foo.*abc* : List names in 'foo' containing 'abc' in them. |
|
279 | ?foo.*abc* : List names in 'foo' containing 'abc' in them. | |
280 | %magic : Information about IPython's 'magic' % functions. |
|
280 | %magic : Information about IPython's 'magic' % functions. | |
281 |
|
281 | |||
282 | Magic functions are prefixed by % or %%, and typically take their arguments |
|
282 | Magic functions are prefixed by % or %%, and typically take their arguments | |
283 | without parentheses, quotes or even commas for convenience. Line magics take a |
|
283 | without parentheses, quotes or even commas for convenience. Line magics take a | |
284 | single % and cell magics are prefixed with two %%. |
|
284 | single % and cell magics are prefixed with two %%. | |
285 |
|
285 | |||
286 | Example magic function calls: |
|
286 | Example magic function calls: | |
287 |
|
287 | |||
288 | %alias d ls -F : 'd' is now an alias for 'ls -F' |
|
288 | %alias d ls -F : 'd' is now an alias for 'ls -F' | |
289 | alias d ls -F : Works if 'alias' not a python name |
|
289 | alias d ls -F : Works if 'alias' not a python name | |
290 | alist = %alias : Get list of aliases to 'alist' |
|
290 | alist = %alias : Get list of aliases to 'alist' | |
291 | cd /usr/share : Obvious. cd -<tab> to choose from visited dirs. |
|
291 | cd /usr/share : Obvious. cd -<tab> to choose from visited dirs. | |
292 | %cd?? : See help AND source for magic %cd |
|
292 | %cd?? : See help AND source for magic %cd | |
293 | %timeit x=10 : time the 'x=10' statement with high precision. |
|
293 | %timeit x=10 : time the 'x=10' statement with high precision. | |
294 | %%timeit x=2**100 |
|
294 | %%timeit x=2**100 | |
295 | x**100 : time 'x*100' with a setup of 'x=2**100'; setup code is not |
|
295 | x**100 : time 'x*100' with a setup of 'x=2**100'; setup code is not | |
296 | counted. This is an example of a cell magic. |
|
296 | counted. This is an example of a cell magic. | |
297 |
|
297 | |||
298 | System commands: |
|
298 | System commands: | |
299 |
|
299 | |||
300 | !cp a.txt b/ : System command escape, calls os.system() |
|
300 | !cp a.txt b/ : System command escape, calls os.system() | |
301 | cp a.txt b/ : after %rehashx, most system commands work without ! |
|
301 | cp a.txt b/ : after %rehashx, most system commands work without ! | |
302 | cp ${f}.txt $bar : Variable expansion in magics and system commands |
|
302 | cp ${f}.txt $bar : Variable expansion in magics and system commands | |
303 | files = !ls /usr : Capture sytem command output |
|
303 | files = !ls /usr : Capture sytem command output | |
304 | files.s, files.l, files.n: "a b c", ['a','b','c'], 'a\nb\nc' |
|
304 | files.s, files.l, files.n: "a b c", ['a','b','c'], 'a\nb\nc' | |
305 |
|
305 | |||
306 | History: |
|
306 | History: | |
307 |
|
307 | |||
308 | _i, _ii, _iii : Previous, next previous, next next previous input |
|
308 | _i, _ii, _iii : Previous, next previous, next next previous input | |
309 | _i4, _ih[2:5] : Input history line 4, lines 2-4 |
|
309 | _i4, _ih[2:5] : Input history line 4, lines 2-4 | |
310 | exec _i81 : Execute input history line #81 again |
|
310 | exec _i81 : Execute input history line #81 again | |
311 | %rep 81 : Edit input history line #81 |
|
311 | %rep 81 : Edit input history line #81 | |
312 | _, __, ___ : previous, next previous, next next previous output |
|
312 | _, __, ___ : previous, next previous, next next previous output | |
313 | _dh : Directory history |
|
313 | _dh : Directory history | |
314 | _oh : Output history |
|
314 | _oh : Output history | |
315 | %hist : Command history. '%hist -g foo' search history for 'foo' |
|
315 | %hist : Command history. '%hist -g foo' search history for 'foo' | |
316 |
|
316 | |||
317 | Autocall: |
|
317 | Autocall: | |
318 |
|
318 | |||
319 | f 1,2 : f(1,2) # Off by default, enable with %autocall magic. |
|
319 | f 1,2 : f(1,2) # Off by default, enable with %autocall magic. | |
320 | /f 1,2 : f(1,2) (forced autoparen) |
|
320 | /f 1,2 : f(1,2) (forced autoparen) | |
321 | ,f 1 2 : f("1","2") |
|
321 | ,f 1 2 : f("1","2") | |
322 | ;f 1 2 : f("1 2") |
|
322 | ;f 1 2 : f("1 2") | |
323 |
|
323 | |||
324 | Remember: TAB completion works in many contexts, not just file names |
|
324 | Remember: TAB completion works in many contexts, not just file names | |
325 | or python names. |
|
325 | or python names. | |
326 |
|
326 | |||
327 | The following magic functions are currently available: |
|
327 | The following magic functions are currently available: | |
328 |
|
328 | |||
329 | """ |
|
329 | """ | |
330 |
|
330 | |||
331 | gui_reference = """\ |
|
331 | gui_reference = """\ | |
332 | =============================== |
|
332 | =============================== | |
333 | The graphical IPython console |
|
333 | The graphical IPython console | |
334 | =============================== |
|
334 | =============================== | |
335 |
|
335 | |||
336 | This console is designed to emulate the look, feel and workflow of a terminal |
|
336 | This console is designed to emulate the look, feel and workflow of a terminal | |
337 | environment, while adding a number of enhancements that are simply not possible |
|
337 | environment, while adding a number of enhancements that are simply not possible | |
338 | in a real terminal, such as inline syntax highlighting, true multiline editing, |
|
338 | in a real terminal, such as inline syntax highlighting, true multiline editing, | |
339 | inline graphics and much more. |
|
339 | inline graphics and much more. | |
340 |
|
340 | |||
341 | This quick reference document contains the basic information you'll need to |
|
341 | This quick reference document contains the basic information you'll need to | |
342 | know to make the most efficient use of it. For the various command line |
|
342 | know to make the most efficient use of it. For the various command line | |
343 | options available at startup, type ``ipython qtconsole --help`` at the command line. |
|
343 | options available at startup, type ``ipython qtconsole --help`` at the command line. | |
344 |
|
344 | |||
345 |
|
345 | |||
346 | Multiline editing |
|
346 | Multiline editing | |
347 | ================= |
|
347 | ================= | |
348 |
|
348 | |||
349 | The graphical console is capable of true multiline editing, but it also tries |
|
349 | The graphical console is capable of true multiline editing, but it also tries | |
350 | to behave intuitively like a terminal when possible. If you are used to |
|
350 | to behave intuitively like a terminal when possible. If you are used to | |
351 | IPython's old terminal behavior, you should find the transition painless, and |
|
351 | IPython's old terminal behavior, you should find the transition painless, and | |
352 | once you learn a few basic keybindings it will be a much more efficient |
|
352 | once you learn a few basic keybindings it will be a much more efficient | |
353 | environment. |
|
353 | environment. | |
354 |
|
354 | |||
355 | For single expressions or indented blocks, the console behaves almost like the |
|
355 | For single expressions or indented blocks, the console behaves almost like the | |
356 | terminal IPython: single expressions are immediately evaluated, and indented |
|
356 | terminal IPython: single expressions are immediately evaluated, and indented | |
357 | blocks are evaluated once a single blank line is entered:: |
|
357 | blocks are evaluated once a single blank line is entered:: | |
358 |
|
358 | |||
359 | In [1]: print "Hello IPython!" # Enter was pressed at the end of the line |
|
359 | In [1]: print "Hello IPython!" # Enter was pressed at the end of the line | |
360 | Hello IPython! |
|
360 | Hello IPython! | |
361 |
|
361 | |||
362 | In [2]: for i in range(10): |
|
362 | In [2]: for i in range(10): | |
363 | ...: print i, |
|
363 | ...: print i, | |
364 | ...: |
|
364 | ...: | |
365 | 0 1 2 3 4 5 6 7 8 9 |
|
365 | 0 1 2 3 4 5 6 7 8 9 | |
366 |
|
366 | |||
367 | If you want to enter more than one expression in a single input block |
|
367 | If you want to enter more than one expression in a single input block | |
368 | (something not possible in the terminal), you can use ``Control-Enter`` at the |
|
368 | (something not possible in the terminal), you can use ``Control-Enter`` at the | |
369 | end of your first line instead of ``Enter``. At that point the console goes |
|
369 | end of your first line instead of ``Enter``. At that point the console goes | |
370 | into 'cell mode' and even if your inputs are not indented, it will continue |
|
370 | into 'cell mode' and even if your inputs are not indented, it will continue | |
371 | accepting arbitrarily many lines until either you enter an extra blank line or |
|
371 | accepting arbitrarily many lines until either you enter an extra blank line or | |
372 | you hit ``Shift-Enter`` (the key binding that forces execution). When a |
|
372 | you hit ``Shift-Enter`` (the key binding that forces execution). When a | |
373 | multiline cell is entered, IPython analyzes it and executes its code producing |
|
373 | multiline cell is entered, IPython analyzes it and executes its code producing | |
374 | an ``Out[n]`` prompt only for the last expression in it, while the rest of the |
|
374 | an ``Out[n]`` prompt only for the last expression in it, while the rest of the | |
375 | cell is executed as if it was a script. An example should clarify this:: |
|
375 | cell is executed as if it was a script. An example should clarify this:: | |
376 |
|
376 | |||
377 | In [3]: x=1 # Hit C-Enter here |
|
377 | In [3]: x=1 # Hit C-Enter here | |
378 | ...: y=2 # from now on, regular Enter is sufficient |
|
378 | ...: y=2 # from now on, regular Enter is sufficient | |
379 | ...: z=3 |
|
379 | ...: z=3 | |
380 | ...: x**2 # This does *not* produce an Out[] value |
|
380 | ...: x**2 # This does *not* produce an Out[] value | |
381 | ...: x+y+z # Only the last expression does |
|
381 | ...: x+y+z # Only the last expression does | |
382 | ...: |
|
382 | ...: | |
383 | Out[3]: 6 |
|
383 | Out[3]: 6 | |
384 |
|
384 | |||
385 | The behavior where an extra blank line forces execution is only active if you |
|
385 | The behavior where an extra blank line forces execution is only active if you | |
386 | are actually typing at the keyboard each line, and is meant to make it mimic |
|
386 | are actually typing at the keyboard each line, and is meant to make it mimic | |
387 | the IPython terminal behavior. If you paste a long chunk of input (for example |
|
387 | the IPython terminal behavior. If you paste a long chunk of input (for example | |
388 | a long script copied form an editor or web browser), it can contain arbitrarily |
|
388 | a long script copied form an editor or web browser), it can contain arbitrarily | |
389 | many intermediate blank lines and they won't cause any problems. As always, |
|
389 | many intermediate blank lines and they won't cause any problems. As always, | |
390 | you can then make it execute by appending a blank line *at the end* or hitting |
|
390 | you can then make it execute by appending a blank line *at the end* or hitting | |
391 | ``Shift-Enter`` anywhere within the cell. |
|
391 | ``Shift-Enter`` anywhere within the cell. | |
392 |
|
392 | |||
393 | With the up arrow key, you can retrieve previous blocks of input that contain |
|
393 | With the up arrow key, you can retrieve previous blocks of input that contain | |
394 | multiple lines. You can move inside of a multiline cell like you would in any |
|
394 | multiple lines. You can move inside of a multiline cell like you would in any | |
395 | text editor. When you want it executed, the simplest thing to do is to hit the |
|
395 | text editor. When you want it executed, the simplest thing to do is to hit the | |
396 | force execution key, ``Shift-Enter`` (though you can also navigate to the end |
|
396 | force execution key, ``Shift-Enter`` (though you can also navigate to the end | |
397 | and append a blank line by using ``Enter`` twice). |
|
397 | and append a blank line by using ``Enter`` twice). | |
398 |
|
398 | |||
399 | If you've edited a multiline cell and accidentally navigate out of it with the |
|
399 | If you've edited a multiline cell and accidentally navigate out of it with the | |
400 | up or down arrow keys, IPython will clear the cell and replace it with the |
|
400 | up or down arrow keys, IPython will clear the cell and replace it with the | |
401 | contents of the one above or below that you navigated to. If this was an |
|
401 | contents of the one above or below that you navigated to. If this was an | |
402 | accident and you want to retrieve the cell you were editing, use the Undo |
|
402 | accident and you want to retrieve the cell you were editing, use the Undo | |
403 | keybinding, ``Control-z``. |
|
403 | keybinding, ``Control-z``. | |
404 |
|
404 | |||
405 |
|
405 | |||
406 | Key bindings |
|
406 | Key bindings | |
407 | ============ |
|
407 | ============ | |
408 |
|
408 | |||
409 | The IPython console supports most of the basic Emacs line-oriented keybindings, |
|
409 | The IPython console supports most of the basic Emacs line-oriented keybindings, | |
410 | in addition to some of its own. |
|
410 | in addition to some of its own. | |
411 |
|
411 | |||
412 | The keybinding prefixes mean: |
|
412 | The keybinding prefixes mean: | |
413 |
|
413 | |||
414 | - ``C``: Control |
|
414 | - ``C``: Control | |
415 | - ``S``: Shift |
|
415 | - ``S``: Shift | |
416 | - ``M``: Meta (typically the Alt key) |
|
416 | - ``M``: Meta (typically the Alt key) | |
417 |
|
417 | |||
418 | The keybindings themselves are: |
|
418 | The keybindings themselves are: | |
419 |
|
419 | |||
420 | - ``Enter``: insert new line (may cause execution, see above). |
|
420 | - ``Enter``: insert new line (may cause execution, see above). | |
421 | - ``C-Enter``: *force* new line, *never* causes execution. |
|
421 | - ``C-Enter``: *force* new line, *never* causes execution. | |
422 | - ``S-Enter``: *force* execution regardless of where cursor is, no newline added. |
|
422 | - ``S-Enter``: *force* execution regardless of where cursor is, no newline added. | |
423 | - ``Up``: step backwards through the history. |
|
423 | - ``Up``: step backwards through the history. | |
424 | - ``Down``: step forwards through the history. |
|
424 | - ``Down``: step forwards through the history. | |
425 | - ``S-Up``: search backwards through the history (like ``C-r`` in bash). |
|
425 | - ``S-Up``: search backwards through the history (like ``C-r`` in bash). | |
426 | - ``S-Down``: search forwards through the history. |
|
426 | - ``S-Down``: search forwards through the history. | |
427 | - ``C-c``: copy highlighted text to clipboard (prompts are automatically stripped). |
|
427 | - ``C-c``: copy highlighted text to clipboard (prompts are automatically stripped). | |
428 | - ``C-S-c``: copy highlighted text to clipboard (prompts are not stripped). |
|
428 | - ``C-S-c``: copy highlighted text to clipboard (prompts are not stripped). | |
429 | - ``C-v``: paste text from clipboard. |
|
429 | - ``C-v``: paste text from clipboard. | |
430 | - ``C-z``: undo (retrieves lost text if you move out of a cell with the arrows). |
|
430 | - ``C-z``: undo (retrieves lost text if you move out of a cell with the arrows). | |
431 | - ``C-S-z``: redo. |
|
431 | - ``C-S-z``: redo. | |
432 | - ``C-o``: move to 'other' area, between pager and terminal. |
|
432 | - ``C-o``: move to 'other' area, between pager and terminal. | |
433 | - ``C-l``: clear terminal. |
|
433 | - ``C-l``: clear terminal. | |
434 | - ``C-a``: go to beginning of line. |
|
434 | - ``C-a``: go to beginning of line. | |
435 | - ``C-e``: go to end of line. |
|
435 | - ``C-e``: go to end of line. | |
436 | - ``C-u``: kill from cursor to the begining of the line. |
|
436 | - ``C-u``: kill from cursor to the begining of the line. | |
437 | - ``C-k``: kill from cursor to the end of the line. |
|
437 | - ``C-k``: kill from cursor to the end of the line. | |
438 | - ``C-y``: yank (paste) |
|
438 | - ``C-y``: yank (paste) | |
439 | - ``C-p``: previous line (like up arrow) |
|
439 | - ``C-p``: previous line (like up arrow) | |
440 | - ``C-n``: next line (like down arrow) |
|
440 | - ``C-n``: next line (like down arrow) | |
441 | - ``C-f``: forward (like right arrow) |
|
441 | - ``C-f``: forward (like right arrow) | |
442 | - ``C-b``: back (like left arrow) |
|
442 | - ``C-b``: back (like left arrow) | |
443 | - ``C-d``: delete next character, or exits if input is empty |
|
443 | - ``C-d``: delete next character, or exits if input is empty | |
444 | - ``M-<``: move to the beginning of the input region. |
|
444 | - ``M-<``: move to the beginning of the input region. | |
445 | - ``M->``: move to the end of the input region. |
|
445 | - ``M->``: move to the end of the input region. | |
446 | - ``M-d``: delete next word. |
|
446 | - ``M-d``: delete next word. | |
447 | - ``M-Backspace``: delete previous word. |
|
447 | - ``M-Backspace``: delete previous word. | |
448 | - ``C-.``: force a kernel restart (a confirmation dialog appears). |
|
448 | - ``C-.``: force a kernel restart (a confirmation dialog appears). | |
449 | - ``C-+``: increase font size. |
|
449 | - ``C-+``: increase font size. | |
450 | - ``C--``: decrease font size. |
|
450 | - ``C--``: decrease font size. | |
451 | - ``C-M-Space``: toggle full screen. (Command-Control-Space on Mac OS X) |
|
451 | - ``C-M-Space``: toggle full screen. (Command-Control-Space on Mac OS X) | |
452 |
|
452 | |||
453 | The IPython pager |
|
453 | The IPython pager | |
454 | ================= |
|
454 | ================= | |
455 |
|
455 | |||
456 | IPython will show long blocks of text from many sources using a builtin pager. |
|
456 | IPython will show long blocks of text from many sources using a builtin pager. | |
457 | You can control where this pager appears with the ``--paging`` command-line |
|
457 | You can control where this pager appears with the ``--paging`` command-line | |
458 | flag: |
|
458 | flag: | |
459 |
|
459 | |||
460 | - ``inside`` [default]: the pager is overlaid on top of the main terminal. You |
|
460 | - ``inside`` [default]: the pager is overlaid on top of the main terminal. You | |
461 | must quit the pager to get back to the terminal (similar to how a pager such |
|
461 | must quit the pager to get back to the terminal (similar to how a pager such | |
462 | as ``less`` or ``more`` works). |
|
462 | as ``less`` or ``more`` works). | |
463 |
|
463 | |||
464 | - ``vsplit``: the console is made double-tall, and the pager appears on the |
|
464 | - ``vsplit``: the console is made double-tall, and the pager appears on the | |
465 | bottom area when needed. You can view its contents while using the terminal. |
|
465 | bottom area when needed. You can view its contents while using the terminal. | |
466 |
|
466 | |||
467 | - ``hsplit``: the console is made double-wide, and the pager appears on the |
|
467 | - ``hsplit``: the console is made double-wide, and the pager appears on the | |
468 | right area when needed. You can view its contents while using the terminal. |
|
468 | right area when needed. You can view its contents while using the terminal. | |
469 |
|
469 | |||
470 | - ``none``: the console never pages output. |
|
470 | - ``none``: the console never pages output. | |
471 |
|
471 | |||
472 | If you use the vertical or horizontal paging modes, you can navigate between |
|
472 | If you use the vertical or horizontal paging modes, you can navigate between | |
473 | terminal and pager as follows: |
|
473 | terminal and pager as follows: | |
474 |
|
474 | |||
475 | - Tab key: goes from pager to terminal (but not the other way around). |
|
475 | - Tab key: goes from pager to terminal (but not the other way around). | |
476 | - Control-o: goes from one to another always. |
|
476 | - Control-o: goes from one to another always. | |
477 | - Mouse: click on either. |
|
477 | - Mouse: click on either. | |
478 |
|
478 | |||
479 | In all cases, the ``q`` or ``Escape`` keys quit the pager (when used with the |
|
479 | In all cases, the ``q`` or ``Escape`` keys quit the pager (when used with the | |
480 | focus on the pager area). |
|
480 | focus on the pager area). | |
481 |
|
481 | |||
482 | Running subprocesses |
|
482 | Running subprocesses | |
483 | ==================== |
|
483 | ==================== | |
484 |
|
484 | |||
485 | The graphical IPython console uses the ``pexpect`` module to run subprocesses |
|
485 | The graphical IPython console uses the ``pexpect`` module to run subprocesses | |
486 | when you type ``!command``. This has a number of advantages (true asynchronous |
|
486 | when you type ``!command``. This has a number of advantages (true asynchronous | |
487 | output from subprocesses as well as very robust termination of rogue |
|
487 | output from subprocesses as well as very robust termination of rogue | |
488 | subprocesses with ``Control-C``), as well as some limitations. The main |
|
488 | subprocesses with ``Control-C``), as well as some limitations. The main | |
489 | limitation is that you can *not* interact back with the subprocess, so anything |
|
489 | limitation is that you can *not* interact back with the subprocess, so anything | |
490 | that invokes a pager or expects you to type input into it will block and hang |
|
490 | that invokes a pager or expects you to type input into it will block and hang | |
491 | (you can kill it with ``Control-C``). |
|
491 | (you can kill it with ``Control-C``). | |
492 |
|
492 | |||
493 | We have provided as magics ``%less`` to page files (aliased to ``%more``), |
|
493 | We have provided as magics ``%less`` to page files (aliased to ``%more``), | |
494 | ``%clear`` to clear the terminal, and ``%man`` on Linux/OSX. These cover the |
|
494 | ``%clear`` to clear the terminal, and ``%man`` on Linux/OSX. These cover the | |
495 | most common commands you'd want to call in your subshell and that would cause |
|
495 | most common commands you'd want to call in your subshell and that would cause | |
496 | problems if invoked via ``!cmd``, but you need to be aware of this limitation. |
|
496 | problems if invoked via ``!cmd``, but you need to be aware of this limitation. | |
497 |
|
497 | |||
498 | Display |
|
498 | Display | |
499 | ======= |
|
499 | ======= | |
500 |
|
500 | |||
501 | The IPython console can now display objects in a variety of formats, including |
|
501 | The IPython console can now display objects in a variety of formats, including | |
502 | HTML, PNG and SVG. This is accomplished using the display functions in |
|
502 | HTML, PNG and SVG. This is accomplished using the display functions in | |
503 | ``IPython.core.display``:: |
|
503 | ``IPython.core.display``:: | |
504 |
|
504 | |||
505 | In [4]: from IPython.core.display import display, display_html |
|
505 | In [4]: from IPython.core.display import display, display_html | |
506 |
|
506 | |||
507 | In [5]: from IPython.core.display import display_png, display_svg |
|
507 | In [5]: from IPython.core.display import display_png, display_svg | |
508 |
|
508 | |||
509 | Python objects can simply be passed to these functions and the appropriate |
|
509 | Python objects can simply be passed to these functions and the appropriate | |
510 | representations will be displayed in the console as long as the objects know |
|
510 | representations will be displayed in the console as long as the objects know | |
511 | how to compute those representations. The easiest way of teaching objects how |
|
511 | how to compute those representations. The easiest way of teaching objects how | |
512 | to format themselves in various representations is to define special methods |
|
512 | to format themselves in various representations is to define special methods | |
513 | such as: ``_repr_html_``, ``_repr_svg_`` and ``_repr_png_``. IPython's display formatters |
|
513 | such as: ``_repr_html_``, ``_repr_svg_`` and ``_repr_png_``. IPython's display formatters | |
514 | can also be given custom formatter functions for various types:: |
|
514 | can also be given custom formatter functions for various types:: | |
515 |
|
515 | |||
516 | In [6]: ip = get_ipython() |
|
516 | In [6]: ip = get_ipython() | |
517 |
|
517 | |||
518 | In [7]: html_formatter = ip.display_formatter.formatters['text/html'] |
|
518 | In [7]: html_formatter = ip.display_formatter.formatters['text/html'] | |
519 |
|
519 | |||
520 | In [8]: html_formatter.for_type(Foo, foo_to_html) |
|
520 | In [8]: html_formatter.for_type(Foo, foo_to_html) | |
521 |
|
521 | |||
522 | For further details, see ``IPython.core.formatters``. |
|
522 | For further details, see ``IPython.core.formatters``. | |
523 |
|
523 | |||
524 | Inline matplotlib graphics |
|
524 | Inline matplotlib graphics | |
525 | ========================== |
|
525 | ========================== | |
526 |
|
526 | |||
527 | The IPython console is capable of displaying matplotlib figures inline, in SVG |
|
527 | The IPython console is capable of displaying matplotlib figures inline, in SVG | |
528 | or PNG format. If started with the ``matplotlib=inline``, then all figures are |
|
528 | or PNG format. If started with the ``matplotlib=inline``, then all figures are | |
529 | rendered inline automatically (PNG by default). If started with ``--matplotlib`` |
|
529 | rendered inline automatically (PNG by default). If started with ``--matplotlib`` | |
530 | or ``matplotlib=<your backend>``, then a GUI backend will be used, but IPython's |
|
530 | or ``matplotlib=<your backend>``, then a GUI backend will be used, but IPython's | |
531 | ``display()`` and ``getfigs()`` functions can be used to view plots inline:: |
|
531 | ``display()`` and ``getfigs()`` functions can be used to view plots inline:: | |
532 |
|
532 | |||
533 | In [9]: display(*getfigs()) # display all figures inline |
|
533 | In [9]: display(*getfigs()) # display all figures inline | |
534 |
|
534 | |||
535 | In[10]: display(*getfigs(1,2)) # display figures 1 and 2 inline |
|
535 | In[10]: display(*getfigs(1,2)) # display figures 1 and 2 inline | |
536 | """ |
|
536 | """ | |
537 |
|
537 | |||
538 |
|
538 | |||
539 | quick_guide = """\ |
|
539 | quick_guide = """\ | |
540 | ? -> Introduction and overview of IPython's features. |
|
540 | ? -> Introduction and overview of IPython's features. | |
541 | %quickref -> Quick reference. |
|
541 | %quickref -> Quick reference. | |
542 | help -> Python's own help system. |
|
542 | help -> Python's own help system. | |
543 | object? -> Details about 'object', use 'object??' for extra details. |
|
543 | object? -> Details about 'object', use 'object??' for extra details. | |
544 | """ |
|
544 | """ | |
545 |
|
545 | |||
546 | gui_note = """\ |
|
546 | gui_note = """\ | |
547 | %guiref -> A brief reference about the graphical user interface. |
|
547 | %guiref -> A brief reference about the graphical user interface. | |
548 | """ |
|
548 | """ | |
549 |
|
549 | |||
550 | default_banner_parts = [ |
|
550 | default_banner_parts = [ | |
551 | 'Python %s\n' % (sys.version.split('\n')[0],), |
|
551 | 'Python %s\n' % (sys.version.split('\n')[0],), | |
552 | 'Type "copyright", "credits" or "license" for more information.\n\n', |
|
552 | 'Type "copyright", "credits" or "license" for more information.\n\n', | |
553 |
'IPython |
|
553 | 'IPython {version} -- An enhanced Interactive Python.\n'.format( | |
|
554 | version=release.version, | |||
|
555 | ), | |||
554 | quick_guide |
|
556 | quick_guide | |
555 | ] |
|
557 | ] | |
556 |
|
558 | |||
557 | default_gui_banner_parts = default_banner_parts + [gui_note] |
|
559 | default_gui_banner_parts = default_banner_parts + [gui_note] | |
558 |
|
560 | |||
559 | default_banner = ''.join(default_banner_parts) |
|
561 | default_banner = ''.join(default_banner_parts) | |
560 |
|
562 | |||
561 | default_gui_banner = ''.join(default_gui_banner_parts) |
|
563 | default_gui_banner = ''.join(default_gui_banner_parts) | |
562 |
|
564 | |||
563 | # page GUI Reference, for use as a magic: |
|
565 | # page GUI Reference, for use as a magic: | |
564 |
|
566 | |||
565 | def page_guiref(arg_s=None): |
|
567 | def page_guiref(arg_s=None): | |
566 | """Show a basic reference about the GUI Console.""" |
|
568 | """Show a basic reference about the GUI Console.""" | |
567 | from IPython.core import page |
|
569 | from IPython.core import page | |
568 | page.page(gui_reference, auto_html=True) |
|
570 | page.page(gui_reference, auto_html=True) | |
569 |
|
571 |
@@ -1,166 +1,167 b'' | |||||
1 | # encoding: utf-8 |
|
1 | # encoding: utf-8 | |
2 | """ |
|
2 | """ | |
3 | Utilities for getting information about IPython and the system it's running in. |
|
3 | Utilities for getting information about IPython and the system it's running in. | |
4 | """ |
|
4 | """ | |
5 |
|
5 | |||
6 | #----------------------------------------------------------------------------- |
|
6 | #----------------------------------------------------------------------------- | |
7 | # Copyright (C) 2008-2011 The IPython Development Team |
|
7 | # Copyright (C) 2008-2011 The IPython Development Team | |
8 | # |
|
8 | # | |
9 | # Distributed under the terms of the BSD License. The full license is in |
|
9 | # Distributed under the terms of the BSD License. The full license is in | |
10 | # the file COPYING, distributed as part of this software. |
|
10 | # the file COPYING, distributed as part of this software. | |
11 | #----------------------------------------------------------------------------- |
|
11 | #----------------------------------------------------------------------------- | |
12 |
|
12 | |||
13 | #----------------------------------------------------------------------------- |
|
13 | #----------------------------------------------------------------------------- | |
14 | # Imports |
|
14 | # Imports | |
15 | #----------------------------------------------------------------------------- |
|
15 | #----------------------------------------------------------------------------- | |
16 |
|
16 | |||
17 | import os |
|
17 | import os | |
18 | import platform |
|
18 | import platform | |
19 | import pprint |
|
19 | import pprint | |
20 | import sys |
|
20 | import sys | |
21 | import subprocess |
|
21 | import subprocess | |
22 |
|
22 | |||
23 | from IPython.core import release |
|
23 | from IPython.core import release | |
24 | from IPython.utils import py3compat, _sysinfo, encoding |
|
24 | from IPython.utils import py3compat, _sysinfo, encoding | |
25 |
|
25 | |||
26 | #----------------------------------------------------------------------------- |
|
26 | #----------------------------------------------------------------------------- | |
27 | # Code |
|
27 | # Code | |
28 | #----------------------------------------------------------------------------- |
|
28 | #----------------------------------------------------------------------------- | |
29 |
|
29 | |||
30 | def pkg_commit_hash(pkg_path): |
|
30 | def pkg_commit_hash(pkg_path): | |
31 | """Get short form of commit hash given directory `pkg_path` |
|
31 | """Get short form of commit hash given directory `pkg_path` | |
32 |
|
32 | |||
33 | We get the commit hash from (in order of preference): |
|
33 | We get the commit hash from (in order of preference): | |
34 |
|
34 | |||
35 | * IPython.utils._sysinfo.commit |
|
35 | * IPython.utils._sysinfo.commit | |
36 | * git output, if we are in a git repository |
|
36 | * git output, if we are in a git repository | |
37 |
|
37 | |||
38 | If these fail, we return a not-found placeholder tuple |
|
38 | If these fail, we return a not-found placeholder tuple | |
39 |
|
39 | |||
40 | Parameters |
|
40 | Parameters | |
41 | ---------- |
|
41 | ---------- | |
42 | pkg_path : str |
|
42 | pkg_path : str | |
43 | directory containing package |
|
43 | directory containing package | |
44 | only used for getting commit from active repo |
|
44 | only used for getting commit from active repo | |
45 |
|
45 | |||
46 | Returns |
|
46 | Returns | |
47 | ------- |
|
47 | ------- | |
48 | hash_from : str |
|
48 | hash_from : str | |
49 | Where we got the hash from - description |
|
49 | Where we got the hash from - description | |
50 | hash_str : str |
|
50 | hash_str : str | |
51 | short form of hash |
|
51 | short form of hash | |
52 | """ |
|
52 | """ | |
53 | # Try and get commit from written commit text file |
|
53 | # Try and get commit from written commit text file | |
54 | if _sysinfo.commit: |
|
54 | if _sysinfo.commit: | |
55 | return "installation", _sysinfo.commit |
|
55 | return "installation", _sysinfo.commit | |
56 |
|
56 | |||
57 | # maybe we are in a repository |
|
57 | # maybe we are in a repository | |
58 | proc = subprocess.Popen('git rev-parse --short HEAD', |
|
58 | proc = subprocess.Popen('git rev-parse --short HEAD', | |
59 | stdout=subprocess.PIPE, |
|
59 | stdout=subprocess.PIPE, | |
60 | stderr=subprocess.PIPE, |
|
60 | stderr=subprocess.PIPE, | |
61 | cwd=pkg_path, shell=True) |
|
61 | cwd=pkg_path, shell=True) | |
62 | repo_commit, _ = proc.communicate() |
|
62 | repo_commit, _ = proc.communicate() | |
63 | if repo_commit: |
|
63 | if repo_commit: | |
64 | return 'repository', repo_commit.strip() |
|
64 | return 'repository', repo_commit.strip() | |
65 | return '(none found)', '<not found>' |
|
65 | return '(none found)', '<not found>' | |
66 |
|
66 | |||
67 |
|
67 | |||
68 | def pkg_info(pkg_path): |
|
68 | def pkg_info(pkg_path): | |
69 | """Return dict describing the context of this package |
|
69 | """Return dict describing the context of this package | |
70 |
|
70 | |||
71 | Parameters |
|
71 | Parameters | |
72 | ---------- |
|
72 | ---------- | |
73 | pkg_path : str |
|
73 | pkg_path : str | |
74 | path containing __init__.py for package |
|
74 | path containing __init__.py for package | |
75 |
|
75 | |||
76 | Returns |
|
76 | Returns | |
77 | ------- |
|
77 | ------- | |
78 | context : dict |
|
78 | context : dict | |
79 | with named parameters of interest |
|
79 | with named parameters of interest | |
80 | """ |
|
80 | """ | |
81 | src, hsh = pkg_commit_hash(pkg_path) |
|
81 | src, hsh = pkg_commit_hash(pkg_path) | |
82 | return dict( |
|
82 | return dict( | |
83 | ipython_version=release.version, |
|
83 | ipython_version=release.version, | |
84 | ipython_path=pkg_path, |
|
84 | ipython_path=pkg_path, | |
|
85 | codename=release.codename, | |||
85 | commit_source=src, |
|
86 | commit_source=src, | |
86 | commit_hash=hsh, |
|
87 | commit_hash=hsh, | |
87 | sys_version=sys.version, |
|
88 | sys_version=sys.version, | |
88 | sys_executable=sys.executable, |
|
89 | sys_executable=sys.executable, | |
89 | sys_platform=sys.platform, |
|
90 | sys_platform=sys.platform, | |
90 | platform=platform.platform(), |
|
91 | platform=platform.platform(), | |
91 | os_name=os.name, |
|
92 | os_name=os.name, | |
92 | default_encoding=encoding.DEFAULT_ENCODING, |
|
93 | default_encoding=encoding.DEFAULT_ENCODING, | |
93 | ) |
|
94 | ) | |
94 |
|
95 | |||
95 |
|
96 | |||
96 | @py3compat.doctest_refactor_print |
|
97 | @py3compat.doctest_refactor_print | |
97 | def sys_info(): |
|
98 | def sys_info(): | |
98 | """Return useful information about IPython and the system, as a string. |
|
99 | """Return useful information about IPython and the system, as a string. | |
99 |
|
100 | |||
100 | Example |
|
101 | Example | |
101 | ------- |
|
102 | ------- | |
102 | In [2]: print sys_info() |
|
103 | In [2]: print sys_info() | |
103 | {'commit_hash': '144fdae', # random |
|
104 | {'commit_hash': '144fdae', # random | |
104 | 'commit_source': 'repository', |
|
105 | 'commit_source': 'repository', | |
105 | 'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython', |
|
106 | 'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython', | |
106 | 'ipython_version': '0.11.dev', |
|
107 | 'ipython_version': '0.11.dev', | |
107 | 'os_name': 'posix', |
|
108 | 'os_name': 'posix', | |
108 | 'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick', |
|
109 | 'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick', | |
109 | 'sys_executable': '/usr/bin/python', |
|
110 | 'sys_executable': '/usr/bin/python', | |
110 | 'sys_platform': 'linux2', |
|
111 | 'sys_platform': 'linux2', | |
111 | 'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \\n[GCC 4.4.5]'} |
|
112 | 'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \\n[GCC 4.4.5]'} | |
112 | """ |
|
113 | """ | |
113 | p = os.path |
|
114 | p = os.path | |
114 | path = p.dirname(p.abspath(p.join(__file__, '..'))) |
|
115 | path = p.dirname(p.abspath(p.join(__file__, '..'))) | |
115 | return pprint.pformat(pkg_info(path)) |
|
116 | return pprint.pformat(pkg_info(path)) | |
116 |
|
117 | |||
117 |
|
118 | |||
118 | def _num_cpus_unix(): |
|
119 | def _num_cpus_unix(): | |
119 | """Return the number of active CPUs on a Unix system.""" |
|
120 | """Return the number of active CPUs on a Unix system.""" | |
120 | return os.sysconf("SC_NPROCESSORS_ONLN") |
|
121 | return os.sysconf("SC_NPROCESSORS_ONLN") | |
121 |
|
122 | |||
122 |
|
123 | |||
123 | def _num_cpus_darwin(): |
|
124 | def _num_cpus_darwin(): | |
124 | """Return the number of active CPUs on a Darwin system.""" |
|
125 | """Return the number of active CPUs on a Darwin system.""" | |
125 | p = subprocess.Popen(['sysctl','-n','hw.ncpu'],stdout=subprocess.PIPE) |
|
126 | p = subprocess.Popen(['sysctl','-n','hw.ncpu'],stdout=subprocess.PIPE) | |
126 | return p.stdout.read() |
|
127 | return p.stdout.read() | |
127 |
|
128 | |||
128 |
|
129 | |||
129 | def _num_cpus_windows(): |
|
130 | def _num_cpus_windows(): | |
130 | """Return the number of active CPUs on a Windows system.""" |
|
131 | """Return the number of active CPUs on a Windows system.""" | |
131 | return os.environ.get("NUMBER_OF_PROCESSORS") |
|
132 | return os.environ.get("NUMBER_OF_PROCESSORS") | |
132 |
|
133 | |||
133 |
|
134 | |||
134 | def num_cpus(): |
|
135 | def num_cpus(): | |
135 | """Return the effective number of CPUs in the system as an integer. |
|
136 | """Return the effective number of CPUs in the system as an integer. | |
136 |
|
137 | |||
137 | This cross-platform function makes an attempt at finding the total number of |
|
138 | This cross-platform function makes an attempt at finding the total number of | |
138 | available CPUs in the system, as returned by various underlying system and |
|
139 | available CPUs in the system, as returned by various underlying system and | |
139 | python calls. |
|
140 | python calls. | |
140 |
|
141 | |||
141 | If it can't find a sensible answer, it returns 1 (though an error *may* make |
|
142 | If it can't find a sensible answer, it returns 1 (though an error *may* make | |
142 | it return a large positive number that's actually incorrect). |
|
143 | it return a large positive number that's actually incorrect). | |
143 | """ |
|
144 | """ | |
144 |
|
145 | |||
145 | # Many thanks to the Parallel Python project (http://www.parallelpython.com) |
|
146 | # Many thanks to the Parallel Python project (http://www.parallelpython.com) | |
146 | # for the names of the keys we needed to look up for this function. This |
|
147 | # for the names of the keys we needed to look up for this function. This | |
147 | # code was inspired by their equivalent function. |
|
148 | # code was inspired by their equivalent function. | |
148 |
|
149 | |||
149 | ncpufuncs = {'Linux':_num_cpus_unix, |
|
150 | ncpufuncs = {'Linux':_num_cpus_unix, | |
150 | 'Darwin':_num_cpus_darwin, |
|
151 | 'Darwin':_num_cpus_darwin, | |
151 | 'Windows':_num_cpus_windows, |
|
152 | 'Windows':_num_cpus_windows, | |
152 | # On Vista, python < 2.5.2 has a bug and returns 'Microsoft' |
|
153 | # On Vista, python < 2.5.2 has a bug and returns 'Microsoft' | |
153 | # See http://bugs.python.org/issue1082 for details. |
|
154 | # See http://bugs.python.org/issue1082 for details. | |
154 | 'Microsoft':_num_cpus_windows, |
|
155 | 'Microsoft':_num_cpus_windows, | |
155 | } |
|
156 | } | |
156 |
|
157 | |||
157 | ncpufunc = ncpufuncs.get(platform.system(), |
|
158 | ncpufunc = ncpufuncs.get(platform.system(), | |
158 | # default to unix version (Solaris, AIX, etc) |
|
159 | # default to unix version (Solaris, AIX, etc) | |
159 | _num_cpus_unix) |
|
160 | _num_cpus_unix) | |
160 |
|
161 | |||
161 | try: |
|
162 | try: | |
162 | ncpus = max(1,int(ncpufunc())) |
|
163 | ncpus = max(1,int(ncpufunc())) | |
163 | except: |
|
164 | except: | |
164 | ncpus = 1 |
|
165 | ncpus = 1 | |
165 | return ncpus |
|
166 | return ncpus | |
166 |
|
167 |
@@ -1,234 +1,235 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | # |
|
2 | # | |
3 | # IPython documentation build configuration file. |
|
3 | # IPython documentation build configuration file. | |
4 |
|
4 | |||
5 | # NOTE: This file has been edited manually from the auto-generated one from |
|
5 | # NOTE: This file has been edited manually from the auto-generated one from | |
6 | # sphinx. Do NOT delete and re-generate. If any changes from sphinx are |
|
6 | # sphinx. Do NOT delete and re-generate. If any changes from sphinx are | |
7 | # needed, generate a scratch one and merge by hand any new fields needed. |
|
7 | # needed, generate a scratch one and merge by hand any new fields needed. | |
8 |
|
8 | |||
9 | # |
|
9 | # | |
10 | # This file is execfile()d with the current directory set to its containing dir. |
|
10 | # This file is execfile()d with the current directory set to its containing dir. | |
11 | # |
|
11 | # | |
12 | # The contents of this file are pickled, so don't put values in the namespace |
|
12 | # The contents of this file are pickled, so don't put values in the namespace | |
13 | # that aren't pickleable (module imports are okay, they're removed automatically). |
|
13 | # that aren't pickleable (module imports are okay, they're removed automatically). | |
14 | # |
|
14 | # | |
15 | # All configuration values have a default value; values that are commented out |
|
15 | # All configuration values have a default value; values that are commented out | |
16 | # serve to show the default value. |
|
16 | # serve to show the default value. | |
17 |
|
17 | |||
18 | import sys, os |
|
18 | import sys, os | |
19 |
|
19 | |||
20 | ON_RTD = os.environ.get('READTHEDOCS', None) == 'True' |
|
20 | ON_RTD = os.environ.get('READTHEDOCS', None) == 'True' | |
21 |
|
21 | |||
22 | if ON_RTD: |
|
22 | if ON_RTD: | |
23 | # Mock the presence of matplotlib, which we don't have on RTD |
|
23 | # Mock the presence of matplotlib, which we don't have on RTD | |
24 | # see |
|
24 | # see | |
25 | # http://read-the-docs.readthedocs.org/en/latest/faq.html |
|
25 | # http://read-the-docs.readthedocs.org/en/latest/faq.html | |
26 | tags.add('rtd') |
|
26 | tags.add('rtd') | |
27 |
|
27 | |||
28 | # If your extensions are in another directory, add it here. If the directory |
|
28 | # If your extensions are in another directory, add it here. If the directory | |
29 | # is relative to the documentation root, use os.path.abspath to make it |
|
29 | # is relative to the documentation root, use os.path.abspath to make it | |
30 | # absolute, like shown here. |
|
30 | # absolute, like shown here. | |
31 | sys.path.insert(0, os.path.abspath('../sphinxext')) |
|
31 | sys.path.insert(0, os.path.abspath('../sphinxext')) | |
32 |
|
32 | |||
33 | # We load the ipython release info into a dict by explicit execution |
|
33 | # We load the ipython release info into a dict by explicit execution | |
34 | iprelease = {} |
|
34 | iprelease = {} | |
35 | execfile('../../IPython/core/release.py',iprelease) |
|
35 | execfile('../../IPython/core/release.py',iprelease) | |
36 |
|
36 | |||
37 | # General configuration |
|
37 | # General configuration | |
38 | # --------------------- |
|
38 | # --------------------- | |
39 |
|
39 | |||
40 | # Add any Sphinx extension module names here, as strings. They can be extensions |
|
40 | # Add any Sphinx extension module names here, as strings. They can be extensions | |
41 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
|
41 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | |
42 | extensions = [ |
|
42 | extensions = [ | |
43 | 'matplotlib.sphinxext.mathmpl', |
|
43 | 'matplotlib.sphinxext.mathmpl', | |
44 | 'matplotlib.sphinxext.only_directives', |
|
44 | 'matplotlib.sphinxext.only_directives', | |
45 | 'matplotlib.sphinxext.plot_directive', |
|
45 | 'matplotlib.sphinxext.plot_directive', | |
46 | 'sphinx.ext.autodoc', |
|
46 | 'sphinx.ext.autodoc', | |
47 | 'sphinx.ext.doctest', |
|
47 | 'sphinx.ext.doctest', | |
48 | 'sphinx.ext.inheritance_diagram', |
|
48 | 'sphinx.ext.inheritance_diagram', | |
49 | 'IPython.sphinxext.ipython_console_highlighting', |
|
49 | 'IPython.sphinxext.ipython_console_highlighting', | |
50 | 'IPython.sphinxext.ipython_directive', |
|
50 | 'IPython.sphinxext.ipython_directive', | |
51 | 'numpydoc', # to preprocess docstrings |
|
51 | 'numpydoc', # to preprocess docstrings | |
52 | 'github', # for easy GitHub links |
|
52 | 'github', # for easy GitHub links | |
53 | ] |
|
53 | ] | |
54 |
|
54 | |||
55 | if ON_RTD: |
|
55 | if ON_RTD: | |
56 | # Remove extensions not currently supported on RTD |
|
56 | # Remove extensions not currently supported on RTD | |
57 | extensions.remove('matplotlib.sphinxext.only_directives') |
|
57 | extensions.remove('matplotlib.sphinxext.only_directives') | |
58 | extensions.remove('matplotlib.sphinxext.mathmpl') |
|
58 | extensions.remove('matplotlib.sphinxext.mathmpl') | |
59 | extensions.remove('matplotlib.sphinxext.plot_directive') |
|
59 | extensions.remove('matplotlib.sphinxext.plot_directive') | |
60 | extensions.remove('IPython.sphinxext.ipython_directive') |
|
60 | extensions.remove('IPython.sphinxext.ipython_directive') | |
61 | extensions.remove('IPython.sphinxext.ipython_console_highlighting') |
|
61 | extensions.remove('IPython.sphinxext.ipython_console_highlighting') | |
62 |
|
62 | |||
63 | # Add any paths that contain templates here, relative to this directory. |
|
63 | # Add any paths that contain templates here, relative to this directory. | |
64 | templates_path = ['_templates'] |
|
64 | templates_path = ['_templates'] | |
65 |
|
65 | |||
66 | # The suffix of source filenames. |
|
66 | # The suffix of source filenames. | |
67 | source_suffix = '.rst' |
|
67 | source_suffix = '.rst' | |
68 |
|
68 | |||
69 | if iprelease['_version_extra']: |
|
69 | if iprelease['_version_extra']: | |
70 | rst_prolog = """ |
|
70 | rst_prolog = """ | |
71 | .. note:: |
|
71 | .. note:: | |
72 |
|
72 | |||
73 | This documentation is for a development version of IPython. There may be |
|
73 | This documentation is for a development version of IPython. There may be | |
74 | significant differences from the latest stable release (0.13.2). |
|
74 | significant differences from the latest stable release (0.13.2). | |
75 |
|
75 | |||
76 | """ |
|
76 | """ | |
77 |
|
77 | |||
78 | # The master toctree document. |
|
78 | # The master toctree document. | |
79 | master_doc = 'index' |
|
79 | master_doc = 'index' | |
80 |
|
80 | |||
81 | # General substitutions. |
|
81 | # General substitutions. | |
82 | project = 'IPython' |
|
82 | project = 'IPython' | |
83 | copyright = '2008, The IPython Development Team' |
|
83 | copyright = '2008, The IPython Development Team' | |
84 |
|
84 | |||
85 | # ghissue config |
|
85 | # ghissue config | |
86 | github_project_url = "https://github.com/ipython/ipython" |
|
86 | github_project_url = "https://github.com/ipython/ipython" | |
87 |
|
87 | |||
88 | # The default replacements for |version| and |release|, also used in various |
|
88 | # The default replacements for |version| and |release|, also used in various | |
89 | # other places throughout the built documents. |
|
89 | # other places throughout the built documents. | |
90 | # |
|
90 | # | |
91 | # The full version, including alpha/beta/rc tags. |
|
91 | # The full version, including alpha/beta/rc tags. | |
92 |
|
|
92 | codename = iprelease['codename'] | |
93 | # The short X.Y version. |
|
93 | release = "%s: %s" % (iprelease['version'], codename) | |
94 | version = '.'.join(release.split('.',2)[:2]) |
|
94 | # Just the X.Y.Z part, no '-dev' | |
|
95 | version = iprelease['version'].split('-', 1)[0] | |||
95 |
|
96 | |||
96 |
|
97 | |||
97 | # There are two options for replacing |today|: either, you set today to some |
|
98 | # There are two options for replacing |today|: either, you set today to some | |
98 | # non-false value, then it is used: |
|
99 | # non-false value, then it is used: | |
99 | #today = '' |
|
100 | #today = '' | |
100 | # Else, today_fmt is used as the format for a strftime call. |
|
101 | # Else, today_fmt is used as the format for a strftime call. | |
101 | today_fmt = '%B %d, %Y' |
|
102 | today_fmt = '%B %d, %Y' | |
102 |
|
103 | |||
103 | # List of documents that shouldn't be included in the build. |
|
104 | # List of documents that shouldn't be included in the build. | |
104 | #unused_docs = [] |
|
105 | #unused_docs = [] | |
105 |
|
106 | |||
106 | # List of directories, relative to source directories, that shouldn't be searched |
|
107 | # List of directories, relative to source directories, that shouldn't be searched | |
107 | # for source files. |
|
108 | # for source files. | |
108 | exclude_dirs = ['attic'] |
|
109 | exclude_dirs = ['attic'] | |
109 |
|
110 | |||
110 | # If true, '()' will be appended to :func: etc. cross-reference text. |
|
111 | # If true, '()' will be appended to :func: etc. cross-reference text. | |
111 | #add_function_parentheses = True |
|
112 | #add_function_parentheses = True | |
112 |
|
113 | |||
113 | # If true, the current module name will be prepended to all description |
|
114 | # If true, the current module name will be prepended to all description | |
114 | # unit titles (such as .. function::). |
|
115 | # unit titles (such as .. function::). | |
115 | #add_module_names = True |
|
116 | #add_module_names = True | |
116 |
|
117 | |||
117 | # If true, sectionauthor and moduleauthor directives will be shown in the |
|
118 | # If true, sectionauthor and moduleauthor directives will be shown in the | |
118 | # output. They are ignored by default. |
|
119 | # output. They are ignored by default. | |
119 | #show_authors = False |
|
120 | #show_authors = False | |
120 |
|
121 | |||
121 | # The name of the Pygments (syntax highlighting) style to use. |
|
122 | # The name of the Pygments (syntax highlighting) style to use. | |
122 | pygments_style = 'sphinx' |
|
123 | pygments_style = 'sphinx' | |
123 |
|
124 | |||
124 |
|
125 | |||
125 | # Options for HTML output |
|
126 | # Options for HTML output | |
126 | # ----------------------- |
|
127 | # ----------------------- | |
127 |
|
128 | |||
128 | # The style sheet to use for HTML and HTML Help pages. A file of that name |
|
129 | # The style sheet to use for HTML and HTML Help pages. A file of that name | |
129 | # must exist either in Sphinx' static/ path, or in one of the custom paths |
|
130 | # must exist either in Sphinx' static/ path, or in one of the custom paths | |
130 | # given in html_static_path. |
|
131 | # given in html_static_path. | |
131 | html_style = 'default.css' |
|
132 | html_style = 'default.css' | |
132 |
|
133 | |||
133 | # The name for this set of Sphinx documents. If None, it defaults to |
|
134 | # The name for this set of Sphinx documents. If None, it defaults to | |
134 | # "<project> v<release> documentation". |
|
135 | # "<project> v<release> documentation". | |
135 | #html_title = None |
|
136 | #html_title = None | |
136 |
|
137 | |||
137 | # The name of an image file (within the static path) to place at the top of |
|
138 | # The name of an image file (within the static path) to place at the top of | |
138 | # the sidebar. |
|
139 | # the sidebar. | |
139 | #html_logo = None |
|
140 | #html_logo = None | |
140 |
|
141 | |||
141 | # Add any paths that contain custom static files (such as style sheets) here, |
|
142 | # Add any paths that contain custom static files (such as style sheets) here, | |
142 | # relative to this directory. They are copied after the builtin static files, |
|
143 | # relative to this directory. They are copied after the builtin static files, | |
143 | # so a file named "default.css" will overwrite the builtin "default.css". |
|
144 | # so a file named "default.css" will overwrite the builtin "default.css". | |
144 | html_static_path = ['_static'] |
|
145 | html_static_path = ['_static'] | |
145 |
|
146 | |||
146 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
|
147 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, | |
147 | # using the given strftime format. |
|
148 | # using the given strftime format. | |
148 | html_last_updated_fmt = '%b %d, %Y' |
|
149 | html_last_updated_fmt = '%b %d, %Y' | |
149 |
|
150 | |||
150 | # If true, SmartyPants will be used to convert quotes and dashes to |
|
151 | # If true, SmartyPants will be used to convert quotes and dashes to | |
151 | # typographically correct entities. |
|
152 | # typographically correct entities. | |
152 | #html_use_smartypants = True |
|
153 | #html_use_smartypants = True | |
153 |
|
154 | |||
154 | # Custom sidebar templates, maps document names to template names. |
|
155 | # Custom sidebar templates, maps document names to template names. | |
155 | #html_sidebars = {} |
|
156 | #html_sidebars = {} | |
156 |
|
157 | |||
157 | # Additional templates that should be rendered to pages, maps page names to |
|
158 | # Additional templates that should be rendered to pages, maps page names to | |
158 | # template names. |
|
159 | # template names. | |
159 | #html_additional_pages = {} |
|
160 | #html_additional_pages = {} | |
160 |
|
161 | |||
161 | # If false, no module index is generated. |
|
162 | # If false, no module index is generated. | |
162 | #html_use_modindex = True |
|
163 | #html_use_modindex = True | |
163 |
|
164 | |||
164 | # If true, the reST sources are included in the HTML build as _sources/<name>. |
|
165 | # If true, the reST sources are included in the HTML build as _sources/<name>. | |
165 | #html_copy_source = True |
|
166 | #html_copy_source = True | |
166 |
|
167 | |||
167 | # If true, an OpenSearch description file will be output, and all pages will |
|
168 | # If true, an OpenSearch description file will be output, and all pages will | |
168 | # contain a <link> tag referring to it. The value of this option must be the |
|
169 | # contain a <link> tag referring to it. The value of this option must be the | |
169 | # base URL from which the finished HTML is served. |
|
170 | # base URL from which the finished HTML is served. | |
170 | #html_use_opensearch = '' |
|
171 | #html_use_opensearch = '' | |
171 |
|
172 | |||
172 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). |
|
173 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). | |
173 | #html_file_suffix = '' |
|
174 | #html_file_suffix = '' | |
174 |
|
175 | |||
175 | # Output file base name for HTML help builder. |
|
176 | # Output file base name for HTML help builder. | |
176 | htmlhelp_basename = 'ipythondoc' |
|
177 | htmlhelp_basename = 'ipythondoc' | |
177 |
|
178 | |||
178 |
|
179 | |||
179 | # Options for LaTeX output |
|
180 | # Options for LaTeX output | |
180 | # ------------------------ |
|
181 | # ------------------------ | |
181 |
|
182 | |||
182 | # The paper size ('letter' or 'a4'). |
|
183 | # The paper size ('letter' or 'a4'). | |
183 | latex_paper_size = 'letter' |
|
184 | latex_paper_size = 'letter' | |
184 |
|
185 | |||
185 | # The font size ('10pt', '11pt' or '12pt'). |
|
186 | # The font size ('10pt', '11pt' or '12pt'). | |
186 | latex_font_size = '11pt' |
|
187 | latex_font_size = '11pt' | |
187 |
|
188 | |||
188 | # Grouping the document tree into LaTeX files. List of tuples |
|
189 | # Grouping the document tree into LaTeX files. List of tuples | |
189 | # (source start file, target name, title, author, document class [howto/manual]). |
|
190 | # (source start file, target name, title, author, document class [howto/manual]). | |
190 |
|
191 | |||
191 | latex_documents = [ |
|
192 | latex_documents = [ | |
192 | ('index', 'ipython.tex', 'IPython Documentation', |
|
193 | ('index', 'ipython.tex', 'IPython Documentation', | |
193 | ur"""The IPython Development Team""", 'manual', True), |
|
194 | ur"""The IPython Development Team""", 'manual', True), | |
194 | ('parallel/winhpc_index', 'winhpc_whitepaper.tex', |
|
195 | ('parallel/winhpc_index', 'winhpc_whitepaper.tex', | |
195 | 'Using IPython on Windows HPC Server 2008', |
|
196 | 'Using IPython on Windows HPC Server 2008', | |
196 | ur"Brian E. Granger", 'manual', True) |
|
197 | ur"Brian E. Granger", 'manual', True) | |
197 | ] |
|
198 | ] | |
198 |
|
199 | |||
199 | # The name of an image file (relative to this directory) to place at the top of |
|
200 | # The name of an image file (relative to this directory) to place at the top of | |
200 | # the title page. |
|
201 | # the title page. | |
201 | #latex_logo = None |
|
202 | #latex_logo = None | |
202 |
|
203 | |||
203 | # For "manual" documents, if this is true, then toplevel headings are parts, |
|
204 | # For "manual" documents, if this is true, then toplevel headings are parts, | |
204 | # not chapters. |
|
205 | # not chapters. | |
205 | #latex_use_parts = False |
|
206 | #latex_use_parts = False | |
206 |
|
207 | |||
207 | # Additional stuff for the LaTeX preamble. |
|
208 | # Additional stuff for the LaTeX preamble. | |
208 | #latex_preamble = '' |
|
209 | #latex_preamble = '' | |
209 |
|
210 | |||
210 | # Documents to append as an appendix to all manuals. |
|
211 | # Documents to append as an appendix to all manuals. | |
211 | #latex_appendices = [] |
|
212 | #latex_appendices = [] | |
212 |
|
213 | |||
213 | # If false, no module index is generated. |
|
214 | # If false, no module index is generated. | |
214 | latex_use_modindex = True |
|
215 | latex_use_modindex = True | |
215 |
|
216 | |||
216 |
|
217 | |||
217 | # Options for texinfo output |
|
218 | # Options for texinfo output | |
218 | # -------------------------- |
|
219 | # -------------------------- | |
219 |
|
220 | |||
220 | texinfo_documents = [ |
|
221 | texinfo_documents = [ | |
221 | (master_doc, 'ipython', 'IPython Documentation', |
|
222 | (master_doc, 'ipython', 'IPython Documentation', | |
222 | 'The IPython Development Team', |
|
223 | 'The IPython Development Team', | |
223 | 'IPython', |
|
224 | 'IPython', | |
224 | 'IPython Documentation', |
|
225 | 'IPython Documentation', | |
225 | 'Programming', |
|
226 | 'Programming', | |
226 | 1), |
|
227 | 1), | |
227 | ] |
|
228 | ] | |
228 |
|
229 | |||
229 |
|
230 | |||
230 | # Cleanup |
|
231 | # Cleanup | |
231 | # ------- |
|
232 | # ------- | |
232 | # delete release info to avoid pickling errors from sphinx |
|
233 | # delete release info to avoid pickling errors from sphinx | |
233 |
|
234 | |||
234 | del iprelease |
|
235 | del iprelease |
@@ -1,294 +1,295 b'' | |||||
1 | ============ |
|
1 | ============ | |
2 | 1.0 Series |
|
2 | 1.0 Series | |
3 | ============ |
|
3 | ============ | |
4 |
|
4 | |||
5 | Release 1.0 |
|
5 | Release 1.0.0: An Afternoon Hack | |
6 | =========== |
|
6 | ================================ | |
|
7 | ||||
7 |
|
8 | |||
8 | IPython 1.0 requires Python β₯ 2.6.5 or β₯ 3.2.1. |
|
9 | IPython 1.0 requires Python β₯ 2.6.5 or β₯ 3.2.1. | |
9 | It does not support Python 3.0, 3.1, or 2.5. |
|
10 | It does not support Python 3.0, 3.1, or 2.5. | |
10 |
|
11 | |||
11 | This is a big release. The principal milestone is the addition of :mod:`IPython.nbconvert`, |
|
12 | This is a big release. The principal milestone is the addition of :mod:`IPython.nbconvert`, | |
12 | but there has been a great deal of work improving all parts of IPython as well. |
|
13 | but there has been a great deal of work improving all parts of IPython as well. | |
13 |
|
14 | |||
14 | The previous version (0.13) was released on June 30, 2012, |
|
15 | The previous version (0.13) was released on June 30, 2012, | |
15 | and in this development cycle we had: |
|
16 | and in this development cycle we had: | |
16 |
|
17 | |||
17 | - ~12 months of work. |
|
18 | - ~12 months of work. | |
18 | - ~700 pull requests merged. |
|
19 | - ~700 pull requests merged. | |
19 | - ~600 issues closed (non-pull requests). |
|
20 | - ~600 issues closed (non-pull requests). | |
20 | - contributions from ~150 authors. |
|
21 | - contributions from ~150 authors. | |
21 | - ~4000 commits. |
|
22 | - ~4000 commits. | |
22 |
|
23 | |||
23 | The amount of work included in this release is so large that we can only cover |
|
24 | The amount of work included in this release is so large that we can only cover | |
24 | here the main highlights; please see our :ref:`detailed release statistics |
|
25 | here the main highlights; please see our :ref:`detailed release statistics | |
25 | <issues_list_100>` for links to every issue and pull request closed on GitHub |
|
26 | <issues_list_100>` for links to every issue and pull request closed on GitHub | |
26 | as well as a full list of individual contributors. |
|
27 | as well as a full list of individual contributors. | |
27 | It includes |
|
28 | It includes | |
28 |
|
29 | |||
29 | Reorganization |
|
30 | Reorganization | |
30 | -------------- |
|
31 | -------------- | |
31 |
|
32 | |||
32 | There have been two major reorganizations in IPython 1.0: |
|
33 | There have been two major reorganizations in IPython 1.0: | |
33 |
|
34 | |||
34 | - Added :mod:`IPython.kernel` for all kernel-related code. |
|
35 | - Added :mod:`IPython.kernel` for all kernel-related code. | |
35 | This means that :mod:`IPython.zmq` has been removed, |
|
36 | This means that :mod:`IPython.zmq` has been removed, | |
36 | and much of it is now in :mod:`IPython.kernel.zmq`, |
|
37 | and much of it is now in :mod:`IPython.kernel.zmq`, | |
37 | some of it being in the top-level :mod:`IPython.kernel`. |
|
38 | some of it being in the top-level :mod:`IPython.kernel`. | |
38 | - We have removed the `frontend` subpackage, |
|
39 | - We have removed the `frontend` subpackage, | |
39 | as it caused unnecessary depth. So what was :mod:`IPython.frontend.qt` |
|
40 | as it caused unnecessary depth. So what was :mod:`IPython.frontend.qt` | |
40 | is now :mod:`IPython.qt`, and so on. The one difference is that |
|
41 | is now :mod:`IPython.qt`, and so on. The one difference is that | |
41 | the notebook has been further flattened, so that |
|
42 | the notebook has been further flattened, so that | |
42 | :mod:`IPython.frontend.html.notebook` is now just `IPython.html`. |
|
43 | :mod:`IPython.frontend.html.notebook` is now just `IPython.html`. | |
43 | There is a shim module, so :mod:`IPython.frontend` is still |
|
44 | There is a shim module, so :mod:`IPython.frontend` is still | |
44 | importable in 1.0, but there will be a warning. |
|
45 | importable in 1.0, but there will be a warning. | |
45 | - The IPython sphinx directives are now installed in :mod:`IPython.sphinx`, |
|
46 | - The IPython sphinx directives are now installed in :mod:`IPython.sphinx`, | |
46 | so they can be imported by other projects. |
|
47 | so they can be imported by other projects. | |
47 |
|
48 | |||
48 |
|
49 | |||
49 | Public APIs |
|
50 | Public APIs | |
50 | ----------- |
|
51 | ----------- | |
51 |
|
52 | |||
52 | For the first time since 0.10 (sorry, everyone), |
|
53 | For the first time since 0.10 (sorry, everyone), | |
53 | there is an official public API for starting IPython: |
|
54 | there is an official public API for starting IPython: | |
54 |
|
55 | |||
55 | .. sourcecode:: python |
|
56 | .. sourcecode:: python | |
56 |
|
57 | |||
57 | from IPython import start_ipython |
|
58 | from IPython import start_ipython | |
58 | start_ipython() |
|
59 | start_ipython() | |
59 |
|
60 | |||
60 | This is what packages should use that start their own IPython session, |
|
61 | This is what packages should use that start their own IPython session, | |
61 | but don't actually want embedded IPython (most cases). |
|
62 | but don't actually want embedded IPython (most cases). | |
62 | :func:`IPython.embed()` is used for embedding IPython into the calling namespace, |
|
63 | :func:`IPython.embed()` is used for embedding IPython into the calling namespace, | |
63 | similar to calling :func:`Pdb.set_trace`, whereas :func:`start_ipython` |
|
64 | similar to calling :func:`Pdb.set_trace`, whereas :func:`start_ipython` | |
64 | will start a plain IPython session, loading config and startup files as normal. |
|
65 | will start a plain IPython session, loading config and startup files as normal. | |
65 |
|
66 | |||
66 | We also have added: |
|
67 | We also have added: | |
67 |
|
68 | |||
68 | .. sourcecode:: python |
|
69 | .. sourcecode:: python | |
69 |
|
70 | |||
70 | from IPython import get_ipython |
|
71 | from IPython import get_ipython | |
71 |
|
72 | |||
72 |
|
73 | |||
73 | Which is a *library* function for getting the current IPython instance, |
|
74 | Which is a *library* function for getting the current IPython instance, | |
74 | and will return ``None`` if no IPython instance is running. |
|
75 | and will return ``None`` if no IPython instance is running. | |
75 | This is the official way to check whether your code is called from inside an IPython session. |
|
76 | This is the official way to check whether your code is called from inside an IPython session. | |
76 | If you want to check for IPython without unnecessarily importing IPython, |
|
77 | If you want to check for IPython without unnecessarily importing IPython, | |
77 | use this function: |
|
78 | use this function: | |
78 |
|
79 | |||
79 | .. sourcecode:: python |
|
80 | .. sourcecode:: python | |
80 |
|
81 | |||
81 | def get_ipython(): |
|
82 | def get_ipython(): | |
82 | """return IPython instance if there is one, None otherwise""" |
|
83 | """return IPython instance if there is one, None otherwise""" | |
83 | import sys |
|
84 | import sys | |
84 | if "IPython" in sys.modules: |
|
85 | if "IPython" in sys.modules: | |
85 | import IPython |
|
86 | import IPython | |
86 | return IPython.get_ipython() |
|
87 | return IPython.get_ipython() | |
87 |
|
88 | |||
88 | Core |
|
89 | Core | |
89 | ---- |
|
90 | ---- | |
90 |
|
91 | |||
91 | - The input transformation framework has been reworked. This fixes some corner |
|
92 | - The input transformation framework has been reworked. This fixes some corner | |
92 | cases, and adds more flexibility for projects which use IPython, like SymPy & |
|
93 | cases, and adds more flexibility for projects which use IPython, like SymPy & | |
93 | SAGE. For more details, see :doc:`/config/inputtransforms`. |
|
94 | SAGE. For more details, see :doc:`/config/inputtransforms`. | |
94 | - Exception types can now be displayed with a custom traceback, by defining a |
|
95 | - Exception types can now be displayed with a custom traceback, by defining a | |
95 | ``_render_traceback_()`` method which returns a list of strings, each |
|
96 | ``_render_traceback_()`` method which returns a list of strings, each | |
96 | containing one line of the traceback. |
|
97 | containing one line of the traceback. | |
97 | - A new command, ``ipython history trim`` can be used to delete everything but |
|
98 | - A new command, ``ipython history trim`` can be used to delete everything but | |
98 | the last 1000 entries in the history database. |
|
99 | the last 1000 entries in the history database. | |
99 | - ``__file__`` is defined in both config files at load time, |
|
100 | - ``__file__`` is defined in both config files at load time, | |
100 | and ``.ipy`` files executed with ``%run``. |
|
101 | and ``.ipy`` files executed with ``%run``. | |
101 | - ``%logstart`` and ``%logappend`` are no longer broken. |
|
102 | - ``%logstart`` and ``%logappend`` are no longer broken. | |
102 | - Add glob expansion for ``%run``, e.g. ``%run -g script.py *.txt``. |
|
103 | - Add glob expansion for ``%run``, e.g. ``%run -g script.py *.txt``. | |
103 | - Expand variables (``$foo``) in Cell Magic argument line. |
|
104 | - Expand variables (``$foo``) in Cell Magic argument line. | |
104 | - By default, :command:`iptest` will exclude various slow tests. |
|
105 | - By default, :command:`iptest` will exclude various slow tests. | |
105 | All tests can be run with :command:`iptest --all`. |
|
106 | All tests can be run with :command:`iptest --all`. | |
106 | - SQLite history can be disabled in the various cases that it does not behave well. |
|
107 | - SQLite history can be disabled in the various cases that it does not behave well. | |
107 | - ``%edit`` works on interactively defined variables. |
|
108 | - ``%edit`` works on interactively defined variables. | |
108 | - editor hooks have been restored from quarantine, enabling TextMate as editor, |
|
109 | - editor hooks have been restored from quarantine, enabling TextMate as editor, | |
109 | etc. |
|
110 | etc. | |
110 | - The env variable PYTHONSTARTUP is respected by IPython. |
|
111 | - The env variable PYTHONSTARTUP is respected by IPython. | |
111 | - A ``%matplotlib`` magic is added, which is like the old ``%pylab`` magic, |
|
112 | - A ``%matplotlib`` magic is added, which is like the old ``%pylab`` magic, | |
112 | but it does not import anything to the interactive namespace. |
|
113 | but it does not import anything to the interactive namespace. | |
113 | It is recommended that users switch to ``%matplotlib`` and explicit imports. |
|
114 | It is recommended that users switch to ``%matplotlib`` and explicit imports. | |
114 |
|
115 | |||
115 |
|
116 | |||
116 | Backwards incompatible changes |
|
117 | Backwards incompatible changes | |
117 | ****************************** |
|
118 | ****************************** | |
118 |
|
119 | |||
119 | - Calling :meth:`InteractiveShell.prefilter` will no longer perform static |
|
120 | - Calling :meth:`InteractiveShell.prefilter` will no longer perform static | |
120 | transformations - the processing of escaped commands such as ``%magic`` and |
|
121 | transformations - the processing of escaped commands such as ``%magic`` and | |
121 | ``!system``, and stripping input prompts from code blocks. This functionality |
|
122 | ``!system``, and stripping input prompts from code blocks. This functionality | |
122 | was duplicated in :mod:`IPython.core.inputsplitter`, and the latter version |
|
123 | was duplicated in :mod:`IPython.core.inputsplitter`, and the latter version | |
123 | was already what IPython relied on. A new API to transform input will be ready |
|
124 | was already what IPython relied on. A new API to transform input will be ready | |
124 | before release. |
|
125 | before release. | |
125 | - Functions from :mod:`IPython.lib.inputhook` to control integration with GUI |
|
126 | - Functions from :mod:`IPython.lib.inputhook` to control integration with GUI | |
126 | event loops are no longer exposed in the top level of :mod:`IPython.lib`. |
|
127 | event loops are no longer exposed in the top level of :mod:`IPython.lib`. | |
127 | Code calling these should make sure to import them from |
|
128 | Code calling these should make sure to import them from | |
128 | :mod:`IPython.lib.inputhook`. |
|
129 | :mod:`IPython.lib.inputhook`. | |
129 | - For all kernel managers, the ``sub_channel`` attribute has been renamed to |
|
130 | - For all kernel managers, the ``sub_channel`` attribute has been renamed to | |
130 | ``iopub_channel``. |
|
131 | ``iopub_channel``. | |
131 | - Users on Python versions before 2.6.6, 2.7.1 or 3.2 will now need to call |
|
132 | - Users on Python versions before 2.6.6, 2.7.1 or 3.2 will now need to call | |
132 | :func:`IPython.utils.doctestreload.doctest_reload` to make doctests run |
|
133 | :func:`IPython.utils.doctestreload.doctest_reload` to make doctests run | |
133 | correctly inside IPython. Python releases since those versions are unaffected. |
|
134 | correctly inside IPython. Python releases since those versions are unaffected. | |
134 | For details, see :ghpull:`3068` and `Python issue 8048 <http://bugs.python.org/issue8048>`_. |
|
135 | For details, see :ghpull:`3068` and `Python issue 8048 <http://bugs.python.org/issue8048>`_. | |
135 | - The ``InteractiveShell.cache_main_mod()`` method has been removed, and |
|
136 | - The ``InteractiveShell.cache_main_mod()`` method has been removed, and | |
136 | :meth:`~IPython.core.interactiveshell.InteractiveShell.new_main_mod` has a |
|
137 | :meth:`~IPython.core.interactiveshell.InteractiveShell.new_main_mod` has a | |
137 | different signature, expecting a filename where earlier versions expected |
|
138 | different signature, expecting a filename where earlier versions expected | |
138 | a namespace. See :ghpull:`3555` for details. |
|
139 | a namespace. See :ghpull:`3555` for details. | |
139 | - The short-lived plugin system has been removed. Extensions are the way to go. |
|
140 | - The short-lived plugin system has been removed. Extensions are the way to go. | |
140 |
|
141 | |||
141 |
|
142 | |||
142 | .. _nbconvert1: |
|
143 | .. _nbconvert1: | |
143 |
|
144 | |||
144 | NbConvert |
|
145 | NbConvert | |
145 | --------- |
|
146 | --------- | |
146 |
|
147 | |||
147 | The major milestone for IPython 1.0 is the addition of :mod:`IPython.nbconvert` - tools for converting |
|
148 | The major milestone for IPython 1.0 is the addition of :mod:`IPython.nbconvert` - tools for converting | |
148 | IPython notebooks to various other formats. |
|
149 | IPython notebooks to various other formats. | |
149 |
|
150 | |||
150 | .. warning:: |
|
151 | .. warning:: | |
151 |
|
152 | |||
152 | nbconvert is Ξ±-level preview code in 1.0 |
|
153 | nbconvert is Ξ±-level preview code in 1.0 | |
153 |
|
154 | |||
154 | To use nbconvert to convert various file formats:: |
|
155 | To use nbconvert to convert various file formats:: | |
155 |
|
156 | |||
156 | ipython nbconvert --format full_html *.ipynb |
|
157 | ipython nbconvert --format full_html *.ipynb | |
157 |
|
158 | |||
158 | See ``ipython nbconvert --help`` for more information. |
|
159 | See ``ipython nbconvert --help`` for more information. | |
159 | nbconvert depends on `pandoc`_ for many of the translations to and from various formats. |
|
160 | nbconvert depends on `pandoc`_ for many of the translations to and from various formats. | |
160 |
|
161 | |||
161 | .. _pandoc: http://johnmacfarlane.net/pandoc/ |
|
162 | .. _pandoc: http://johnmacfarlane.net/pandoc/ | |
162 |
|
163 | |||
163 | Notebook |
|
164 | Notebook | |
164 | -------- |
|
165 | -------- | |
165 |
|
166 | |||
166 | Major changes to the IPython Notebook in 1.0: |
|
167 | Major changes to the IPython Notebook in 1.0: | |
167 |
|
168 | |||
168 | - The notebook is now autosaved, by default at an interval of two minutes. |
|
169 | - The notebook is now autosaved, by default at an interval of two minutes. | |
169 | When you press 'save' or Ctrl-S, a *checkpoint* is made, in a hidden folder. |
|
170 | When you press 'save' or Ctrl-S, a *checkpoint* is made, in a hidden folder. | |
170 | This checkpoint can be restored, so that the autosave model is strictly safer |
|
171 | This checkpoint can be restored, so that the autosave model is strictly safer | |
171 | than traditional save. If you change nothing about your save habits, |
|
172 | than traditional save. If you change nothing about your save habits, | |
172 | you will always have a checkpoint that you have written, |
|
173 | you will always have a checkpoint that you have written, | |
173 | and an autosaved file that is kept up to date. |
|
174 | and an autosaved file that is kept up to date. | |
174 | - You can load custom javascript and CSS in the notebook by editing the files |
|
175 | - You can load custom javascript and CSS in the notebook by editing the files | |
175 | :file:`$(ipython locate profile)/static/custom/custom.{js,css}`. |
|
176 | :file:`$(ipython locate profile)/static/custom/custom.{js,css}`. | |
176 | - Add ``%%html``, ``%%svg``, ``%%javascript``, and ``%%latex`` cell magics |
|
177 | - Add ``%%html``, ``%%svg``, ``%%javascript``, and ``%%latex`` cell magics | |
177 | for writing raw output in notebook cells. |
|
178 | for writing raw output in notebook cells. | |
178 | - add a redirect handler and anchors on heading cells, so you can link |
|
179 | - add a redirect handler and anchors on heading cells, so you can link | |
179 | across notebooks, directly to heading cells in other notebooks. |
|
180 | across notebooks, directly to heading cells in other notebooks. | |
180 | - Images support width and height metadata, |
|
181 | - Images support width and height metadata, | |
181 | and thereby 2x scaling (retina support). |
|
182 | and thereby 2x scaling (retina support). | |
182 | - ``_repr_foo_`` methods can return a tuple of (data, metadata), |
|
183 | - ``_repr_foo_`` methods can return a tuple of (data, metadata), | |
183 | where metadata is a dict containing metadata about the displayed object. |
|
184 | where metadata is a dict containing metadata about the displayed object. | |
184 | This is used to set size, etc. for retina graphics. To enable retina matplotlib figures, |
|
185 | This is used to set size, etc. for retina graphics. To enable retina matplotlib figures, | |
185 | simply set ``InlineBackend.figure_format = 'retina'`` for 2x PNG figures. |
|
186 | simply set ``InlineBackend.figure_format = 'retina'`` for 2x PNG figures. | |
186 | - Add display.FileLink and FileLinks for quickly displaying HTML links to local files. |
|
187 | - Add display.FileLink and FileLinks for quickly displaying HTML links to local files. | |
187 | - Cells have metadata, which can be edited via cell toolbars. |
|
188 | - Cells have metadata, which can be edited via cell toolbars. | |
188 | This metadata can be used by external code (e.g. reveal.js or exporters), |
|
189 | This metadata can be used by external code (e.g. reveal.js or exporters), | |
189 | when examining the notebook. |
|
190 | when examining the notebook. | |
190 | - Fix an issue parsing LaTeX in markdown cells, which required users to type ``\\\``, |
|
191 | - Fix an issue parsing LaTeX in markdown cells, which required users to type ``\\\``, | |
191 | instead of ``\\``. |
|
192 | instead of ``\\``. | |
192 | - Notebook templates are rendered with Jinja instead of Tornado. |
|
193 | - Notebook templates are rendered with Jinja instead of Tornado. | |
193 | - ``%%file`` has been renamed ``%%writefile`` (``%%file``) is deprecated. |
|
194 | - ``%%file`` has been renamed ``%%writefile`` (``%%file``) is deprecated. | |
194 | - ANSI (and VT100) color parsing has been improved in both performance and |
|
195 | - ANSI (and VT100) color parsing has been improved in both performance and | |
195 | supported values. |
|
196 | supported values. | |
196 | - The static files path can be found as ``IPython.html.DEFAULT_STATIC_FILES_PATH``, |
|
197 | - The static files path can be found as ``IPython.html.DEFAULT_STATIC_FILES_PATH``, | |
197 | which may be changed by package managers. |
|
198 | which may be changed by package managers. | |
198 | - The notebook supports :func:`raw_input`, and thus also ``%debug``. |
|
199 | - The notebook supports :func:`raw_input`, and thus also ``%debug``. | |
199 | - IPython's CSS is installed in :file:`static/css/style.min.css` |
|
200 | - IPython's CSS is installed in :file:`static/css/style.min.css` | |
200 | (all style, including bootstrap), and :file:`static/css/ipython.min.css`, |
|
201 | (all style, including bootstrap), and :file:`static/css/ipython.min.css`, | |
201 | which only has IPython's own CSS. The latter file should be useful for embedding |
|
202 | which only has IPython's own CSS. The latter file should be useful for embedding | |
202 | IPython notebooks in other pages, blogs, etc. |
|
203 | IPython notebooks in other pages, blogs, etc. | |
203 | - The Print View has been removed. Users are encouraged to test :ref:`ipython |
|
204 | - The Print View has been removed. Users are encouraged to test :ref:`ipython | |
204 | nbconvert <nbconvert1>` to generate a static view. |
|
205 | nbconvert <nbconvert1>` to generate a static view. | |
205 |
|
206 | |||
206 | Javascript Components |
|
207 | Javascript Components | |
207 | ********************* |
|
208 | ********************* | |
208 |
|
209 | |||
209 | The javascript components used in the notebook have been updated significantly. |
|
210 | The javascript components used in the notebook have been updated significantly. | |
210 |
|
211 | |||
211 | - updates to jQuery (2.0) and jQueryUI (1.10) |
|
212 | - updates to jQuery (2.0) and jQueryUI (1.10) | |
212 | - Update CodeMirror to 3.14 |
|
213 | - Update CodeMirror to 3.14 | |
213 | - Twitter Bootstrap (2.3) for layout |
|
214 | - Twitter Bootstrap (2.3) for layout | |
214 | - Font-Awesome (3.1) for icons |
|
215 | - Font-Awesome (3.1) for icons | |
215 | - highlight.js (7.3) for syntax highlighting |
|
216 | - highlight.js (7.3) for syntax highlighting | |
216 | - marked (0.2.8) for markdown rendering |
|
217 | - marked (0.2.8) for markdown rendering | |
217 | - require.js (2.1) for loading javascript |
|
218 | - require.js (2.1) for loading javascript | |
218 |
|
219 | |||
219 | Some relevant changes that are results of this: |
|
220 | Some relevant changes that are results of this: | |
220 |
|
221 | |||
221 | - Markdown cells now support GitHub-flavored Markdown (GFM), |
|
222 | - Markdown cells now support GitHub-flavored Markdown (GFM), | |
222 | which includes ``\`\`\`python`` code blocks and tables. |
|
223 | which includes ``\`\`\`python`` code blocks and tables. | |
223 | - Notebook UI behaves better on more screen sizes. |
|
224 | - Notebook UI behaves better on more screen sizes. | |
224 | - Various code cell input issues have been fixed. |
|
225 | - Various code cell input issues have been fixed. | |
225 |
|
226 | |||
226 |
|
227 | |||
227 | Kernel |
|
228 | Kernel | |
228 | ------ |
|
229 | ------ | |
229 |
|
230 | |||
230 | The kernel code has been substantially reorganized. |
|
231 | The kernel code has been substantially reorganized. | |
231 |
|
232 | |||
232 | New features in the kernel: |
|
233 | New features in the kernel: | |
233 |
|
234 | |||
234 | - Kernels support ZeroMQ IPC transport, not just TCP |
|
235 | - Kernels support ZeroMQ IPC transport, not just TCP | |
235 | - The message protocol has added a top-level metadata field, |
|
236 | - The message protocol has added a top-level metadata field, | |
236 | used for information about messages. |
|
237 | used for information about messages. | |
237 | - Add a `data_pub` message that functions much like `display_pub`, |
|
238 | - Add a `data_pub` message that functions much like `display_pub`, | |
238 | but publishes raw (usually pickled) data, rather than representations. |
|
239 | but publishes raw (usually pickled) data, rather than representations. | |
239 | - Ensure that ``sys.stdout.encoding`` is defined in Kernels. |
|
240 | - Ensure that ``sys.stdout.encoding`` is defined in Kernels. | |
240 | - Stdout from forked subprocesses should be forwarded to frontends (instead of crashing). |
|
241 | - Stdout from forked subprocesses should be forwarded to frontends (instead of crashing). | |
241 |
|
242 | |||
242 | IPEP 13 |
|
243 | IPEP 13 | |
243 | ******* |
|
244 | ******* | |
244 |
|
245 | |||
245 | The KernelManager has been split into a :class:`~.KernelManager` and a :class:`~.KernelClient`. |
|
246 | The KernelManager has been split into a :class:`~.KernelManager` and a :class:`~.KernelClient`. | |
246 | The Manager owns a kernel and starts / signals / restarts it. There is always zero or one |
|
247 | The Manager owns a kernel and starts / signals / restarts it. There is always zero or one | |
247 | KernelManager per Kernel. Clients communicate with Kernels via zmq channels, |
|
248 | KernelManager per Kernel. Clients communicate with Kernels via zmq channels, | |
248 | and there can be zero-to-many Clients connected to a Kernel at any given time. |
|
249 | and there can be zero-to-many Clients connected to a Kernel at any given time. | |
249 |
|
250 | |||
250 | The KernelManager now automatically restarts the kernel when it dies, |
|
251 | The KernelManager now automatically restarts the kernel when it dies, | |
251 | rather than requiring user input at the notebook or QtConsole UI |
|
252 | rather than requiring user input at the notebook or QtConsole UI | |
252 | (which may or may not exist at restart time). |
|
253 | (which may or may not exist at restart time). | |
253 |
|
254 | |||
254 | In-process kernels |
|
255 | In-process kernels | |
255 | ****************** |
|
256 | ****************** | |
256 |
|
257 | |||
257 | The Python-language frontends, particularly the Qt console, may now communicate |
|
258 | The Python-language frontends, particularly the Qt console, may now communicate | |
258 | with in-process kernels, in addition to the traditional out-of-process |
|
259 | with in-process kernels, in addition to the traditional out-of-process | |
259 | kernels. An in-process kernel permits direct access to the kernel namespace, |
|
260 | kernels. An in-process kernel permits direct access to the kernel namespace, | |
260 | which is necessary in some applications. It should be understood, however, that |
|
261 | which is necessary in some applications. It should be understood, however, that | |
261 | the in-process kernel is not robust to bad user input and will block the main |
|
262 | the in-process kernel is not robust to bad user input and will block the main | |
262 | (GUI) thread while executing. Developers must decide on a case-by-case basis |
|
263 | (GUI) thread while executing. Developers must decide on a case-by-case basis | |
263 | whether this tradeoff is appropriate for their application. |
|
264 | whether this tradeoff is appropriate for their application. | |
264 |
|
265 | |||
265 |
|
266 | |||
266 |
|
267 | |||
267 | Parallel |
|
268 | Parallel | |
268 | -------- |
|
269 | -------- | |
269 |
|
270 | |||
270 | IPython.parallel has had some refactoring as well. |
|
271 | IPython.parallel has had some refactoring as well. | |
271 | There are many improvements and fixes, but these are the major changes: |
|
272 | There are many improvements and fixes, but these are the major changes: | |
272 |
|
273 | |||
273 | - Connections have been simplified. All ports and the serialization in use |
|
274 | - Connections have been simplified. All ports and the serialization in use | |
274 | are written to the connection file, rather than the initial two-stage system. |
|
275 | are written to the connection file, rather than the initial two-stage system. | |
275 | - Serialization has been rewritten, fixing many bugs and dramatically improving |
|
276 | - Serialization has been rewritten, fixing many bugs and dramatically improving | |
276 | performance serializing large containers. |
|
277 | performance serializing large containers. | |
277 | - Load-balancing scheduler performance with large numbers of tasks has been dramatically improved. |
|
278 | - Load-balancing scheduler performance with large numbers of tasks has been dramatically improved. | |
278 | - There should be fewer (hopefully zero) false-positives for engine failures. |
|
279 | - There should be fewer (hopefully zero) false-positives for engine failures. | |
279 | - Increased compatibility with various use cases that produced serialization / argument errors |
|
280 | - Increased compatibility with various use cases that produced serialization / argument errors | |
280 | with map, etc. |
|
281 | with map, etc. | |
281 | - The controller can attempt to resume operation if it has crashed, |
|
282 | - The controller can attempt to resume operation if it has crashed, | |
282 | by passing ``ipcontroller --restore``. |
|
283 | by passing ``ipcontroller --restore``. | |
283 | - Engines can monitor the Hub heartbeat, and shutdown if the Hub disappears for too long. |
|
284 | - Engines can monitor the Hub heartbeat, and shutdown if the Hub disappears for too long. | |
284 | - add HTCondor support in launchers |
|
285 | - add HTCondor support in launchers | |
285 |
|
286 | |||
286 |
|
287 | |||
287 | QtConsole |
|
288 | QtConsole | |
288 | --------- |
|
289 | --------- | |
289 |
|
290 | |||
290 | Various fixes, including improved performance with lots of text output, |
|
291 | Various fixes, including improved performance with lots of text output, | |
291 | and better drag and drop support. |
|
292 | and better drag and drop support. | |
292 | The initial window size of the qtconsole is now configurable via ``IPythonWidget.width`` |
|
293 | The initial window size of the qtconsole is now configurable via ``IPythonWidget.width`` | |
293 | and ``IPythonWidget.height``. |
|
294 | and ``IPythonWidget.height``. | |
294 |
|
295 |
General Comments 0
You need to be logged in to leave comments.
Login now