##// END OF EJS Templates
Fix undefined labels in docs #2
klonuo -
Show More
@@ -1,249 +1,249 b''
1 =================
1 =================
2 Python vs IPython
2 Python vs IPython
3 =================
3 =================
4
4
5 This document is meant to highlight the main differences between the Python
5 This document is meant to highlight the main differences between the Python
6 language and what are the specific construct you can do only in IPython.
6 language and what are the specific construct you can do only in IPython.
7
7
8 Unless expressed otherwise all of the construct you will see here will raise a
8 Unless expressed otherwise all of the construct you will see here will raise a
9 ``SyntaxError`` if run in a pure Python shell, or if executing in a Python
9 ``SyntaxError`` if run in a pure Python shell, or if executing in a Python
10 script.
10 script.
11
11
12 Each of these features are describe more in details in further part of the documentation.
12 Each of these features are describe more in details in further part of the documentation.
13
13
14
14
15 Quick overview:
15 Quick overview:
16 ===============
16 ===============
17
17
18
18
19 All the following construct are valid IPython syntax:
19 All the following construct are valid IPython syntax:
20
20
21 .. code-block:: ipython
21 .. code-block:: ipython
22
22
23 In [1]: ?
23 In [1]: ?
24
24
25 .. code-block:: ipython
25 .. code-block:: ipython
26
26
27 In [1]: ?object
27 In [1]: ?object
28
28
29
29
30 .. code-block:: ipython
30 .. code-block:: ipython
31
31
32 In [1]: object?
32 In [1]: object?
33
33
34 .. code-block:: ipython
34 .. code-block:: ipython
35
35
36 In [1]: *pattern*?
36 In [1]: *pattern*?
37
37
38 .. code-block:: ipython
38 .. code-block:: ipython
39
39
40 In [1]: %shell like --syntax
40 In [1]: %shell like --syntax
41
41
42 .. code-block:: ipython
42 .. code-block:: ipython
43
43
44 In [1]: !ls
44 In [1]: !ls
45
45
46 .. code-block:: ipython
46 .. code-block:: ipython
47
47
48 In [1]: my_files =! ls ~/
48 In [1]: my_files =! ls ~/
49 In [1]: for i,file in enumerate(my_file):
49 In [1]: for i,file in enumerate(my_file):
50 ...: raw = !echo $file
50 ...: raw = !echo $file
51 ...: !echo {files[0].upper()} $raw
51 ...: !echo {files[0].upper()} $raw
52
52
53
53
54 .. code-block:: ipython
54 .. code-block:: ipython
55
55
56 In [1]: %%perl magic --function
56 In [1]: %%perl magic --function
57 ...: @months = ("July", "August", "September");
57 ...: @months = ("July", "August", "September");
58 ...: print $months[0];
58 ...: print $months[0];
59
59
60
60
61 Each of these construct is compile by IPython into valid python code and will
61 Each of these construct is compile by IPython into valid python code and will
62 do most of the time what you expect it will do. Let see each of these example
62 do most of the time what you expect it will do. Let see each of these example
63 in more detail.
63 in more detail.
64
64
65
65
66 Accessing help
66 Accessing help
67 ==============
67 ==============
68
68
69 As IPython is mostly an interactive shell, the question mark is a simple
69 As IPython is mostly an interactive shell, the question mark is a simple
70 shortcut to get help. A question mark alone will bring up the IPython help:
70 shortcut to get help. A question mark alone will bring up the IPython help:
71
71
72 .. code-block:: ipython
72 .. code-block:: ipython
73
73
74 In [1]: ?
74 In [1]: ?
75
75
76 IPython -- An enhanced Interactive Python
76 IPython -- An enhanced Interactive Python
77 =========================================
77 =========================================
78
78
79 IPython offers a combination of convenient shell features, special commands
79 IPython offers a combination of convenient shell features, special commands
80 and a history mechanism for both input (command history) and output (results
80 and a history mechanism for both input (command history) and output (results
81 caching, similar to Mathematica). It is intended to be a fully compatible
81 caching, similar to Mathematica). It is intended to be a fully compatible
82 replacement for the standard Python interpreter, while offering vastly
82 replacement for the standard Python interpreter, while offering vastly
83 improved functionality and flexibility.
83 improved functionality and flexibility.
84
84
85 At your system command line, type 'ipython -h' to see the command line
85 At your system command line, type 'ipython -h' to see the command line
86 options available. This document only describes interactive features.
86 options available. This document only describes interactive features.
87
87
88 MAIN FEATURES
88 MAIN FEATURES
89 -------------
89 -------------
90 ...
90 ...
91
91
92 A single question mark before, or after an object available in current
92 A single question mark before, or after an object available in current
93 namespace will show help relative to this object:
93 namespace will show help relative to this object:
94
94
95 .. code-block:: ipython
95 .. code-block:: ipython
96
96
97 In [6]: object?
97 In [6]: object?
98 Docstring: The most base type
98 Docstring: The most base type
99 Type: type
99 Type: type
100
100
101
101
102 A double question mark will try to pull out more information about the object,
102 A double question mark will try to pull out more information about the object,
103 and if possible display the python source code of this object.
103 and if possible display the python source code of this object.
104
104
105 .. code-block:: ipython
105 .. code-block:: ipython
106
106
107 In[1]: import collections
107 In[1]: import collections
108 In[2]: collection.Counter??
108 In[2]: collection.Counter??
109
109
110 Init signature: collections.Counter(*args, **kwds)
110 Init signature: collections.Counter(*args, **kwds)
111 Source:
111 Source:
112 class Counter(dict):
112 class Counter(dict):
113 '''Dict subclass for counting hashable items. Sometimes called a bag
113 '''Dict subclass for counting hashable items. Sometimes called a bag
114 or multiset. Elements are stored as dictionary keys and their counts
114 or multiset. Elements are stored as dictionary keys and their counts
115 are stored as dictionary values.
115 are stored as dictionary values.
116
116
117 >>> c = Counter('abcdeabcdabcaba') # count elements from a string
117 >>> c = Counter('abcdeabcdabcaba') # count elements from a string
118
118
119 >>> c.most_common(3) # three most common elements
119 >>> c.most_common(3) # three most common elements
120 [('a', 5), ('b', 4), ('c', 3)]
120 [('a', 5), ('b', 4), ('c', 3)]
121 >>> sorted(c) # list all unique elements
121 >>> sorted(c) # list all unique elements
122 ['a', 'b', 'c', 'd', 'e']
122 ['a', 'b', 'c', 'd', 'e']
123 >>> ''.join(sorted(c.elements())) # list elements with repetitions
123 >>> ''.join(sorted(c.elements())) # list elements with repetitions
124 'aaaaabbbbcccdde'
124 'aaaaabbbbcccdde'
125 ...
125 ...
126
126
127
127
128
128
129 If you are looking for an object, the use of wildcards ``*`` in conjunction
129 If you are looking for an object, the use of wildcards ``*`` in conjunction
130 with question mark will allow you to search current namespace for object with
130 with question mark will allow you to search current namespace for object with
131 matching names:
131 matching names:
132
132
133 .. code-block:: ipython
133 .. code-block:: ipython
134
134
135 In [24]: *int*?
135 In [24]: *int*?
136 FloatingPointError
136 FloatingPointError
137 int
137 int
138 print
138 print
139
139
140
140
141 Shell Assignment
141 Shell Assignment
142 ================
142 ================
143
143
144
144
145 When doing interactive computing it is common to need to access the underlying shell.
145 When doing interactive computing it is common to need to access the underlying shell.
146 This is doable through the use of the exclamation mark ``!`` (or bang).
146 This is doable through the use of the exclamation mark ``!`` (or bang).
147
147
148 This allow to execute simple command when present in beginning of line:
148 This allow to execute simple command when present in beginning of line:
149
149
150 .. code-block:: ipython
150 .. code-block:: ipython
151
151
152 In[1]: !pwd
152 In[1]: !pwd
153 /User/home/
153 /User/home/
154
154
155 Change directory:
155 Change directory:
156
156
157 .. code-block:: ipython
157 .. code-block:: ipython
158
158
159 In[1]: !cd /var/etc
159 In[1]: !cd /var/etc
160
160
161 Or edit file:
161 Or edit file:
162
162
163 .. code-block:: ipython
163 .. code-block:: ipython
164
164
165 In[1]: !mvim myfile.txt
165 In[1]: !mvim myfile.txt
166
166
167
167
168 The line after the bang can call any program installed in the underlying
168 The line after the bang can call any program installed in the underlying
169 shell, and support variable expansion in the form of ``$variable`` or ``{variable}``.
169 shell, and support variable expansion in the form of ``$variable`` or ``{variable}``.
170 The later form of expansion supports arbitrary python expression:
170 The later form of expansion supports arbitrary python expression:
171
171
172 .. code-block:: ipython
172 .. code-block:: ipython
173
173
174 In[1]: file = 'myfile.txt'
174 In[1]: file = 'myfile.txt'
175
175
176 In[2]: !mv $file {file.upper()}
176 In[2]: !mv $file {file.upper()}
177
177
178
178
179 The bang can also be present in the right hand side of an assignment, just
179 The bang can also be present in the right hand side of an assignment, just
180 after the equal sign, or separated from it by a white space. In which case the
180 after the equal sign, or separated from it by a white space. In which case the
181 standard output of the command after the bang ``!`` will be split out into lines
181 standard output of the command after the bang ``!`` will be split out into lines
182 in a list-like object (:ref:`IPython Slist`) and assign to the left hand side.
182 in a list-like object and assign to the left hand side.
183
183
184 This allow you for example to put the list of files of the current working directory in a variable:
184 This allow you for example to put the list of files of the current working directory in a variable:
185
185
186 .. code-block:: ipython
186 .. code-block:: ipython
187
187
188 In[1]: my_files != ls
188 In[1]: my_files != ls
189
189
190
190
191 You can combine the different possibilities in for loops, condition, functions...:
191 You can combine the different possibilities in for loops, condition, functions...:
192
192
193 .. code-block:: ipython
193 .. code-block:: ipython
194
194
195 my_files =! ls ~/
195 my_files =! ls ~/
196 b = "backup file"
196 b = "backup file"
197 for i,file in enumerate(my_file):
197 for i,file in enumerate(my_file):
198 raw = !echo $backup $file
198 raw = !echo $backup $file
199 !cp $file {file.split('.')[0]+'.bak'}
199 !cp $file {file.split('.')[0]+'.bak'}
200
200
201
201
202 Magics
202 Magics
203 ------
203 ------
204
204
205 Magics function are often present in the form of shell-like syntax, but are
205 Magics function are often present in the form of shell-like syntax, but are
206 under the hood python function. The syntax and assignment possibility are
206 under the hood python function. The syntax and assignment possibility are
207 similar to the one with the bang (``!``) syntax, but with more flexibility and
207 similar to the one with the bang (``!``) syntax, but with more flexibility and
208 power. Magic function start with a percent sign (``%``) or double percent (``%%``).
208 power. Magic function start with a percent sign (``%``) or double percent (``%%``).
209
209
210 A magic call with a sign percent will act only one line:
210 A magic call with a sign percent will act only one line:
211
211
212 .. code-block:: ipython
212 .. code-block:: ipython
213
213
214 In[1]: %xmode
214 In[1]: %xmode
215 Exception reporting mode: Verbose
215 Exception reporting mode: Verbose
216
216
217 And support assignment:
217 And support assignment:
218
218
219 .. code-block:: ipython
219 .. code-block:: ipython
220
220
221 In [1]: results = %timeit -r1 -n1 -o list(range(1000))
221 In [1]: results = %timeit -r1 -n1 -o list(range(1000))
222 1 loops, best of 1: 21.1 Β΅s per loop
222 1 loops, best of 1: 21.1 Β΅s per loop
223
223
224 In [2]: results
224 In [2]: results
225 Out[2]: <TimeitResult : 1 loops, best of 1: 21.1 Β΅s per loop>
225 Out[2]: <TimeitResult : 1 loops, best of 1: 21.1 Β΅s per loop>
226
226
227 Magic with two percent sign can spread over multiple lines, but do not support assignment:
227 Magic with two percent sign can spread over multiple lines, but do not support assignment:
228
228
229 .. code-block:: ipython
229 .. code-block:: ipython
230
230
231 In[1]: %%bash
231 In[1]: %%bash
232 ... : echo "My shell is:" $SHELL
232 ... : echo "My shell is:" $SHELL
233 ... : echo "My disk usage is:"
233 ... : echo "My disk usage is:"
234 ... : df -h
234 ... : df -h
235 My shell is: /usr/local/bin/bash
235 My shell is: /usr/local/bin/bash
236 My disk usage is:
236 My disk usage is:
237 Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
237 Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
238 /dev/disk1 233Gi 216Gi 16Gi 94% 56788108 4190706 93% /
238 /dev/disk1 233Gi 216Gi 16Gi 94% 56788108 4190706 93% /
239 devfs 190Ki 190Ki 0Bi 100% 656 0 100% /dev
239 devfs 190Ki 190Ki 0Bi 100% 656 0 100% /dev
240 map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net
240 map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net
241 map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /hom
241 map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /hom
242
242
243
243
244 Combining it all
244 Combining it all
245 ----------------
245 ----------------
246
246
247 ::
247 ::
248
248
249 find a snippet that combine all that into one thing!
249 find a snippet that combine all that into one thing!
@@ -1,291 +1,291 b''
1 .. _overview:
1 .. _overview:
2
2
3 ============
3 ============
4 Introduction
4 Introduction
5 ============
5 ============
6
6
7 Overview
7 Overview
8 ========
8 ========
9
9
10 One of Python's most useful features is its interactive interpreter.
10 One of Python's most useful features is its interactive interpreter.
11 It allows for very fast testing of ideas without the overhead of
11 It allows for very fast testing of ideas without the overhead of
12 creating test files as is typical in most programming languages.
12 creating test files as is typical in most programming languages.
13 However, the interpreter supplied with the standard Python distribution
13 However, the interpreter supplied with the standard Python distribution
14 is somewhat limited for extended interactive use.
14 is somewhat limited for extended interactive use.
15
15
16 The goal of IPython is to create a comprehensive environment for
16 The goal of IPython is to create a comprehensive environment for
17 interactive and exploratory computing. To support this goal, IPython
17 interactive and exploratory computing. To support this goal, IPython
18 has three main components:
18 has three main components:
19
19
20 * An enhanced interactive Python shell.
20 * An enhanced interactive Python shell.
21 * A decoupled :ref:`two-process communication model <ipythonzmq>`, which
21 * A decoupled :ref:`two-process communication model <ipythonzmq>`, which
22 allows for multiple clients to connect to a computation kernel, most notably
22 allows for multiple clients to connect to a computation kernel, most notably
23 the web-based :ref:`notebook <htmlnotebook>`
23 the web-based notebook.
24 * An architecture for interactive parallel computing.
24 * An architecture for interactive parallel computing.
25
25
26 All of IPython is open source (released under the revised BSD license).
26 All of IPython is open source (released under the revised BSD license).
27
27
28 Enhanced interactive Python shell
28 Enhanced interactive Python shell
29 =================================
29 =================================
30
30
31 IPython's interactive shell (:command:`ipython`), has the following goals,
31 IPython's interactive shell (:command:`ipython`), has the following goals,
32 amongst others:
32 amongst others:
33
33
34 1. Provide an interactive shell superior to Python's default. IPython
34 1. Provide an interactive shell superior to Python's default. IPython
35 has many features for tab-completion, object introspection, system shell
35 has many features for tab-completion, object introspection, system shell
36 access, command history retrieval across sessions, and its own special
36 access, command history retrieval across sessions, and its own special
37 command system for adding functionality when working interactively. It
37 command system for adding functionality when working interactively. It
38 tries to be a very efficient environment both for Python code development
38 tries to be a very efficient environment both for Python code development
39 and for exploration of problems using Python objects (in situations like
39 and for exploration of problems using Python objects (in situations like
40 data analysis).
40 data analysis).
41
41
42 2. Serve as an embeddable, ready to use interpreter for your own
42 2. Serve as an embeddable, ready to use interpreter for your own
43 programs. An interactive IPython shell can be started with a single call
43 programs. An interactive IPython shell can be started with a single call
44 from inside another program, providing access to the current namespace.
44 from inside another program, providing access to the current namespace.
45 This can be very useful both for debugging purposes and for situations
45 This can be very useful both for debugging purposes and for situations
46 where a blend of batch-processing and interactive exploration are needed.
46 where a blend of batch-processing and interactive exploration are needed.
47
47
48 3. Offer a flexible framework which can be used as the base
48 3. Offer a flexible framework which can be used as the base
49 environment for working with other systems, with Python as the underlying
49 environment for working with other systems, with Python as the underlying
50 bridge language. Specifically scientific environments like Mathematica,
50 bridge language. Specifically scientific environments like Mathematica,
51 IDL and Matlab inspired its design, but similar ideas can be
51 IDL and Matlab inspired its design, but similar ideas can be
52 useful in many fields.
52 useful in many fields.
53
53
54 4. Allow interactive testing of threaded graphical toolkits. IPython
54 4. Allow interactive testing of threaded graphical toolkits. IPython
55 has support for interactive, non-blocking control of GTK, Qt, WX, GLUT, and
55 has support for interactive, non-blocking control of GTK, Qt, WX, GLUT, and
56 OS X applications via special threading flags. The normal Python
56 OS X applications via special threading flags. The normal Python
57 shell can only do this for Tkinter applications.
57 shell can only do this for Tkinter applications.
58
58
59 Main features of the interactive shell
59 Main features of the interactive shell
60 --------------------------------------
60 --------------------------------------
61
61
62 * Dynamic object introspection. One can access docstrings, function
62 * Dynamic object introspection. One can access docstrings, function
63 definition prototypes, source code, source files and other details
63 definition prototypes, source code, source files and other details
64 of any object accessible to the interpreter with a single
64 of any object accessible to the interpreter with a single
65 keystroke (:samp:`?`, and using :samp:`??` provides additional detail).
65 keystroke (:samp:`?`, and using :samp:`??` provides additional detail).
66
66
67 * Searching through modules and namespaces with :samp:`*` wildcards, both
67 * Searching through modules and namespaces with :samp:`*` wildcards, both
68 when using the :samp:`?` system and via the :samp:`%psearch` command.
68 when using the :samp:`?` system and via the :samp:`%psearch` command.
69
69
70 * Completion in the local namespace, by typing :kbd:`TAB` at the prompt.
70 * Completion in the local namespace, by typing :kbd:`TAB` at the prompt.
71 This works for keywords, modules, methods, variables and files in the
71 This works for keywords, modules, methods, variables and files in the
72 current directory. This is supported via the readline library, and
72 current directory. This is supported via the readline library, and
73 full access to configuring readline's behavior is provided.
73 full access to configuring readline's behavior is provided.
74 Custom completers can be implemented easily for different purposes
74 Custom completers can be implemented easily for different purposes
75 (system commands, magic arguments etc.)
75 (system commands, magic arguments etc.)
76
76
77 * Numbered input/output prompts with command history (persistent
77 * Numbered input/output prompts with command history (persistent
78 across sessions and tied to each profile), full searching in this
78 across sessions and tied to each profile), full searching in this
79 history and caching of all input and output.
79 history and caching of all input and output.
80
80
81 * User-extensible 'magic' commands. A set of commands prefixed with
81 * User-extensible 'magic' commands. A set of commands prefixed with
82 :samp:`%` is available for controlling IPython itself and provides
82 :samp:`%` is available for controlling IPython itself and provides
83 directory control, namespace information and many aliases to
83 directory control, namespace information and many aliases to
84 common system shell commands.
84 common system shell commands.
85
85
86 * Alias facility for defining your own system aliases.
86 * Alias facility for defining your own system aliases.
87
87
88 * Complete system shell access. Lines starting with :samp:`!` are passed
88 * Complete system shell access. Lines starting with :samp:`!` are passed
89 directly to the system shell, and using :samp:`!!` or :samp:`var = !cmd`
89 directly to the system shell, and using :samp:`!!` or :samp:`var = !cmd`
90 captures shell output into python variables for further use.
90 captures shell output into python variables for further use.
91
91
92 * The ability to expand python variables when calling the system shell. In a
92 * The ability to expand python variables when calling the system shell. In a
93 shell command, any python variable prefixed with :samp:`$` is expanded. A
93 shell command, any python variable prefixed with :samp:`$` is expanded. A
94 double :samp:`$$` allows passing a literal :samp:`$` to the shell (for access
94 double :samp:`$$` allows passing a literal :samp:`$` to the shell (for access
95 to shell and environment variables like :envvar:`PATH`).
95 to shell and environment variables like :envvar:`PATH`).
96
96
97 * Filesystem navigation, via a magic :samp:`%cd` command, along with a
97 * Filesystem navigation, via a magic :samp:`%cd` command, along with a
98 persistent bookmark system (using :samp:`%bookmark`) for fast access to
98 persistent bookmark system (using :samp:`%bookmark`) for fast access to
99 frequently visited directories.
99 frequently visited directories.
100
100
101 * A lightweight persistence framework via the :samp:`%store` command, which
101 * A lightweight persistence framework via the :samp:`%store` command, which
102 allows you to save arbitrary Python variables. These get restored
102 allows you to save arbitrary Python variables. These get restored
103 when you run the :samp:`%store -r` command.
103 when you run the :samp:`%store -r` command.
104
104
105 * Automatic indentation (optional) of code as you type (through the
105 * Automatic indentation (optional) of code as you type (through the
106 readline library).
106 readline library).
107
107
108 * Macro system for quickly re-executing multiple lines of previous
108 * Macro system for quickly re-executing multiple lines of previous
109 input with a single name via the :samp:`%macro` command. Macros can be
109 input with a single name via the :samp:`%macro` command. Macros can be
110 stored persistently via :samp:`%store` and edited via :samp:`%edit`.
110 stored persistently via :samp:`%store` and edited via :samp:`%edit`.
111
111
112 * Session logging (you can then later use these logs as code in your
112 * Session logging (you can then later use these logs as code in your
113 programs). Logs can optionally timestamp all input, and also store
113 programs). Logs can optionally timestamp all input, and also store
114 session output (marked as comments, so the log remains valid
114 session output (marked as comments, so the log remains valid
115 Python source code).
115 Python source code).
116
116
117 * Session restoring: logs can be replayed to restore a previous
117 * Session restoring: logs can be replayed to restore a previous
118 session to the state where you left it.
118 session to the state where you left it.
119
119
120 * Verbose and colored exception traceback printouts. Easier to parse
120 * Verbose and colored exception traceback printouts. Easier to parse
121 visually, and in verbose mode they produce a lot of useful
121 visually, and in verbose mode they produce a lot of useful
122 debugging information (basically a terminal version of the cgitb
122 debugging information (basically a terminal version of the cgitb
123 module).
123 module).
124
124
125 * Auto-parentheses via the :samp:`%autocall` command: callable objects can be
125 * Auto-parentheses via the :samp:`%autocall` command: callable objects can be
126 executed without parentheses: :samp:`sin 3` is automatically converted to
126 executed without parentheses: :samp:`sin 3` is automatically converted to
127 :samp:`sin(3)`
127 :samp:`sin(3)`
128
128
129 * Auto-quoting: using :samp:`,`, or :samp:`;` as the first character forces
129 * Auto-quoting: using :samp:`,`, or :samp:`;` as the first character forces
130 auto-quoting of the rest of the line: :samp:`,my_function a b` becomes
130 auto-quoting of the rest of the line: :samp:`,my_function a b` becomes
131 automatically :samp:`my_function("a","b")`, while :samp:`;my_function a b`
131 automatically :samp:`my_function("a","b")`, while :samp:`;my_function a b`
132 becomes :samp:`my_function("a b")`.
132 becomes :samp:`my_function("a b")`.
133
133
134 * Extensible input syntax. You can define filters that pre-process
134 * Extensible input syntax. You can define filters that pre-process
135 user input to simplify input in special situations. This allows
135 user input to simplify input in special situations. This allows
136 for example pasting multi-line code fragments which start with
136 for example pasting multi-line code fragments which start with
137 :samp:`>>>` or :samp:`...` such as those from other python sessions or the
137 :samp:`>>>` or :samp:`...` such as those from other python sessions or the
138 standard Python documentation.
138 standard Python documentation.
139
139
140 * Flexible :ref:`configuration system <config_overview>`. It uses a
140 * Flexible :ref:`configuration system <config_overview>`. It uses a
141 configuration file which allows permanent setting of all command-line
141 configuration file which allows permanent setting of all command-line
142 options, module loading, code and file execution. The system allows
142 options, module loading, code and file execution. The system allows
143 recursive file inclusion, so you can have a base file with defaults and
143 recursive file inclusion, so you can have a base file with defaults and
144 layers which load other customizations for particular projects.
144 layers which load other customizations for particular projects.
145
145
146 * Embeddable. You can call IPython as a python shell inside your own
146 * Embeddable. You can call IPython as a python shell inside your own
147 python programs. This can be used both for debugging code or for
147 python programs. This can be used both for debugging code or for
148 providing interactive abilities to your programs with knowledge
148 providing interactive abilities to your programs with knowledge
149 about the local namespaces (very useful in debugging and data
149 about the local namespaces (very useful in debugging and data
150 analysis situations).
150 analysis situations).
151
151
152 * Easy debugger access. You can set IPython to call up an enhanced version of
152 * Easy debugger access. You can set IPython to call up an enhanced version of
153 the Python debugger (pdb) every time there is an uncaught exception. This
153 the Python debugger (pdb) every time there is an uncaught exception. This
154 drops you inside the code which triggered the exception with all the data
154 drops you inside the code which triggered the exception with all the data
155 live and it is possible to navigate the stack to rapidly isolate the source
155 live and it is possible to navigate the stack to rapidly isolate the source
156 of a bug. The :samp:`%run` magic command (with the :samp:`-d` option) can run
156 of a bug. The :samp:`%run` magic command (with the :samp:`-d` option) can run
157 any script under pdb's control, automatically setting initial breakpoints for
157 any script under pdb's control, automatically setting initial breakpoints for
158 you. This version of pdb has IPython-specific improvements, including
158 you. This version of pdb has IPython-specific improvements, including
159 tab-completion and traceback coloring support. For even easier debugger
159 tab-completion and traceback coloring support. For even easier debugger
160 access, try :samp:`%debug` after seeing an exception.
160 access, try :samp:`%debug` after seeing an exception.
161
161
162 * Profiler support. You can run single statements (similar to
162 * Profiler support. You can run single statements (similar to
163 :samp:`profile.run()`) or complete programs under the profiler's control.
163 :samp:`profile.run()`) or complete programs under the profiler's control.
164 While this is possible with standard cProfile or profile modules,
164 While this is possible with standard cProfile or profile modules,
165 IPython wraps this functionality with magic commands (see :samp:`%prun`
165 IPython wraps this functionality with magic commands (see :samp:`%prun`
166 and :samp:`%run -p`) convenient for rapid interactive work.
166 and :samp:`%run -p`) convenient for rapid interactive work.
167
167
168 * Simple timing information. You can use the :samp:`%timeit` command to get
168 * Simple timing information. You can use the :samp:`%timeit` command to get
169 the execution time of a Python statement or expression. This machinery is
169 the execution time of a Python statement or expression. This machinery is
170 intelligent enough to do more repetitions for commands that finish very
170 intelligent enough to do more repetitions for commands that finish very
171 quickly in order to get a better estimate of their running time.
171 quickly in order to get a better estimate of their running time.
172
172
173 .. sourcecode:: ipython
173 .. sourcecode:: ipython
174
174
175 In [1]: %timeit 1+1
175 In [1]: %timeit 1+1
176 10000000 loops, best of 3: 25.5 ns per loop
176 10000000 loops, best of 3: 25.5 ns per loop
177
177
178 In [2]: %timeit [math.sin(x) for x in range(5000)]
178 In [2]: %timeit [math.sin(x) for x in range(5000)]
179 1000 loops, best of 3: 719 Β΅s per loop
179 1000 loops, best of 3: 719 Β΅s per loop
180
180
181 ..
181 ..
182
182
183 To get the timing information for more than one expression, use the
183 To get the timing information for more than one expression, use the
184 :samp:`%%timeit` cell magic command.
184 :samp:`%%timeit` cell magic command.
185
185
186
186
187 * Doctest support. The special :samp:`%doctest_mode` command toggles a mode
187 * Doctest support. The special :samp:`%doctest_mode` command toggles a mode
188 to use doctest-compatible prompts, so you can use IPython sessions as
188 to use doctest-compatible prompts, so you can use IPython sessions as
189 doctest code. By default, IPython also allows you to paste existing
189 doctest code. By default, IPython also allows you to paste existing
190 doctests, and strips out the leading :samp:`>>>` and :samp:`...` prompts in
190 doctests, and strips out the leading :samp:`>>>` and :samp:`...` prompts in
191 them.
191 them.
192
192
193 .. _ipythonzmq:
193 .. _ipythonzmq:
194
194
195 Decoupled two-process model
195 Decoupled two-process model
196 ==============================
196 ==============================
197
197
198 IPython has abstracted and extended the notion of a traditional
198 IPython has abstracted and extended the notion of a traditional
199 *Read-Evaluate-Print Loop* (REPL) environment by decoupling the *evaluation*
199 *Read-Evaluate-Print Loop* (REPL) environment by decoupling the *evaluation*
200 into its own process. We call this process a **kernel**: it receives execution
200 into its own process. We call this process a **kernel**: it receives execution
201 instructions from clients and communicates the results back to them.
201 instructions from clients and communicates the results back to them.
202
202
203 This decoupling allows us to have several clients connected to the same
203 This decoupling allows us to have several clients connected to the same
204 kernel, and even allows clients and kernels to live on different machines.
204 kernel, and even allows clients and kernels to live on different machines.
205 With the exclusion of the traditional single process terminal-based IPython
205 With the exclusion of the traditional single process terminal-based IPython
206 (what you start if you run ``ipython`` without any subcommands), all
206 (what you start if you run ``ipython`` without any subcommands), all
207 other IPython machinery uses this two-process model. This includes ``ipython
207 other IPython machinery uses this two-process model. This includes ``ipython
208 console``, ``ipython qtconsole``, and ``ipython notebook``.
208 console``, ``ipython qtconsole``, and ``ipython notebook``.
209
209
210 As an example, this means that when you start ``ipython qtconsole``, you're
210 As an example, this means that when you start ``ipython qtconsole``, you're
211 really starting two processes, a kernel and a Qt-based client can send
211 really starting two processes, a kernel and a Qt-based client can send
212 commands to and receive results from that kernel. If there is already a kernel
212 commands to and receive results from that kernel. If there is already a kernel
213 running that you want to connect to, you can pass the ``--existing`` flag
213 running that you want to connect to, you can pass the ``--existing`` flag
214 which will skip initiating a new kernel and connect to the most recent kernel,
214 which will skip initiating a new kernel and connect to the most recent kernel,
215 instead. To connect to a specific kernel once you have several kernels
215 instead. To connect to a specific kernel once you have several kernels
216 running, use the ``%connect_info`` magic to get the unique connection file,
216 running, use the ``%connect_info`` magic to get the unique connection file,
217 which will be something like ``--existing kernel-19732.json`` but with
217 which will be something like ``--existing kernel-19732.json`` but with
218 different numbers which correspond to the Process ID of the kernel.
218 different numbers which correspond to the Process ID of the kernel.
219
219
220 You can read more about using `ipython qtconsole
220 You can read more about using `ipython qtconsole
221 <http://jupyter.org/qtconsole/>`_, and
221 <http://jupyter.org/qtconsole/>`_, and
222 `ipython notebook <http://jupyter-notebook.readthedocs.io/en/latest/>`_. There
222 `ipython notebook <http://jupyter-notebook.readthedocs.io/en/latest/>`_. There
223 is also a :ref:`message spec <messaging>` which documents the protocol for
223 is also a :ref:`message spec <messaging>` which documents the protocol for
224 communication between kernels
224 communication between kernels
225 and clients.
225 and clients.
226
226
227 .. seealso::
227 .. seealso::
228
228
229 `Frontend/Kernel Model`_ example notebook
229 `Frontend/Kernel Model`_ example notebook
230
230
231
231
232 Interactive parallel computing
232 Interactive parallel computing
233 ==============================
233 ==============================
234
234
235 Increasingly, parallel computer hardware, such as multicore CPUs, clusters and
235 Increasingly, parallel computer hardware, such as multicore CPUs, clusters and
236 supercomputers, is becoming ubiquitous. Over the last several years, we have
236 supercomputers, is becoming ubiquitous. Over the last several years, we have
237 developed an architecture within IPython that allows such hardware to be used
237 developed an architecture within IPython that allows such hardware to be used
238 quickly and easily from Python. Moreover, this architecture is designed to
238 quickly and easily from Python. Moreover, this architecture is designed to
239 support interactive and collaborative parallel computing.
239 support interactive and collaborative parallel computing.
240
240
241 The main features of this system are:
241 The main features of this system are:
242
242
243 * Quickly parallelize Python code from an interactive Python/IPython session.
243 * Quickly parallelize Python code from an interactive Python/IPython session.
244
244
245 * A flexible and dynamic process model that be deployed on anything from
245 * A flexible and dynamic process model that be deployed on anything from
246 multicore workstations to supercomputers.
246 multicore workstations to supercomputers.
247
247
248 * An architecture that supports many different styles of parallelism, from
248 * An architecture that supports many different styles of parallelism, from
249 message passing to task farming. And all of these styles can be handled
249 message passing to task farming. And all of these styles can be handled
250 interactively.
250 interactively.
251
251
252 * Both blocking and fully asynchronous interfaces.
252 * Both blocking and fully asynchronous interfaces.
253
253
254 * High level APIs that enable many things to be parallelized in a few lines
254 * High level APIs that enable many things to be parallelized in a few lines
255 of code.
255 of code.
256
256
257 * Write parallel code that will run unchanged on everything from multicore
257 * Write parallel code that will run unchanged on everything from multicore
258 workstations to supercomputers.
258 workstations to supercomputers.
259
259
260 * Full integration with Message Passing libraries (MPI).
260 * Full integration with Message Passing libraries (MPI).
261
261
262 * Capabilities based security model with full encryption of network connections.
262 * Capabilities based security model with full encryption of network connections.
263
263
264 * Share live parallel jobs with other users securely. We call this
264 * Share live parallel jobs with other users securely. We call this
265 collaborative parallel computing.
265 collaborative parallel computing.
266
266
267 * Dynamically load balanced task farming system.
267 * Dynamically load balanced task farming system.
268
268
269 * Robust error handling. Python exceptions raised in parallel execution are
269 * Robust error handling. Python exceptions raised in parallel execution are
270 gathered and presented to the top-level code.
270 gathered and presented to the top-level code.
271
271
272 For more information, see our :ref:`overview <parallel_index>` of using IPython
272 For more information, see our :ref:`overview <parallel_index>` of using IPython
273 for parallel computing.
273 for parallel computing.
274
274
275 Portability and Python requirements
275 Portability and Python requirements
276 -----------------------------------
276 -----------------------------------
277
277
278 As of the 2.0 release, IPython works with Python 2.7 and 3.3 or above.
278 As of the 2.0 release, IPython works with Python 2.7 and 3.3 or above.
279 Version 1.0 additionally worked with Python 2.6 and 3.2.
279 Version 1.0 additionally worked with Python 2.6 and 3.2.
280 Version 0.12 was the first version to fully support Python 3.
280 Version 0.12 was the first version to fully support Python 3.
281
281
282 IPython is known to work on the following operating systems:
282 IPython is known to work on the following operating systems:
283
283
284 * Linux
284 * Linux
285 * Most other Unix-like OSs (AIX, Solaris, BSD, etc.)
285 * Most other Unix-like OSs (AIX, Solaris, BSD, etc.)
286 * Mac OS X
286 * Mac OS X
287 * Windows (CygWin, XP, Vista, etc.)
287 * Windows (CygWin, XP, Vista, etc.)
288
288
289 See :ref:`here <install_index>` for instructions on how to install IPython.
289 See :ref:`here <install_index>` for instructions on how to install IPython.
290
290
291 .. include:: links.txt
291 .. include:: links.txt
@@ -1,370 +1,369 b''
1 =============
1 =============
2 0.12 Series
2 0.12 Series
3 =============
3 =============
4
4
5 Release 0.12.1
5 Release 0.12.1
6 ==============
6 ==============
7
7
8 IPython 0.12.1 is a bugfix release of 0.12, pulling only bugfixes and minor
8 IPython 0.12.1 is a bugfix release of 0.12, pulling only bugfixes and minor
9 cleanup from 0.13, timed for the Ubuntu 12.04 LTS release.
9 cleanup from 0.13, timed for the Ubuntu 12.04 LTS release.
10
10
11 See the :ref:`list of fixed issues <issues_list_012>` for specific backported issues.
11 See the :ref:`list of fixed issues <issues_list_012>` for specific backported issues.
12
12
13
13
14 Release 0.12
14 Release 0.12
15 ============
15 ============
16
16
17 IPython 0.12 contains several major new features, as well as a large amount of
17 IPython 0.12 contains several major new features, as well as a large amount of
18 bug and regression fixes. The 0.11 release brought with it a lot of new
18 bug and regression fixes. The 0.11 release brought with it a lot of new
19 functionality and major refactorings of the codebase; by and large this has
19 functionality and major refactorings of the codebase; by and large this has
20 proven to be a success as the number of contributions to the project has
20 proven to be a success as the number of contributions to the project has
21 increased dramatically, proving that the code is now much more approachable.
21 increased dramatically, proving that the code is now much more approachable.
22 But in the refactoring inevitably some bugs were introduced, and we have also
22 But in the refactoring inevitably some bugs were introduced, and we have also
23 squashed many of those as well as recovered some functionality that had been
23 squashed many of those as well as recovered some functionality that had been
24 temporarily disabled due to the API changes.
24 temporarily disabled due to the API changes.
25
25
26 The following major new features appear in this version.
26 The following major new features appear in this version.
27
27
28
28
29 An interactive browser-based Notebook with rich media support
29 An interactive browser-based Notebook with rich media support
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31
31
32 A powerful new interface puts IPython in your browser. You can start it with
32 A powerful new interface puts IPython in your browser. You can start it with
33 the command ``ipython notebook``:
33 the command ``ipython notebook``:
34
34
35 .. figure:: ../_images/notebook_specgram.png
35 .. figure:: ../_images/notebook_specgram.png
36 :width: 400px
36 :width: 400px
37 :alt: The IPython notebook with embedded text, code, math and figures.
37 :alt: The IPython notebook with embedded text, code, math and figures.
38 :align: center
38 :align: center
39 :target: ../_images/notebook_specgram.png
39 :target: ../_images/notebook_specgram.png
40
40
41 The new IPython notebook showing text, mathematical expressions in LaTeX,
41 The new IPython notebook showing text, mathematical expressions in LaTeX,
42 code, results and embedded figures created with Matplotlib.
42 code, results and embedded figures created with Matplotlib.
43
43
44 This new interface maintains all the features of IPython you are used to, as it
44 This new interface maintains all the features of IPython you are used to, as it
45 is a new client that communicates with the same IPython kernels used by the
45 is a new client that communicates with the same IPython kernels used by the
46 terminal and Qt console. But the web notebook provides for a different
46 terminal and Qt console. But the web notebook provides for a different
47 workflow where you can integrate, along with code execution, also text,
47 workflow where you can integrate, along with code execution, also text,
48 mathematical expressions, graphics, video, and virtually any content that a
48 mathematical expressions, graphics, video, and virtually any content that a
49 modern browser is capable of displaying.
49 modern browser is capable of displaying.
50
50
51 You can save your work sessions as documents that retain all these elements and
51 You can save your work sessions as documents that retain all these elements and
52 which can be version controlled, emailed to colleagues or saved as HTML or PDF
52 which can be version controlled, emailed to colleagues or saved as HTML or PDF
53 files for printing or publishing statically on the web. The internal storage
53 files for printing or publishing statically on the web. The internal storage
54 format is a JSON file that can be easily manipulated for manual exporting to
54 format is a JSON file that can be easily manipulated for manual exporting to
55 other formats.
55 other formats.
56
56
57 This Notebook is a major milestone for IPython, as for years we have tried to
57 This Notebook is a major milestone for IPython, as for years we have tried to
58 build this kind of system. We were inspired originally by the excellent
58 build this kind of system. We were inspired originally by the excellent
59 implementation in Mathematica, we made a number of attempts using older
59 implementation in Mathematica, we made a number of attempts using older
60 technologies in earlier Summer of Code projects in 2005 (both students and
60 technologies in earlier Summer of Code projects in 2005 (both students and
61 Robert Kern developed early prototypes), and in recent years we have seen the
61 Robert Kern developed early prototypes), and in recent years we have seen the
62 excellent implementation offered by the `Sage <http://sagemath.org>` system.
62 excellent implementation offered by the `Sage <http://sagemath.org>` system.
63 But we continued to work on something that would be consistent with the rest of
63 But we continued to work on something that would be consistent with the rest of
64 IPython's design, and it is clear now that the effort was worth it: based on
64 IPython's design, and it is clear now that the effort was worth it: based on
65 the ZeroMQ communications architecture introduced in version 0.11, the notebook
65 the ZeroMQ communications architecture introduced in version 0.11, the notebook
66 can now retain 100% of the features of the real IPython. But it can also
66 can now retain 100% of the features of the real IPython. But it can also
67 provide the rich media support and high quality Javascript libraries that were
67 provide the rich media support and high quality Javascript libraries that were
68 not available in browsers even one or two years ago (such as high-quality
68 not available in browsers even one or two years ago (such as high-quality
69 mathematical rendering or built-in video).
69 mathematical rendering or built-in video).
70
70
71 The notebook has too many useful and important features to describe in these
71 The notebook has too many useful and important features to describe in these
72 release notes; our documentation now contains a directory called
72 release notes; our documentation now contains a directory called
73 ``examples/notebooks`` with several notebooks that illustrate various aspects
73 ``examples/notebooks`` with several notebooks that illustrate various aspects
74 of the system. You should start by reading those named
74 of the system. You should start by reading those named
75 ``00_notebook_tour.ipynb`` and ``01_notebook_introduction.ipynb`` first, and
75 ``00_notebook_tour.ipynb`` and ``01_notebook_introduction.ipynb`` first, and
76 then can proceed to read the others in any order you want.
76 then can proceed to read the others in any order you want.
77
77
78 To start the notebook server, go to a directory containing the notebooks you
78 To start the notebook server, go to a directory containing the notebooks you
79 want to open (or where you want to create new ones) and type::
79 want to open (or where you want to create new ones) and type::
80
80
81 ipython notebook
81 ipython notebook
82
82
83 You can see all the relevant options with::
83 You can see all the relevant options with::
84
84
85 ipython notebook --help
85 ipython notebook --help
86 ipython notebook --help-all # even more
86 ipython notebook --help-all # even more
87
87
88 and just like the Qt console, you can start the notebook server with pylab
88 and just like the Qt console, you can start the notebook server with pylab
89 support by using::
89 support by using::
90
90
91 ipython notebook --pylab
91 ipython notebook --pylab
92
92
93 for floating matplotlib windows or::
93 for floating matplotlib windows or::
94
94
95 ipython notebook --pylab inline
95 ipython notebook --pylab inline
96
96
97 for plotting support with automatically inlined figures. Note that it is now
97 for plotting support with automatically inlined figures. Note that it is now
98 possible also to activate pylab support at runtime via ``%pylab``, so you do
98 possible also to activate pylab support at runtime via ``%pylab``, so you do
99 not need to make this decision when starting the server.
99 not need to make this decision when starting the server.
100
100
101 See :ref:`the Notebook docs <htmlnotebook>` for technical details.
102
101
103 .. _two_process_console:
102 .. _two_process_console:
104
103
105 Two-process terminal console
104 Two-process terminal console
106 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107
106
108 Based on the same architecture as the notebook and the Qt console, we also have
107 Based on the same architecture as the notebook and the Qt console, we also have
109 now a terminal-based console that can connect to an external IPython kernel
108 now a terminal-based console that can connect to an external IPython kernel
110 (the same kernels used by the Qt console or the notebook, in fact). While this
109 (the same kernels used by the Qt console or the notebook, in fact). While this
111 client behaves almost identically to the usual IPython terminal application,
110 client behaves almost identically to the usual IPython terminal application,
112 this capability can be very useful to attach an interactive console to an
111 this capability can be very useful to attach an interactive console to an
113 existing kernel that was started externally. It lets you use the interactive
112 existing kernel that was started externally. It lets you use the interactive
114 ``%debug`` facilities in a notebook, for example (the web browser can't
113 ``%debug`` facilities in a notebook, for example (the web browser can't
115 interact directly with the debugger) or debug a third-party code where you may
114 interact directly with the debugger) or debug a third-party code where you may
116 have embedded an IPython kernel.
115 have embedded an IPython kernel.
117
116
118 This is also something that we have wanted for a long time, and which is a
117 This is also something that we have wanted for a long time, and which is a
119 culmination (as a team effort) of the work started last year during the 2010
118 culmination (as a team effort) of the work started last year during the 2010
120 Google Summer of Code project.
119 Google Summer of Code project.
121
120
122 Tabbed QtConsole
121 Tabbed QtConsole
123 ~~~~~~~~~~~~~~~~
122 ~~~~~~~~~~~~~~~~
124
123
125 The QtConsole now supports starting multiple kernels in tabs, and has a
124 The QtConsole now supports starting multiple kernels in tabs, and has a
126 menubar, so it looks and behaves more like a real application. Keyboard
125 menubar, so it looks and behaves more like a real application. Keyboard
127 enthusiasts can disable the menubar with ctrl-shift-M (:ghpull:`887`).
126 enthusiasts can disable the menubar with ctrl-shift-M (:ghpull:`887`).
128
127
129 .. figure:: ../_images/qtconsole_tabbed.png
128 .. figure:: ../_images/qtconsole_tabbed.png
130 :width: 400px
129 :width: 400px
131 :alt: Tabbed IPython Qt console with embedded plots and menus.
130 :alt: Tabbed IPython Qt console with embedded plots and menus.
132 :align: center
131 :align: center
133 :target: ../_images/qtconsole_tabbed.png
132 :target: ../_images/qtconsole_tabbed.png
134
133
135 The improved Qt console for IPython, now with tabs to control multiple
134 The improved Qt console for IPython, now with tabs to control multiple
136 kernels and full menu support.
135 kernels and full menu support.
137
136
138
137
139 Full Python 3 compatibility
138 Full Python 3 compatibility
140 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
139 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
141
140
142 IPython can now be installed from a single codebase on Python 2 and
141 IPython can now be installed from a single codebase on Python 2 and
143 Python 3. The installation process for Python 3 automatically runs 2to3. The
142 Python 3. The installation process for Python 3 automatically runs 2to3. The
144 same 'default' profile is now used for Python 2 and 3 (the previous version had
143 same 'default' profile is now used for Python 2 and 3 (the previous version had
145 a separate 'python3' profile).
144 a separate 'python3' profile).
146
145
147 Standalone Kernel
146 Standalone Kernel
148 ~~~~~~~~~~~~~~~~~
147 ~~~~~~~~~~~~~~~~~
149
148
150 The ``ipython kernel`` subcommand has been added, to allow starting a
149 The ``ipython kernel`` subcommand has been added, to allow starting a
151 standalone kernel, that can be used with various frontends. You can then later
150 standalone kernel, that can be used with various frontends. You can then later
152 connect a Qt console or a terminal console to this kernel by typing e.g.::
151 connect a Qt console or a terminal console to this kernel by typing e.g.::
153
152
154 ipython qtconsole --existing
153 ipython qtconsole --existing
155
154
156 if it's the only one running, or by passing explicitly the connection
155 if it's the only one running, or by passing explicitly the connection
157 parameters (printed by the kernel at startup).
156 parameters (printed by the kernel at startup).
158
157
159
158
160 PyPy support
159 PyPy support
161 ~~~~~~~~~~~~
160 ~~~~~~~~~~~~
162
161
163 The terminal interface to IPython now runs under `PyPy <http://pypy.org/>`_.
162 The terminal interface to IPython now runs under `PyPy <http://pypy.org/>`_.
164 We will continue to monitor PyPy's progress, and hopefully before long at least
163 We will continue to monitor PyPy's progress, and hopefully before long at least
165 we'll be able to also run the notebook. The Qt console may take longer, as Qt
164 we'll be able to also run the notebook. The Qt console may take longer, as Qt
166 is a very complex set of bindings to a huge C++ library, and that is currently
165 is a very complex set of bindings to a huge C++ library, and that is currently
167 the area where PyPy still lags most behind. But for everyday interactive use
166 the area where PyPy still lags most behind. But for everyday interactive use
168 at the terminal, with this release and PyPy 1.7, things seem to work quite well
167 at the terminal, with this release and PyPy 1.7, things seem to work quite well
169 from our admittedly limited testing.
168 from our admittedly limited testing.
170
169
171
170
172 Other important new features
171 Other important new features
173 ----------------------------
172 ----------------------------
174
173
175 * **SSH Tunnels**: In 0.11, the :mod:`IPython.parallel` Client could tunnel its
174 * **SSH Tunnels**: In 0.11, the :mod:`IPython.parallel` Client could tunnel its
176 connections to the Controller via ssh. Now, the QtConsole :ref:`supports
175 connections to the Controller via ssh. Now, the QtConsole supports ssh tunneling,
177 <ssh_tunnels>` ssh tunneling, as do parallel engines.
176 as do parallel engines.
178
177
179 * **relaxed command-line parsing**: 0.11 was released with overly-strict
178 * **relaxed command-line parsing**: 0.11 was released with overly-strict
180 command-line parsing, preventing the ability to specify arguments with spaces,
179 command-line parsing, preventing the ability to specify arguments with spaces,
181 e.g. ``ipython --pylab qt`` or ``ipython -c "print 'hi'"``. This has
180 e.g. ``ipython --pylab qt`` or ``ipython -c "print 'hi'"``. This has
182 been fixed, by using argparse. The new parsing is a strict superset of 0.11, so
181 been fixed, by using argparse. The new parsing is a strict superset of 0.11, so
183 any commands in 0.11 should still work in 0.12.
182 any commands in 0.11 should still work in 0.12.
184
183
185 * **HistoryAccessor**: The :class:`~IPython.core.history.HistoryManager` class
184 * **HistoryAccessor**: The :class:`~IPython.core.history.HistoryManager` class
186 for interacting with your IPython SQLite history database has been split,
185 for interacting with your IPython SQLite history database has been split,
187 adding a parent :class:`~IPython.core.history.HistoryAccessor` class, so that
186 adding a parent :class:`~IPython.core.history.HistoryAccessor` class, so that
188 users can write code to access and search their IPython history without being
187 users can write code to access and search their IPython history without being
189 in an IPython session (:ghpull:`824`).
188 in an IPython session (:ghpull:`824`).
190
189
191 * **kernel %gui and %pylab**: The ``%gui`` and ``%pylab`` magics have been
190 * **kernel %gui and %pylab**: The ``%gui`` and ``%pylab`` magics have been
192 restored to the IPython kernel (e.g. in the qtconsole or notebook). This
191 restored to the IPython kernel (e.g. in the qtconsole or notebook). This
193 allows activation of pylab-mode, or eventloop integration after starting the
192 allows activation of pylab-mode, or eventloop integration after starting the
194 kernel, which was unavailable in 0.11. Unlike in the terminal, this can be
193 kernel, which was unavailable in 0.11. Unlike in the terminal, this can be
195 set only once, and cannot be changed.
194 set only once, and cannot be changed.
196
195
197 * **%config**: A new ``%config`` magic has been added, giving easy access to the
196 * **%config**: A new ``%config`` magic has been added, giving easy access to the
198 IPython configuration system at runtime (:ghpull:`923`).
197 IPython configuration system at runtime (:ghpull:`923`).
199
198
200 * **Multiline History**: Multiline readline history has been restored to the
199 * **Multiline History**: Multiline readline history has been restored to the
201 Terminal frontend by default (:ghpull:`838`).
200 Terminal frontend by default (:ghpull:`838`).
202
201
203 * **%store**: The ``%store`` magic from earlier versions has been updated and
202 * **%store**: The ``%store`` magic from earlier versions has been updated and
204 re-enabled (:ref:`extensions_storemagic`; :ghpull:`1029`). To autorestore
203 re-enabled (:ref:`extensions_storemagic`; :ghpull:`1029`). To autorestore
205 stored variables on startup, specify ``c.StoreMagic.autorestore = True`` in
204 stored variables on startup, specify ``c.StoreMagic.autorestore = True`` in
206 :file:`ipython_config.py`.
205 :file:`ipython_config.py`.
207
206
208
207
209 Major Bugs fixed
208 Major Bugs fixed
210 ----------------
209 ----------------
211
210
212 In this cycle, we have :ref:`closed over 500 issues <issues_list_012>`, but a
211 In this cycle, we have :ref:`closed over 500 issues <issues_list_012>`, but a
213 few major ones merit special mention:
212 few major ones merit special mention:
214
213
215 * Simple configuration errors should no longer crash IPython. In 0.11, errors
214 * Simple configuration errors should no longer crash IPython. In 0.11, errors
216 in config files, as well as invalid trait values, could crash IPython. Now,
215 in config files, as well as invalid trait values, could crash IPython. Now,
217 such errors are reported, and help is displayed.
216 such errors are reported, and help is displayed.
218
217
219 * Certain SyntaxErrors no longer crash IPython (e.g. just typing keywords, such
218 * Certain SyntaxErrors no longer crash IPython (e.g. just typing keywords, such
220 as ``return``, ``break``, etc.). See :ghissue:`704`.
219 as ``return``, ``break``, etc.). See :ghissue:`704`.
221
220
222 * IPython path utils, such as :func:`~IPython.utils.path.get_ipython_dir` now
221 * IPython path utils, such as :func:`~IPython.utils.path.get_ipython_dir` now
223 check for write permissions, so IPython should function on systems where the
222 check for write permissions, so IPython should function on systems where the
224 default path resolution might point to a read-only location, such as
223 default path resolution might point to a read-only location, such as
225 ``HOMESHARE`` on Windows (:ghissue:`669`).
224 ``HOMESHARE`` on Windows (:ghissue:`669`).
226
225
227 * :func:`raw_input` now works in the kernel when multiple frontends are in
226 * :func:`raw_input` now works in the kernel when multiple frontends are in
228 use. The request will be sent to the frontend that made the request, and an
227 use. The request will be sent to the frontend that made the request, and an
229 exception is raised if that frontend does not support stdin requests
228 exception is raised if that frontend does not support stdin requests
230 (e.g. the notebook) (:ghissue:`673`).
229 (e.g. the notebook) (:ghissue:`673`).
231
230
232 * :mod:`zmq` version detection no longer uses simple lexicographical comparison
231 * :mod:`zmq` version detection no longer uses simple lexicographical comparison
233 to check minimum version, which prevents 0.11 from working with pyzmq-2.1.10
232 to check minimum version, which prevents 0.11 from working with pyzmq-2.1.10
234 (:ghpull:`758`).
233 (:ghpull:`758`).
235
234
236 * A bug in PySide < 1.0.7 caused crashes on OSX when tooltips were shown
235 * A bug in PySide < 1.0.7 caused crashes on OSX when tooltips were shown
237 (:ghissue:`711`). these tooltips are now disabled on old PySide
236 (:ghissue:`711`). these tooltips are now disabled on old PySide
238 (:ghpull:`963`).
237 (:ghpull:`963`).
239
238
240 * IPython no longer crashes when started on recent versions of Python 3 in
239 * IPython no longer crashes when started on recent versions of Python 3 in
241 Windows (:ghissue:`737`).
240 Windows (:ghissue:`737`).
242
241
243 * Instances of classes defined interactively can now be pickled (:ghissue:`29`;
242 * Instances of classes defined interactively can now be pickled (:ghissue:`29`;
244 :ghpull:`648`). Note that pickling saves a reference to the class definition,
243 :ghpull:`648`). Note that pickling saves a reference to the class definition,
245 so unpickling the instances will only work where the class has been defined.
244 so unpickling the instances will only work where the class has been defined.
246
245
247
246
248 Backwards incompatible changes
247 Backwards incompatible changes
249 ------------------------------
248 ------------------------------
250
249
251 * IPython connection information is no longer specified via ip/port directly,
250 * IPython connection information is no longer specified via ip/port directly,
252 rather via json connection files. These files are stored in the security
251 rather via json connection files. These files are stored in the security
253 directory, and enable us to turn on HMAC message authentication by default,
252 directory, and enable us to turn on HMAC message authentication by default,
254 significantly improving the security of kernels. Various utility functions
253 significantly improving the security of kernels. Various utility functions
255 have been added to :mod:`IPython.lib.kernel`, for easier connecting to existing
254 have been added to :mod:`IPython.lib.kernel`, for easier connecting to existing
256 kernels.
255 kernels.
257
256
258 * :class:`~IPython.zmq.kernelmanager.KernelManager` now has one ip, and several
257 * :class:`~IPython.zmq.kernelmanager.KernelManager` now has one ip, and several
259 port traits, rather than several ip/port pair ``_addr`` traits. This better
258 port traits, rather than several ip/port pair ``_addr`` traits. This better
260 matches the rest of the code, where the ip cannot not be set separately for
259 matches the rest of the code, where the ip cannot not be set separately for
261 each channel.
260 each channel.
262
261
263 * Custom prompts are now configured using a new class,
262 * Custom prompts are now configured using a new class,
264 :class:`~IPython.core.prompts.PromptManager`, which has traits for
263 :class:`~IPython.core.prompts.PromptManager`, which has traits for
265 :attr:`in_template`, :attr:`in2_template` (the ``...:`` continuation prompt),
264 :attr:`in_template`, :attr:`in2_template` (the ``...:`` continuation prompt),
266 :attr:`out_template` and :attr:`rewrite_template`. This uses Python's string
265 :attr:`out_template` and :attr:`rewrite_template`. This uses Python's string
267 formatting system, so you can use ``{time}`` and ``{cwd}``, although we have
266 formatting system, so you can use ``{time}`` and ``{cwd}``, although we have
268 preserved the abbreviations from previous versions, e.g. ``\#`` (prompt number)
267 preserved the abbreviations from previous versions, e.g. ``\#`` (prompt number)
269 and ``\w`` (working directory). For the list of available fields, refer to the
268 and ``\w`` (working directory). For the list of available fields, refer to the
270 source of :file:`IPython/core/prompts.py`.
269 source of :file:`IPython/core/prompts.py`.
271
270
272 * The class inheritance of the Launchers in
271 * The class inheritance of the Launchers in
273 :mod:`IPython.parallel.apps.launcher` used by ipcluster has changed, so that
272 :mod:`IPython.parallel.apps.launcher` used by ipcluster has changed, so that
274 trait names are more consistent across batch systems. This may require a few
273 trait names are more consistent across batch systems. This may require a few
275 renames in your config files, if you customized the command-line args for
274 renames in your config files, if you customized the command-line args for
276 launching controllers and engines. The configurable names have also been
275 launching controllers and engines. The configurable names have also been
277 changed to be clearer that they point to class names, and can now be
276 changed to be clearer that they point to class names, and can now be
278 specified by name only, rather than requiring the full import path of each
277 specified by name only, rather than requiring the full import path of each
279 class, e.g.::
278 class, e.g.::
280
279
281 IPClusterEngines.engine_launcher = 'IPython.parallel.apps.launcher.MPIExecEngineSetLauncher'
280 IPClusterEngines.engine_launcher = 'IPython.parallel.apps.launcher.MPIExecEngineSetLauncher'
282 IPClusterStart.controller_launcher = 'IPython.parallel.apps.launcher.SSHControllerLauncher'
281 IPClusterStart.controller_launcher = 'IPython.parallel.apps.launcher.SSHControllerLauncher'
283
282
284 would now be specified as::
283 would now be specified as::
285
284
286 IPClusterEngines.engine_launcher_class = 'MPI'
285 IPClusterEngines.engine_launcher_class = 'MPI'
287 IPClusterStart.controller_launcher_class = 'SSH'
286 IPClusterStart.controller_launcher_class = 'SSH'
288
287
289 The full path will still work, and is necessary for using custom launchers
288 The full path will still work, and is necessary for using custom launchers
290 not in IPython's launcher module.
289 not in IPython's launcher module.
291
290
292 Further, MPIExec launcher names are now prefixed with just MPI, to better match
291 Further, MPIExec launcher names are now prefixed with just MPI, to better match
293 other batch launchers, and be generally more intuitive. The MPIExec names are
292 other batch launchers, and be generally more intuitive. The MPIExec names are
294 deprecated, but continue to work.
293 deprecated, but continue to work.
295
294
296 * For embedding a shell, note that the parameters ``user_global_ns`` and
295 * For embedding a shell, note that the parameters ``user_global_ns`` and
297 ``global_ns`` have been deprectated in favour of ``user_module`` and
296 ``global_ns`` have been deprectated in favour of ``user_module`` and
298 ``module`` respsectively. The new parameters expect a module-like object,
297 ``module`` respsectively. The new parameters expect a module-like object,
299 rather than a namespace dict. The old parameters remain for backwards
298 rather than a namespace dict. The old parameters remain for backwards
300 compatibility, although ``user_global_ns`` is now ignored. The ``user_ns``
299 compatibility, although ``user_global_ns`` is now ignored. The ``user_ns``
301 parameter works the same way as before, and calling
300 parameter works the same way as before, and calling
302 :func:`~IPython.frontend.terminal.embed.embed` with no arguments still works
301 :func:`~IPython.frontend.terminal.embed.embed` with no arguments still works
303 as before.
302 as before.
304
303
305
304
306 Development summary and credits
305 Development summary and credits
307 -------------------------------
306 -------------------------------
308
307
309 The previous version (IPython 0.11) was released on July 31 2011, so this
308 The previous version (IPython 0.11) was released on July 31 2011, so this
310 release cycle was roughly 4 1/2 months long, we closed a total of 515 issues,
309 release cycle was roughly 4 1/2 months long, we closed a total of 515 issues,
311 257 pull requests and 258 regular issues (a :ref:`detailed list
310 257 pull requests and 258 regular issues (a :ref:`detailed list
312 <issues_list_012>` is available).
311 <issues_list_012>` is available).
313
312
314 Many users and developers contributed code, features, bug reports and ideas to
313 Many users and developers contributed code, features, bug reports and ideas to
315 this release. Please do not hesitate in contacting us if we've failed to
314 this release. Please do not hesitate in contacting us if we've failed to
316 acknowledge your contribution here. In particular, for this release we have
315 acknowledge your contribution here. In particular, for this release we have
317 had commits from the following 45 contributors, a mix of new and regular names
316 had commits from the following 45 contributors, a mix of new and regular names
318 (in alphabetical order by first name):
317 (in alphabetical order by first name):
319
318
320 * Alcides <alcides-at-do-not-span-me.com>
319 * Alcides <alcides-at-do-not-span-me.com>
321 * Ben Edwards <bedwards-at-cs.unm.edu>
320 * Ben Edwards <bedwards-at-cs.unm.edu>
322 * Benjamin Ragan-Kelley <benjaminrk-at-gmail.com>
321 * Benjamin Ragan-Kelley <benjaminrk-at-gmail.com>
323 * Benjamin Thyreau <benjamin.thyreau-at-gmail.com>
322 * Benjamin Thyreau <benjamin.thyreau-at-gmail.com>
324 * Bernardo B. Marques <bernardo.fire-at-gmail.com>
323 * Bernardo B. Marques <bernardo.fire-at-gmail.com>
325 * Bernard Paulus <bprecyclebin-at-gmail.com>
324 * Bernard Paulus <bprecyclebin-at-gmail.com>
326 * Bradley M. Froehle <brad.froehle-at-gmail.com>
325 * Bradley M. Froehle <brad.froehle-at-gmail.com>
327 * Brian E. Granger <ellisonbg-at-gmail.com>
326 * Brian E. Granger <ellisonbg-at-gmail.com>
328 * Christian Boos <cboos-at-bct-technology.com>
327 * Christian Boos <cboos-at-bct-technology.com>
329 * Daniel Velkov <danielv-at-mylife.com>
328 * Daniel Velkov <danielv-at-mylife.com>
330 * Erik Tollerud <erik.tollerud-at-gmail.com>
329 * Erik Tollerud <erik.tollerud-at-gmail.com>
331 * Evan Patterson <epatters-at-enthought.com>
330 * Evan Patterson <epatters-at-enthought.com>
332 * Felix Werner <Felix.Werner-at-kit.edu>
331 * Felix Werner <Felix.Werner-at-kit.edu>
333 * Fernando Perez <Fernando.Perez-at-berkeley.edu>
332 * Fernando Perez <Fernando.Perez-at-berkeley.edu>
334 * Gabriel <g2p.code-at-gmail.com>
333 * Gabriel <g2p.code-at-gmail.com>
335 * Grahame Bowland <grahame-at-angrygoats.net>
334 * Grahame Bowland <grahame-at-angrygoats.net>
336 * Hannes Schulz <schulz-at-ais.uni-bonn.de>
335 * Hannes Schulz <schulz-at-ais.uni-bonn.de>
337 * Jens Hedegaard Nielsen <jenshnielsen-at-gmail.com>
336 * Jens Hedegaard Nielsen <jenshnielsen-at-gmail.com>
338 * Jonathan March <jmarch-at-enthought.com>
337 * Jonathan March <jmarch-at-enthought.com>
339 * JΓΆrgen Stenarson <jorgen.stenarson-at-bostream.nu>
338 * JΓΆrgen Stenarson <jorgen.stenarson-at-bostream.nu>
340 * Julian Taylor <jtaylor.debian-at-googlemail.com>
339 * Julian Taylor <jtaylor.debian-at-googlemail.com>
341 * Kefu Chai <tchaikov-at-gmail.com>
340 * Kefu Chai <tchaikov-at-gmail.com>
342 * macgyver <neil.rabinowitz-at-merton.ox.ac.uk>
341 * macgyver <neil.rabinowitz-at-merton.ox.ac.uk>
343 * Matt Cottingham <matt.cottingham-at-gmail.com>
342 * Matt Cottingham <matt.cottingham-at-gmail.com>
344 * Matthew Brett <matthew.brett-at-gmail.com>
343 * Matthew Brett <matthew.brett-at-gmail.com>
345 * Matthias BUSSONNIER <bussonniermatthias-at-gmail.com>
344 * Matthias BUSSONNIER <bussonniermatthias-at-gmail.com>
346 * Michael Droettboom <mdboom-at-gmail.com>
345 * Michael Droettboom <mdboom-at-gmail.com>
347 * Nicolas Rougier <Nicolas.Rougier-at-inria.fr>
346 * Nicolas Rougier <Nicolas.Rougier-at-inria.fr>
348 * Olivier Verdier <olivier.verdier-at-gmail.com>
347 * Olivier Verdier <olivier.verdier-at-gmail.com>
349 * Omar Andres Zapata Mesa <andresete.chaos-at-gmail.com>
348 * Omar Andres Zapata Mesa <andresete.chaos-at-gmail.com>
350 * Pablo Winant <pablo.winant-at-gmail.com>
349 * Pablo Winant <pablo.winant-at-gmail.com>
351 * Paul Ivanov <pivanov314-at-gmail.com>
350 * Paul Ivanov <pivanov314-at-gmail.com>
352 * Pauli Virtanen <pav-at-iki.fi>
351 * Pauli Virtanen <pav-at-iki.fi>
353 * Pete Aykroyd <aykroyd-at-gmail.com>
352 * Pete Aykroyd <aykroyd-at-gmail.com>
354 * Prabhu Ramachandran <prabhu-at-enthought.com>
353 * Prabhu Ramachandran <prabhu-at-enthought.com>
355 * Puneeth Chaganti <punchagan-at-gmail.com>
354 * Puneeth Chaganti <punchagan-at-gmail.com>
356 * Robert Kern <robert.kern-at-gmail.com>
355 * Robert Kern <robert.kern-at-gmail.com>
357 * Satrajit Ghosh <satra-at-mit.edu>
356 * Satrajit Ghosh <satra-at-mit.edu>
358 * Stefan van der Walt <stefan-at-sun.ac.za>
357 * Stefan van der Walt <stefan-at-sun.ac.za>
359 * Szabolcs HorvΓ‘t <szhorvat-at-gmail.com>
358 * Szabolcs HorvΓ‘t <szhorvat-at-gmail.com>
360 * Thomas Kluyver <takowl-at-gmail.com>
359 * Thomas Kluyver <takowl-at-gmail.com>
361 * Thomas Spura <thomas.spura-at-gmail.com>
360 * Thomas Spura <thomas.spura-at-gmail.com>
362 * Timo Paulssen <timonator-at-perpetuum-immobile.de>
361 * Timo Paulssen <timonator-at-perpetuum-immobile.de>
363 * Valentin Haenel <valentin.haenel-at-gmx.de>
362 * Valentin Haenel <valentin.haenel-at-gmx.de>
364 * Yaroslav Halchenko <debian-at-onerussian.com>
363 * Yaroslav Halchenko <debian-at-onerussian.com>
365
364
366 .. note::
365 .. note::
367
366
368 This list was generated with the output of
367 This list was generated with the output of
369 ``git log rel-0.11..HEAD --format='* %aN <%aE>' | sed 's/@/\-at\-/' | sed 's/<>//' | sort -u``
368 ``git log rel-0.11..HEAD --format='* %aN <%aE>' | sed 's/@/\-at\-/' | sed 's/<>//' | sort -u``
370 after some cleanup. If you should be on this list, please add yourself.
369 after some cleanup. If you should be on this list, please add yourself.
@@ -1,306 +1,302 b''
1 ============
1 ============
2 1.0 Series
2 1.0 Series
3 ============
3 ============
4
4
5 Release 1.0.0: An Afternoon Hack
5 Release 1.0.0: An Afternoon Hack
6 ================================
6 ================================
7
7
8
8
9 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.
10 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.
11
11
12 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`,
13 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.
14
14
15 The previous version (0.13) was released on June 30, 2012,
15 The previous version (0.13) was released on June 30, 2012,
16 and in this development cycle we had:
16 and in this development cycle we had:
17
17
18 - ~12 months of work.
18 - ~12 months of work.
19 - ~700 pull requests merged.
19 - ~700 pull requests merged.
20 - ~600 issues closed (non-pull requests).
20 - ~600 issues closed (non-pull requests).
21 - contributions from ~150 authors.
21 - contributions from ~150 authors.
22 - ~4000 commits.
22 - ~4000 commits.
23
23
24 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
25 here the main highlights; please see our :ref:`detailed release statistics
25 here the main highlights; please see our :ref:`detailed release statistics
26 <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
27 as well as a full list of individual contributors.
27 as well as a full list of individual contributors.
28 It includes
28 It includes
29
29
30 Reorganization
30 Reorganization
31 --------------
31 --------------
32
32
33 There have been two major reorganizations in IPython 1.0:
33 There have been two major reorganizations in IPython 1.0:
34
34
35 - Added :mod:`IPython.kernel` for all kernel-related code.
35 - Added :mod:`IPython.kernel` for all kernel-related code.
36 This means that :mod:`IPython.zmq` has been removed,
36 This means that :mod:`IPython.zmq` has been removed,
37 and much of it is now in :mod:`IPython.kernel.zmq`,
37 and much of it is now in :mod:`IPython.kernel.zmq`,
38 some of it being in the top-level :mod:`IPython.kernel`.
38 some of it being in the top-level :mod:`IPython.kernel`.
39 - We have removed the `frontend` subpackage,
39 - We have removed the `frontend` subpackage,
40 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`
41 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
42 the notebook has been further flattened, so that
42 the notebook has been further flattened, so that
43 :mod:`IPython.frontend.html.notebook` is now just `IPython.html`.
43 :mod:`IPython.frontend.html.notebook` is now just `IPython.html`.
44 There is a shim module, so :mod:`IPython.frontend` is still
44 There is a shim module, so :mod:`IPython.frontend` is still
45 importable in 1.0, but there will be a warning.
45 importable in 1.0, but there will be a warning.
46 - The IPython sphinx directives are now installed in :mod:`IPython.sphinx`,
46 - The IPython sphinx directives are now installed in :mod:`IPython.sphinx`,
47 so they can be imported by other projects.
47 so they can be imported by other projects.
48
48
49
49
50 Public APIs
50 Public APIs
51 -----------
51 -----------
52
52
53 For the first time since 0.10 (sorry, everyone),
53 For the first time since 0.10 (sorry, everyone),
54 there is an official public API for starting IPython:
54 there is an official public API for starting IPython:
55
55
56 .. sourcecode:: python
56 .. sourcecode:: python
57
57
58 from IPython import start_ipython
58 from IPython import start_ipython
59 start_ipython()
59 start_ipython()
60
60
61 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,
62 but don't actually want embedded IPython (most cases).
62 but don't actually want embedded IPython (most cases).
63 :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,
64 similar to calling :func:`Pdb.set_trace`, whereas :func:`start_ipython`
64 similar to calling :func:`Pdb.set_trace`, whereas :func:`start_ipython`
65 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.
66
66
67 We also have added:
67 We also have added:
68
68
69 .. sourcecode:: python
69 .. sourcecode:: python
70
70
71 from IPython import get_ipython
71 from IPython import get_ipython
72
72
73
73
74 Which is a *library* function for getting the current IPython instance,
74 Which is a *library* function for getting the current IPython instance,
75 and will return ``None`` if no IPython instance is running.
75 and will return ``None`` if no IPython instance is running.
76 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.
77 If you want to check for IPython without unnecessarily importing IPython,
77 If you want to check for IPython without unnecessarily importing IPython,
78 use this function:
78 use this function:
79
79
80 .. sourcecode:: python
80 .. sourcecode:: python
81
81
82 def get_ipython():
82 def get_ipython():
83 """return IPython instance if there is one, None otherwise"""
83 """return IPython instance if there is one, None otherwise"""
84 import sys
84 import sys
85 if "IPython" in sys.modules:
85 if "IPython" in sys.modules:
86 import IPython
86 import IPython
87 return IPython.get_ipython()
87 return IPython.get_ipython()
88
88
89 Core
89 Core
90 ----
90 ----
91
91
92 - The input transformation framework has been reworked. This fixes some corner
92 - The input transformation framework has been reworked. This fixes some corner
93 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 &
94 SAGE. For more details, see :doc:`/config/inputtransforms`.
94 SAGE. For more details, see :doc:`/config/inputtransforms`.
95 - 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
96 ``_render_traceback_()`` method which returns a list of strings, each
96 ``_render_traceback_()`` method which returns a list of strings, each
97 containing one line of the traceback.
97 containing one line of the traceback.
98 - 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
99 the last 1000 entries in the history database.
99 the last 1000 entries in the history database.
100 - ``__file__`` is defined in both config files at load time,
100 - ``__file__`` is defined in both config files at load time,
101 and ``.ipy`` files executed with ``%run``.
101 and ``.ipy`` files executed with ``%run``.
102 - ``%logstart`` and ``%logappend`` are no longer broken.
102 - ``%logstart`` and ``%logappend`` are no longer broken.
103 - 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``.
104 - Expand variables (``$foo``) in Cell Magic argument line.
104 - Expand variables (``$foo``) in Cell Magic argument line.
105 - By default, :command:`iptest` will exclude various slow tests.
105 - By default, :command:`iptest` will exclude various slow tests.
106 All tests can be run with :command:`iptest --all`.
106 All tests can be run with :command:`iptest --all`.
107 - 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.
108 - ``%edit`` works on interactively defined variables.
108 - ``%edit`` works on interactively defined variables.
109 - editor hooks have been restored from quarantine, enabling TextMate as editor,
109 - editor hooks have been restored from quarantine, enabling TextMate as editor,
110 etc.
110 etc.
111 - The env variable PYTHONSTARTUP is respected by IPython.
111 - The env variable PYTHONSTARTUP is respected by IPython.
112 - The ``%matplotlib`` magic was added, which is like the old ``%pylab`` magic,
112 - The ``%matplotlib`` magic was added, which is like the old ``%pylab`` magic,
113 but it does not import anything to the interactive namespace.
113 but it does not import anything to the interactive namespace.
114 It is recommended that users switch to ``%matplotlib`` and explicit imports.
114 It is recommended that users switch to ``%matplotlib`` and explicit imports.
115 - The ``--matplotlib`` command line flag was also added. It invokes the new
115 - The ``--matplotlib`` command line flag was also added. It invokes the new
116 ``%matplotlib`` magic and can be used in the same way as the old ``--pylab``
116 ``%matplotlib`` magic and can be used in the same way as the old ``--pylab``
117 flag. You can either use it by itself as a flag (``--matplotlib``), or you
117 flag. You can either use it by itself as a flag (``--matplotlib``), or you
118 can also pass a backend explicitly (``--matplotlib qt`` or
118 can also pass a backend explicitly (``--matplotlib qt`` or
119 ``--matplotlib=wx``, etc).
119 ``--matplotlib=wx``, etc).
120
120
121
121
122 Backwards incompatible changes
122 Backwards incompatible changes
123 ******************************
123 ******************************
124
124
125 - Calling :meth:`InteractiveShell.prefilter` will no longer perform static
125 - Calling :meth:`InteractiveShell.prefilter` will no longer perform static
126 transformations - the processing of escaped commands such as ``%magic`` and
126 transformations - the processing of escaped commands such as ``%magic`` and
127 ``!system``, and stripping input prompts from code blocks. This functionality
127 ``!system``, and stripping input prompts from code blocks. This functionality
128 was duplicated in :mod:`IPython.core.inputsplitter`, and the latter version
128 was duplicated in :mod:`IPython.core.inputsplitter`, and the latter version
129 was already what IPython relied on. A new API to transform input will be ready
129 was already what IPython relied on. A new API to transform input will be ready
130 before release.
130 before release.
131 - Functions from :mod:`IPython.lib.inputhook` to control integration with GUI
131 - Functions from :mod:`IPython.lib.inputhook` to control integration with GUI
132 event loops are no longer exposed in the top level of :mod:`IPython.lib`.
132 event loops are no longer exposed in the top level of :mod:`IPython.lib`.
133 Code calling these should make sure to import them from
133 Code calling these should make sure to import them from
134 :mod:`IPython.lib.inputhook`.
134 :mod:`IPython.lib.inputhook`.
135 - For all kernel managers, the ``sub_channel`` attribute has been renamed to
135 - For all kernel managers, the ``sub_channel`` attribute has been renamed to
136 ``iopub_channel``.
136 ``iopub_channel``.
137 - Users on Python versions before 2.6.6, 2.7.1 or 3.2 will now need to call
137 - Users on Python versions before 2.6.6, 2.7.1 or 3.2 will now need to call
138 :func:`IPython.utils.doctestreload.doctest_reload` to make doctests run
138 :func:`IPython.utils.doctestreload.doctest_reload` to make doctests run
139 correctly inside IPython. Python releases since those versions are unaffected.
139 correctly inside IPython. Python releases since those versions are unaffected.
140 For details, see :ghpull:`3068` and `Python issue 8048 <http://bugs.python.org/issue8048>`_.
140 For details, see :ghpull:`3068` and `Python issue 8048 <http://bugs.python.org/issue8048>`_.
141 - The ``InteractiveShell.cache_main_mod()`` method has been removed, and
141 - The ``InteractiveShell.cache_main_mod()`` method has been removed, and
142 :meth:`~IPython.core.interactiveshell.InteractiveShell.new_main_mod` has a
142 :meth:`~IPython.core.interactiveshell.InteractiveShell.new_main_mod` has a
143 different signature, expecting a filename where earlier versions expected
143 different signature, expecting a filename where earlier versions expected
144 a namespace. See :ghpull:`3555` for details.
144 a namespace. See :ghpull:`3555` for details.
145 - The short-lived plugin system has been removed. Extensions are the way to go.
145 - The short-lived plugin system has been removed. Extensions are the way to go.
146
146
147
147
148 .. _nbconvert1:
148 .. _nbconvert1:
149
149
150 NbConvert
150 NbConvert
151 ---------
151 ---------
152
152
153 The major milestone for IPython 1.0 is the addition of :mod:`IPython.nbconvert` - tools for converting
153 The major milestone for IPython 1.0 is the addition of :mod:`IPython.nbconvert` - tools for converting
154 IPython notebooks to various other formats.
154 IPython notebooks to various other formats.
155
155
156 .. warning::
156 .. warning::
157
157
158 nbconvert is Ξ±-level preview code in 1.0
158 nbconvert is Ξ±-level preview code in 1.0
159
159
160 To use nbconvert to convert various file formats::
160 To use nbconvert to convert various file formats::
161
161
162 ipython nbconvert --to html *.ipynb
162 ipython nbconvert --to html *.ipynb
163
163
164 See ``ipython nbconvert --help`` for more information.
164 See ``ipython nbconvert --help`` for more information.
165 nbconvert depends on `pandoc`_ for many of the translations to and from various formats.
165 nbconvert depends on `pandoc`_ for many of the translations to and from various formats.
166
166
167 .. seealso::
168
169 :ref:`nbconvert`
170
171 .. _pandoc: http://johnmacfarlane.net/pandoc/
167 .. _pandoc: http://johnmacfarlane.net/pandoc/
172
168
173 Notebook
169 Notebook
174 --------
170 --------
175
171
176 Major changes to the IPython Notebook in 1.0:
172 Major changes to the IPython Notebook in 1.0:
177
173
178 - The notebook is now autosaved, by default at an interval of two minutes.
174 - The notebook is now autosaved, by default at an interval of two minutes.
179 When you press 'save' or Ctrl-S, a *checkpoint* is made, in a hidden folder.
175 When you press 'save' or Ctrl-S, a *checkpoint* is made, in a hidden folder.
180 This checkpoint can be restored, so that the autosave model is strictly safer
176 This checkpoint can be restored, so that the autosave model is strictly safer
181 than traditional save. If you change nothing about your save habits,
177 than traditional save. If you change nothing about your save habits,
182 you will always have a checkpoint that you have written,
178 you will always have a checkpoint that you have written,
183 and an autosaved file that is kept up to date.
179 and an autosaved file that is kept up to date.
184 - The notebook supports :func:`raw_input` / :func:`input`, and thus also ``%debug``,
180 - The notebook supports :func:`raw_input` / :func:`input`, and thus also ``%debug``,
185 and many other Python calls that expect user input.
181 and many other Python calls that expect user input.
186 - You can load custom javascript and CSS in the notebook by editing the files
182 - You can load custom javascript and CSS in the notebook by editing the files
187 :file:`$(ipython locate profile)/static/custom/custom.{js,css}`.
183 :file:`$(ipython locate profile)/static/custom/custom.{js,css}`.
188 - Add ``%%html``, ``%%svg``, ``%%javascript``, and ``%%latex`` cell magics
184 - Add ``%%html``, ``%%svg``, ``%%javascript``, and ``%%latex`` cell magics
189 for writing raw output in notebook cells.
185 for writing raw output in notebook cells.
190 - add a redirect handler and anchors on heading cells, so you can link
186 - add a redirect handler and anchors on heading cells, so you can link
191 across notebooks, directly to heading cells in other notebooks.
187 across notebooks, directly to heading cells in other notebooks.
192 - Images support width and height metadata,
188 - Images support width and height metadata,
193 and thereby 2x scaling (retina support).
189 and thereby 2x scaling (retina support).
194 - ``_repr_foo_`` methods can return a tuple of (data, metadata),
190 - ``_repr_foo_`` methods can return a tuple of (data, metadata),
195 where metadata is a dict containing metadata about the displayed object.
191 where metadata is a dict containing metadata about the displayed object.
196 This is used to set size, etc. for retina graphics. To enable retina matplotlib figures,
192 This is used to set size, etc. for retina graphics. To enable retina matplotlib figures,
197 simply set ``InlineBackend.figure_format = 'retina'`` for 2x PNG figures,
193 simply set ``InlineBackend.figure_format = 'retina'`` for 2x PNG figures,
198 in your :ref:`IPython config file <config_overview>` or via the ``%config`` magic.
194 in your :ref:`IPython config file <config_overview>` or via the ``%config`` magic.
199 - Add display.FileLink and FileLinks for quickly displaying HTML links to local files.
195 - Add display.FileLink and FileLinks for quickly displaying HTML links to local files.
200 - Cells have metadata, which can be edited via cell toolbars.
196 - Cells have metadata, which can be edited via cell toolbars.
201 This metadata can be used by external code (e.g. reveal.js or exporters),
197 This metadata can be used by external code (e.g. reveal.js or exporters),
202 when examining the notebook.
198 when examining the notebook.
203 - Fix an issue parsing LaTeX in markdown cells, which required users to type ``\\\``,
199 - Fix an issue parsing LaTeX in markdown cells, which required users to type ``\\\``,
204 instead of ``\\``.
200 instead of ``\\``.
205 - Notebook templates are rendered with Jinja instead of Tornado.
201 - Notebook templates are rendered with Jinja instead of Tornado.
206 - ``%%file`` has been renamed ``%%writefile`` (``%%file`` is deprecated).
202 - ``%%file`` has been renamed ``%%writefile`` (``%%file`` is deprecated).
207 - ANSI (and VT100) color parsing has been improved in both performance and
203 - ANSI (and VT100) color parsing has been improved in both performance and
208 supported values.
204 supported values.
209 - The static files path can be found as ``IPython.html.DEFAULT_STATIC_FILES_PATH``,
205 - The static files path can be found as ``IPython.html.DEFAULT_STATIC_FILES_PATH``,
210 which may be changed by package managers.
206 which may be changed by package managers.
211 - IPython's CSS is installed in :file:`static/css/style.min.css`
207 - IPython's CSS is installed in :file:`static/css/style.min.css`
212 (all style, including bootstrap), and :file:`static/css/ipython.min.css`,
208 (all style, including bootstrap), and :file:`static/css/ipython.min.css`,
213 which only has IPython's own CSS. The latter file should be useful for embedding
209 which only has IPython's own CSS. The latter file should be useful for embedding
214 IPython notebooks in other pages, blogs, etc.
210 IPython notebooks in other pages, blogs, etc.
215 - The Print View has been removed. Users are encouraged to test :ref:`ipython
211 - The Print View has been removed. Users are encouraged to test :ref:`ipython
216 nbconvert <nbconvert1>` to generate a static view.
212 nbconvert <nbconvert1>` to generate a static view.
217
213
218 Javascript Components
214 Javascript Components
219 *********************
215 *********************
220
216
221 The javascript components used in the notebook have been updated significantly.
217 The javascript components used in the notebook have been updated significantly.
222
218
223 - updates to jQuery (2.0) and jQueryUI (1.10)
219 - updates to jQuery (2.0) and jQueryUI (1.10)
224 - Update CodeMirror to 3.14
220 - Update CodeMirror to 3.14
225 - Twitter Bootstrap (2.3) for layout
221 - Twitter Bootstrap (2.3) for layout
226 - Font-Awesome (3.1) for icons
222 - Font-Awesome (3.1) for icons
227 - highlight.js (7.3) for syntax highlighting
223 - highlight.js (7.3) for syntax highlighting
228 - marked (0.2.8) for markdown rendering
224 - marked (0.2.8) for markdown rendering
229 - require.js (2.1) for loading javascript
225 - require.js (2.1) for loading javascript
230
226
231 Some relevant changes that are results of this:
227 Some relevant changes that are results of this:
232
228
233 - Markdown cells now support GitHub-flavored Markdown (GFM),
229 - Markdown cells now support GitHub-flavored Markdown (GFM),
234 which includes `````python`` code blocks and tables.
230 which includes `````python`` code blocks and tables.
235 - Notebook UI behaves better on more screen sizes.
231 - Notebook UI behaves better on more screen sizes.
236 - Various code cell input issues have been fixed.
232 - Various code cell input issues have been fixed.
237
233
238
234
239 Kernel
235 Kernel
240 ------
236 ------
241
237
242 The kernel code has been substantially reorganized.
238 The kernel code has been substantially reorganized.
243
239
244 New features in the kernel:
240 New features in the kernel:
245
241
246 - Kernels support ZeroMQ IPC transport, not just TCP
242 - Kernels support ZeroMQ IPC transport, not just TCP
247 - The message protocol has added a top-level metadata field,
243 - The message protocol has added a top-level metadata field,
248 used for information about messages.
244 used for information about messages.
249 - Add a `data_pub` message that functions much like `display_pub`,
245 - Add a `data_pub` message that functions much like `display_pub`,
250 but publishes raw (usually pickled) data, rather than representations.
246 but publishes raw (usually pickled) data, rather than representations.
251 - Ensure that ``sys.stdout.encoding`` is defined in Kernels.
247 - Ensure that ``sys.stdout.encoding`` is defined in Kernels.
252 - Stdout from forked subprocesses should be forwarded to frontends (instead of crashing).
248 - Stdout from forked subprocesses should be forwarded to frontends (instead of crashing).
253
249
254 IPEP 13
250 IPEP 13
255 *******
251 *******
256
252
257 The KernelManager has been split into a :class:`~.KernelManager` and a :class:`~.KernelClient`.
253 The KernelManager has been split into a :class:`~.KernelManager` and a :class:`~.KernelClient`.
258 The Manager owns a kernel and starts / signals / restarts it. There is always zero or one
254 The Manager owns a kernel and starts / signals / restarts it. There is always zero or one
259 KernelManager per Kernel. Clients communicate with Kernels via zmq channels,
255 KernelManager per Kernel. Clients communicate with Kernels via zmq channels,
260 and there can be zero-to-many Clients connected to a Kernel at any given time.
256 and there can be zero-to-many Clients connected to a Kernel at any given time.
261
257
262 The KernelManager now automatically restarts the kernel when it dies,
258 The KernelManager now automatically restarts the kernel when it dies,
263 rather than requiring user input at the notebook or QtConsole UI
259 rather than requiring user input at the notebook or QtConsole UI
264 (which may or may not exist at restart time).
260 (which may or may not exist at restart time).
265
261
266 In-process kernels
262 In-process kernels
267 ******************
263 ******************
268
264
269 The Python-language frontends, particularly the Qt console, may now communicate
265 The Python-language frontends, particularly the Qt console, may now communicate
270 with in-process kernels, in addition to the traditional out-of-process
266 with in-process kernels, in addition to the traditional out-of-process
271 kernels. An in-process kernel permits direct access to the kernel namespace,
267 kernels. An in-process kernel permits direct access to the kernel namespace,
272 which is necessary in some applications. It should be understood, however, that
268 which is necessary in some applications. It should be understood, however, that
273 the in-process kernel is not robust to bad user input and will block the main
269 the in-process kernel is not robust to bad user input and will block the main
274 (GUI) thread while executing. Developers must decide on a case-by-case basis
270 (GUI) thread while executing. Developers must decide on a case-by-case basis
275 whether this tradeoff is appropriate for their application.
271 whether this tradeoff is appropriate for their application.
276
272
277
273
278
274
279 Parallel
275 Parallel
280 --------
276 --------
281
277
282 IPython.parallel has had some refactoring as well.
278 IPython.parallel has had some refactoring as well.
283 There are many improvements and fixes, but these are the major changes:
279 There are many improvements and fixes, but these are the major changes:
284
280
285 - Connections have been simplified. All ports and the serialization in use
281 - Connections have been simplified. All ports and the serialization in use
286 are written to the connection file, rather than the initial two-stage system.
282 are written to the connection file, rather than the initial two-stage system.
287 - Serialization has been rewritten, fixing many bugs and dramatically improving
283 - Serialization has been rewritten, fixing many bugs and dramatically improving
288 performance serializing large containers.
284 performance serializing large containers.
289 - Load-balancing scheduler performance with large numbers of tasks has been dramatically improved.
285 - Load-balancing scheduler performance with large numbers of tasks has been dramatically improved.
290 - There should be fewer (hopefully zero) false-positives for engine failures.
286 - There should be fewer (hopefully zero) false-positives for engine failures.
291 - Increased compatibility with various use cases that produced serialization / argument errors
287 - Increased compatibility with various use cases that produced serialization / argument errors
292 with map, etc.
288 with map, etc.
293 - The controller can attempt to resume operation if it has crashed,
289 - The controller can attempt to resume operation if it has crashed,
294 by passing ``ipcontroller --restore``.
290 by passing ``ipcontroller --restore``.
295 - Engines can monitor the Hub heartbeat, and shutdown if the Hub disappears for too long.
291 - Engines can monitor the Hub heartbeat, and shutdown if the Hub disappears for too long.
296 - add HTCondor support in launchers
292 - add HTCondor support in launchers
297
293
298
294
299 QtConsole
295 QtConsole
300 ---------
296 ---------
301
297
302 Various fixes, including improved performance with lots of text output,
298 Various fixes, including improved performance with lots of text output,
303 and better drag and drop support.
299 and better drag and drop support.
304 The initial window size of the qtconsole is now configurable via ``IPythonWidget.width``
300 The initial window size of the qtconsole is now configurable via ``IPythonWidget.width``
305 and ``IPythonWidget.height``.
301 and ``IPythonWidget.height``.
306
302
@@ -1,384 +1,384 b''
1 ============
1 ============
2 2.x Series
2 2.x Series
3 ============
3 ============
4
4
5 Release 2.4
5 Release 2.4
6 ===========
6 ===========
7
7
8 January, 2014
8 January, 2014
9
9
10 .. note::
10 .. note::
11
11
12 Some of the patches marked for 2.4 were left out of 2.4.0.
12 Some of the patches marked for 2.4 were left out of 2.4.0.
13 Please use 2.4.1.
13 Please use 2.4.1.
14
14
15 - backport read support for nbformat v4 from IPython 3
15 - backport read support for nbformat v4 from IPython 3
16 - support for PyQt5 in the kernel (not QtConsole)
16 - support for PyQt5 in the kernel (not QtConsole)
17 - support for Pygments 2.0
17 - support for Pygments 2.0
18
18
19 For more information on what fixes have been backported to 2.4,
19 For more information on what fixes have been backported to 2.4,
20 see our :ref:`detailed release info <issues_list_200>`.
20 see our :ref:`detailed release info <issues_list_200>`.
21
21
22
22
23 Release 2.3.1
23 Release 2.3.1
24 =============
24 =============
25
25
26 November, 2014
26 November, 2014
27
27
28 - Fix CRCRLF line-ending bug in notebooks on Windows
28 - Fix CRCRLF line-ending bug in notebooks on Windows
29
29
30 For more information on what fixes have been backported to 2.3.1,
30 For more information on what fixes have been backported to 2.3.1,
31 see our :ref:`detailed release info <issues_list_200>`.
31 see our :ref:`detailed release info <issues_list_200>`.
32
32
33 Release 2.3.0
33 Release 2.3.0
34 =============
34 =============
35
35
36 October, 2014
36 October, 2014
37
37
38 - improve qt5 support
38 - improve qt5 support
39 - prevent notebook data loss with atomic writes
39 - prevent notebook data loss with atomic writes
40
40
41 For more information on what fixes have been backported to 2.3,
41 For more information on what fixes have been backported to 2.3,
42 see our :ref:`detailed release info <issues_list_200>`.
42 see our :ref:`detailed release info <issues_list_200>`.
43
43
44 Release 2.2.0
44 Release 2.2.0
45 =============
45 =============
46
46
47 August, 2014
47 August, 2014
48
48
49 - Add CORS configuration
49 - Add CORS configuration
50
50
51 For more information on what fixes have been backported to 2.2,
51 For more information on what fixes have been backported to 2.2,
52 see our :ref:`detailed release info <issues_list_200>`.
52 see our :ref:`detailed release info <issues_list_200>`.
53
53
54 Release 2.1.0
54 Release 2.1.0
55 =============
55 =============
56
56
57 May, 2014
57 May, 2014
58
58
59 IPython 2.1 is the first bugfix release for 2.0.
59 IPython 2.1 is the first bugfix release for 2.0.
60 For more information on what fixes have been backported to 2.1,
60 For more information on what fixes have been backported to 2.1,
61 see our :ref:`detailed release info
61 see our :ref:`detailed release info
62 <issues_list_200>`.
62 <issues_list_200>`.
63
63
64
64
65 Release 2.0.0
65 Release 2.0.0
66 =============
66 =============
67
67
68 April, 2014
68 April, 2014
69
69
70 IPython 2.0 requires Python β‰₯ 2.7.2 or β‰₯ 3.3.0.
70 IPython 2.0 requires Python β‰₯ 2.7.2 or β‰₯ 3.3.0.
71 It does not support Python 3.0, 3.1, 3.2, 2.5, or 2.6.
71 It does not support Python 3.0, 3.1, 3.2, 2.5, or 2.6.
72
72
73 The principal milestones of 2.0 are:
73 The principal milestones of 2.0 are:
74
74
75 - interactive widgets for the notebook
75 - interactive widgets for the notebook
76 - directory navigation in the notebook dashboard
76 - directory navigation in the notebook dashboard
77 - persistent URLs for notebooks
77 - persistent URLs for notebooks
78 - a new modal user interface in the notebook
78 - a new modal user interface in the notebook
79 - a security model for notebooks
79 - a security model for notebooks
80
80
81 Contribution summary since IPython 1.0 in August, 2013:
81 Contribution summary since IPython 1.0 in August, 2013:
82
82
83 - ~8 months of work
83 - ~8 months of work
84 - ~650 pull requests merged
84 - ~650 pull requests merged
85 - ~400 issues closed (non-pull requests)
85 - ~400 issues closed (non-pull requests)
86 - contributions from ~100 authors
86 - contributions from ~100 authors
87 - ~4000 commits
87 - ~4000 commits
88
88
89 The amount of work included in this release is so large that we can only cover
89 The amount of work included in this release is so large that we can only cover
90 here the main highlights; please see our :ref:`detailed release statistics
90 here the main highlights; please see our :ref:`detailed release statistics
91 <issues_list_200>` for links to every issue and pull request closed on GitHub
91 <issues_list_200>` for links to every issue and pull request closed on GitHub
92 as well as a full list of individual contributors.
92 as well as a full list of individual contributors.
93
93
94 New stuff in the IPython notebook
94 New stuff in the IPython notebook
95 ---------------------------------
95 ---------------------------------
96
96
97 Directory navigation
97 Directory navigation
98 ********************
98 ********************
99
99
100 .. image:: /_images/2.0/treeview.png
100 .. image:: /_images/2.0/treeview.png
101 :width: 392px
101 :width: 392px
102 :alt: Directory navigation
102 :alt: Directory navigation
103 :align: center
103 :align: center
104
104
105 The IPython notebook dashboard allows navigation into subdirectories.
105 The IPython notebook dashboard allows navigation into subdirectories.
106 URLs are persistent based on the notebook's path and name,
106 URLs are persistent based on the notebook's path and name,
107 so no more random UUID URLs.
107 so no more random UUID URLs.
108
108
109 Serving local files no longer needs the ``files/`` prefix.
109 Serving local files no longer needs the ``files/`` prefix.
110 Relative links across notebooks and other files should work just as if notebooks were regular HTML files.
110 Relative links across notebooks and other files should work just as if notebooks were regular HTML files.
111
111
112 Interactive widgets
112 Interactive widgets
113 *******************
113 *******************
114
114
115 .. image:: /_images/2.0/widgets.png
115 .. image:: /_images/2.0/widgets.png
116 :width: 392px
116 :width: 392px
117 :alt: Interactive widgets
117 :alt: Interactive widgets
118 :align: center
118 :align: center
119
119
120 IPython 2.0 adds :mod:`IPython.html.widgets`, for manipulating
120 IPython 2.0 adds :mod:`IPython.html.widgets`, for manipulating
121 Python objects in the kernel with GUI controls in the notebook.
121 Python objects in the kernel with GUI controls in the notebook.
122 IPython comes with a few built-in widgets for simple data types,
122 IPython comes with a few built-in widgets for simple data types,
123 and an API designed for developers to build more complex widgets.
123 and an API designed for developers to build more complex widgets.
124 See the `widget docs`_ for more information.
124 See the `widget docs`_ for more information.
125
125
126 .. _widget docs: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Index.ipynb
126 .. _widget docs: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Index.ipynb
127
127
128
128
129 Modal user interface
129 Modal user interface
130 ********************
130 ********************
131
131
132 The notebook has added separate Edit and Command modes,
132 The notebook has added separate Edit and Command modes,
133 allowing easier keyboard commands and making keyboard shortcut customization possible.
133 allowing easier keyboard commands and making keyboard shortcut customization possible.
134 See the new `User Interface notebook`_ for more information.
134 See the new `User Interface notebook`_ for more information.
135
135
136 .. _User Interface Notebook: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/User%20Interface.ipynb
136 .. _User Interface Notebook: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/User%20Interface.ipynb
137
137
138
138
139 You can familiarize yourself with the updated notebook user interface, including an
139 You can familiarize yourself with the updated notebook user interface, including an
140 explanation of Edit and Command modes, by going through the short guided tour
140 explanation of Edit and Command modes, by going through the short guided tour
141 which can be started from the Help menu.
141 which can be started from the Help menu.
142
142
143 .. image:: /_images/2.0/user-interface.png
143 .. image:: /_images/2.0/user-interface.png
144 :width: 392px
144 :width: 392px
145 :alt: Interface tour
145 :alt: Interface tour
146 :align: center
146 :align: center
147
147
148
148
149 Security
149 Security
150 ********
150 ********
151
151
152 2.0 introduces a :ref:`security model <notebook_security>` for notebooks,
152 2.0 introduces a security model for notebooks,
153 to prevent untrusted code from executing on users' behalf when notebooks open.
153 to prevent untrusted code from executing on users' behalf when notebooks open.
154 A quick summary of the model:
154 A quick summary of the model:
155
155
156 - Trust is determined by :ref:`signing notebooks<signing_notebooks>`.
156 - Trust is determined by signing notebooks.
157 - Untrusted HTML output is sanitized.
157 - Untrusted HTML output is sanitized.
158 - Untrusted Javascript is never executed.
158 - Untrusted Javascript is never executed.
159 - HTML and Javascript in Markdown are never trusted.
159 - HTML and Javascript in Markdown are never trusted.
160
160
161 Dashboard "Running" tab
161 Dashboard "Running" tab
162 ***********************
162 ***********************
163
163
164 .. image:: /_images/2.0/running-crop.png
164 .. image:: /_images/2.0/running-crop.png
165 :width: 392px
165 :width: 392px
166 :alt: Running tab
166 :alt: Running tab
167 :align: center
167 :align: center
168
168
169 The dashboard now has a "Running" tab which shows all of the running notebooks.
169 The dashboard now has a "Running" tab which shows all of the running notebooks.
170
170
171 Single codebase Python 3 support
171 Single codebase Python 3 support
172 --------------------------------
172 --------------------------------
173
173
174 IPython previously supported Python 3 by running 2to3 during setup. We
174 IPython previously supported Python 3 by running 2to3 during setup. We
175 have now switched to a single codebase which runs natively on Python 2.7
175 have now switched to a single codebase which runs natively on Python 2.7
176 and 3.3.
176 and 3.3.
177
177
178 For notes on how to maintain this, see :doc:`/development/pycompat`.
178 For notes on how to maintain this, see :doc:`/development/pycompat`.
179
179
180 Selecting matplotlib figure formats
180 Selecting matplotlib figure formats
181 -----------------------------------
181 -----------------------------------
182
182
183 Deprecate single-format ``InlineBackend.figure_format``
183 Deprecate single-format ``InlineBackend.figure_format``
184 configurable in favor of ``InlineBackend.figure_formats``,
184 configurable in favor of ``InlineBackend.figure_formats``,
185 which is a set, supporting multiple simultaneous figure formats (e.g. png, pdf).
185 which is a set, supporting multiple simultaneous figure formats (e.g. png, pdf).
186
186
187 This is available at runtime with the new API function :func:`IPython.display.set_matplotlib_formats`.
187 This is available at runtime with the new API function :func:`IPython.display.set_matplotlib_formats`.
188
188
189 clear_output changes
189 clear_output changes
190 --------------------
190 --------------------
191
191
192 * There is no longer a 500ms delay when calling ``clear_output``.
192 * There is no longer a 500ms delay when calling ``clear_output``.
193 * The ability to clear stderr and stdout individually was removed.
193 * The ability to clear stderr and stdout individually was removed.
194 * A new ``wait`` flag that prevents ``clear_output`` from being executed until new
194 * A new ``wait`` flag that prevents ``clear_output`` from being executed until new
195 output is available. This eliminates animation flickering by allowing the
195 output is available. This eliminates animation flickering by allowing the
196 user to double buffer the output.
196 user to double buffer the output.
197 * The output div height is remembered when the ``wait=True`` flag is used.
197 * The output div height is remembered when the ``wait=True`` flag is used.
198
198
199 Extending configurable containers
199 Extending configurable containers
200 ---------------------------------
200 ---------------------------------
201
201
202 Some configurable traits are containers (list, dict, set)
202 Some configurable traits are containers (list, dict, set)
203 Config objects now support calling ``extend``, ``update``, ``insert``, etc.
203 Config objects now support calling ``extend``, ``update``, ``insert``, etc.
204 on traits in config files, which will ultimately result in calling
204 on traits in config files, which will ultimately result in calling
205 those methods on the original object.
205 those methods on the original object.
206
206
207 The effect being that you can now add to containers without having to copy/paste
207 The effect being that you can now add to containers without having to copy/paste
208 the initial value::
208 the initial value::
209
209
210 c = get_config()
210 c = get_config()
211 c.InlineBackend.rc.update({ 'figure.figsize' : (6, 4) })
211 c.InlineBackend.rc.update({ 'figure.figsize' : (6, 4) })
212
212
213 Changes to hidden namespace on startup
213 Changes to hidden namespace on startup
214 --------------------------------------
214 --------------------------------------
215
215
216 Previously, all names declared in code run at startup
216 Previously, all names declared in code run at startup
217 (startup files, ``ipython -i script.py``, etc.)
217 (startup files, ``ipython -i script.py``, etc.)
218 were added to the hidden namespace, which hides the names from tools like ``%whos``.
218 were added to the hidden namespace, which hides the names from tools like ``%whos``.
219 There are two changes to this behavior:
219 There are two changes to this behavior:
220
220
221 1. Scripts run on the command-line ``ipython -i script.py``now behave the same as if they were
221 1. Scripts run on the command-line ``ipython -i script.py``now behave the same as if they were
222 passed to ``%run``, so their variables are never hidden.
222 passed to ``%run``, so their variables are never hidden.
223 2. A boolean config flag ``InteractiveShellApp.hide_initial_ns`` has been added to optionally
223 2. A boolean config flag ``InteractiveShellApp.hide_initial_ns`` has been added to optionally
224 disable the hidden behavior altogether. The default behavior is unchanged.
224 disable the hidden behavior altogether. The default behavior is unchanged.
225
225
226 Using dill to expand serialization support
226 Using dill to expand serialization support
227 ------------------------------------------
227 ------------------------------------------
228
228
229 The new function :func:`~IPython.utils.pickleutil.use_dill` allows
229 The new function :func:`~IPython.utils.pickleutil.use_dill` allows
230 dill to extend serialization support in :mod:`IPython.parallel` (closures, etc.).
230 dill to extend serialization support in :mod:`IPython.parallel` (closures, etc.).
231 A :meth:`DirectView.use_dill` convenience method was also added, to enable dill
231 A :meth:`DirectView.use_dill` convenience method was also added, to enable dill
232 locally and on all engines with one call.
232 locally and on all engines with one call.
233
233
234 New IPython console lexer
234 New IPython console lexer
235 -------------------------
235 -------------------------
236
236
237 The IPython console lexer has been rewritten and now supports tracebacks
237 The IPython console lexer has been rewritten and now supports tracebacks
238 and customized input/output prompts. See the :ref:`new lexer docs <console_lexer>`
238 and customized input/output prompts. See the :ref:`new lexer docs <console_lexer>`
239 for details.
239 for details.
240
240
241 DisplayFormatter changes
241 DisplayFormatter changes
242 ------------------------
242 ------------------------
243
243
244 There was no official way to query or remove callbacks in the Formatter API.
244 There was no official way to query or remove callbacks in the Formatter API.
245 To remedy this, the following methods are added to :class:`BaseFormatter`:
245 To remedy this, the following methods are added to :class:`BaseFormatter`:
246
246
247 - ``lookup(instance)`` - return appropriate callback or a given object
247 - ``lookup(instance)`` - return appropriate callback or a given object
248 - ``lookup_by_type(type_or_str)`` - return appropriate callback for a given type or ``'mod.name'`` type string
248 - ``lookup_by_type(type_or_str)`` - return appropriate callback for a given type or ``'mod.name'`` type string
249 - ``pop(type_or_str)`` - remove a type (by type or string).
249 - ``pop(type_or_str)`` - remove a type (by type or string).
250 Pass a second argument to avoid KeyError (like dict).
250 Pass a second argument to avoid KeyError (like dict).
251
251
252 All of the above methods raise a KeyError if no match is found.
252 All of the above methods raise a KeyError if no match is found.
253
253
254 And the following methods are changed:
254 And the following methods are changed:
255
255
256 - ``for_type(type_or_str)`` - behaves the same as before, only adding support for ``'mod.name'``
256 - ``for_type(type_or_str)`` - behaves the same as before, only adding support for ``'mod.name'``
257 type strings in addition to plain types. This removes the need for ``for_type_by_name()``,
257 type strings in addition to plain types. This removes the need for ``for_type_by_name()``,
258 but it remains for backward compatibility.
258 but it remains for backward compatibility.
259
259
260 Formatters can now raise NotImplementedError in addition to returning None
260 Formatters can now raise NotImplementedError in addition to returning None
261 to indicate that they cannot format a given object.
261 to indicate that they cannot format a given object.
262
262
263 Exceptions and Warnings
263 Exceptions and Warnings
264 ***********************
264 ***********************
265
265
266 Exceptions are no longer silenced when formatters fail.
266 Exceptions are no longer silenced when formatters fail.
267 Instead, these are turned into a :class:`~IPython.core.formatters.FormatterWarning`.
267 Instead, these are turned into a :class:`~IPython.core.formatters.FormatterWarning`.
268 A FormatterWarning will also be issued if a formatter returns data of an invalid type
268 A FormatterWarning will also be issued if a formatter returns data of an invalid type
269 (e.g. an integer for 'image/png').
269 (e.g. an integer for 'image/png').
270
270
271
271
272 Other changes
272 Other changes
273 -------------
273 -------------
274
274
275 * `%%capture` cell magic now captures the rich display output, not just
275 * `%%capture` cell magic now captures the rich display output, not just
276 stdout/stderr
276 stdout/stderr
277
277
278 * In notebook, Showing tooltip on tab has been disables to avoid conflict with
278 * In notebook, Showing tooltip on tab has been disables to avoid conflict with
279 completion, Shift-Tab could still be used to invoke tooltip when inside
279 completion, Shift-Tab could still be used to invoke tooltip when inside
280 function signature and/or on selection.
280 function signature and/or on selection.
281
281
282 * ``object_info_request`` has been replaced by ``object_info`` for consistency in the javascript API.
282 * ``object_info_request`` has been replaced by ``object_info`` for consistency in the javascript API.
283 ``object_info`` is a simpler interface to register callback that is incompatible with ``object_info_request``.
283 ``object_info`` is a simpler interface to register callback that is incompatible with ``object_info_request``.
284
284
285 * Previous versions of IPython on Linux would use the XDG config directory,
285 * Previous versions of IPython on Linux would use the XDG config directory,
286 creating :file:`~/.config/ipython` by default. We have decided to go
286 creating :file:`~/.config/ipython` by default. We have decided to go
287 back to :file:`~/.ipython` for consistency among systems. IPython will
287 back to :file:`~/.ipython` for consistency among systems. IPython will
288 issue a warning if it finds the XDG location, and will move it to the new
288 issue a warning if it finds the XDG location, and will move it to the new
289 location if there isn't already a directory there.
289 location if there isn't already a directory there.
290
290
291 * Equations, images and tables are now centered in Markdown cells.
291 * Equations, images and tables are now centered in Markdown cells.
292 * Multiline equations are now centered in output areas; single line equations
292 * Multiline equations are now centered in output areas; single line equations
293 remain left justified.
293 remain left justified.
294
294
295 * IPython config objects can be loaded from and serialized to JSON.
295 * IPython config objects can be loaded from and serialized to JSON.
296 JSON config file have the same base name as their ``.py`` counterpart,
296 JSON config file have the same base name as their ``.py`` counterpart,
297 and will be loaded with higher priority if found.
297 and will be loaded with higher priority if found.
298
298
299 * bash completion updated with support for all ipython subcommands and flags, including nbconvert
299 * bash completion updated with support for all ipython subcommands and flags, including nbconvert
300
300
301 * ``ipython history trim``: added ``--keep=<N>`` as an alias for the more verbose
301 * ``ipython history trim``: added ``--keep=<N>`` as an alias for the more verbose
302 ``--HistoryTrim.keep=<N>``
302 ``--HistoryTrim.keep=<N>``
303 * New ``ipython history clear`` subcommand, which is the same as the newly supported
303 * New ``ipython history clear`` subcommand, which is the same as the newly supported
304 ``ipython history trim --keep=0``
304 ``ipython history trim --keep=0``
305
305
306 * You can now run notebooks in an interactive session via ``%run notebook.ipynb``.
306 * You can now run notebooks in an interactive session via ``%run notebook.ipynb``.
307
307
308 * Print preview is back in the notebook menus, along with options to
308 * Print preview is back in the notebook menus, along with options to
309 download the open notebook in various formats. This is powered by
309 download the open notebook in various formats. This is powered by
310 nbconvert.
310 nbconvert.
311
311
312 * :exc:`~IPython.nbconvert.utils.pandoc.PandocMissing` exceptions will be
312 * :exc:`~IPython.nbconvert.utils.pandoc.PandocMissing` exceptions will be
313 raised if Pandoc is unavailable, and warnings will be printed if the version
313 raised if Pandoc is unavailable, and warnings will be printed if the version
314 found is too old. The recommended Pandoc version for use with nbconvert is
314 found is too old. The recommended Pandoc version for use with nbconvert is
315 1.12.1.
315 1.12.1.
316
316
317 * The InlineBackend.figure_format now supports JPEG output if PIL/Pillow is available.
317 * The InlineBackend.figure_format now supports JPEG output if PIL/Pillow is available.
318
318
319 * Input transformers (see :doc:`/config/inputtransforms`) may now raise
319 * Input transformers (see :doc:`/config/inputtransforms`) may now raise
320 :exc:`SyntaxError` if they determine that input is invalid. The input
320 :exc:`SyntaxError` if they determine that input is invalid. The input
321 transformation machinery in IPython will handle displaying the exception to
321 transformation machinery in IPython will handle displaying the exception to
322 the user and resetting state.
322 the user and resetting state.
323
323
324 * Calling ``container.show()`` on javascript display is deprecated and will
324 * Calling ``container.show()`` on javascript display is deprecated and will
325 trigger errors on future IPython notebook versions. ``container`` now show
325 trigger errors on future IPython notebook versions. ``container`` now show
326 itself as soon as non-empty
326 itself as soon as non-empty
327
327
328 * Added ``InlineBackend.print_figure_kwargs`` to allow passing keyword arguments
328 * Added ``InlineBackend.print_figure_kwargs`` to allow passing keyword arguments
329 to matplotlib's ``Canvas.print_figure``. This can be used to change the value of
329 to matplotlib's ``Canvas.print_figure``. This can be used to change the value of
330 ``bbox_inches``, which is 'tight' by default, or set the quality of JPEG figures.
330 ``bbox_inches``, which is 'tight' by default, or set the quality of JPEG figures.
331
331
332 * A new callback system has been introduced. For details, see :doc:`/config/callbacks`.
332 * A new callback system has been introduced. For details, see :doc:`/config/callbacks`.
333
333
334 * jQuery and require.js are loaded from CDNs in the default HTML template,
334 * jQuery and require.js are loaded from CDNs in the default HTML template,
335 so javascript is available in static HTML export (e.g. nbviewer).
335 so javascript is available in static HTML export (e.g. nbviewer).
336
336
337 Backwards incompatible changes
337 Backwards incompatible changes
338 ------------------------------
338 ------------------------------
339
339
340 * Python 2.6 and 3.2 are no longer supported: the minimum required
340 * Python 2.6 and 3.2 are no longer supported: the minimum required
341 Python versions are now 2.7 and 3.3.
341 Python versions are now 2.7 and 3.3.
342 * The Transformer classes have been renamed to Preprocessor in nbconvert and
342 * The Transformer classes have been renamed to Preprocessor in nbconvert and
343 their ``call`` methods have been renamed to ``preprocess``.
343 their ``call`` methods have been renamed to ``preprocess``.
344 * The ``call`` methods of nbconvert post-processsors have been renamed to
344 * The ``call`` methods of nbconvert post-processsors have been renamed to
345 ``postprocess``.
345 ``postprocess``.
346
346
347 * The module ``IPython.core.fakemodule`` has been removed.
347 * The module ``IPython.core.fakemodule`` has been removed.
348
348
349 * The alias system has been reimplemented to use magic functions. There should be little
349 * The alias system has been reimplemented to use magic functions. There should be little
350 visible difference while automagics are enabled, as they are by default, but parts of the
350 visible difference while automagics are enabled, as they are by default, but parts of the
351 :class:`~IPython.core.alias.AliasManager` API have been removed.
351 :class:`~IPython.core.alias.AliasManager` API have been removed.
352
352
353 * We fixed an issue with switching between matplotlib inline and GUI backends,
353 * We fixed an issue with switching between matplotlib inline and GUI backends,
354 but the fix requires matplotlib 1.1 or newer. So from now on, we consider
354 but the fix requires matplotlib 1.1 or newer. So from now on, we consider
355 matplotlib 1.1 to be the minimally supported version for IPython. Older
355 matplotlib 1.1 to be the minimally supported version for IPython. Older
356 versions for the most part will work, but we make no guarantees about it.
356 versions for the most part will work, but we make no guarantees about it.
357
357
358 * The :command:`pycolor` command has been removed. We recommend the much more capable
358 * The :command:`pycolor` command has been removed. We recommend the much more capable
359 :command:`pygmentize` command from the `Pygments <http://pygments.org/>`_ project.
359 :command:`pygmentize` command from the `Pygments <http://pygments.org/>`_ project.
360 If you need to keep the exact output of :command:`pycolor`, you can still use
360 If you need to keep the exact output of :command:`pycolor`, you can still use
361 ``python -m IPython.utils.PyColorize foo.py``.
361 ``python -m IPython.utils.PyColorize foo.py``.
362
362
363 * :mod:`IPython.lib.irunner` and its command-line entry point have been removed.
363 * :mod:`IPython.lib.irunner` and its command-line entry point have been removed.
364 It had fallen out of use long ago.
364 It had fallen out of use long ago.
365
365
366 * The ``input_prefilter`` hook has been removed, as it was never
366 * The ``input_prefilter`` hook has been removed, as it was never
367 actually used by the code. The input transformer system offers much
367 actually used by the code. The input transformer system offers much
368 more powerful APIs to work with input code. See
368 more powerful APIs to work with input code. See
369 :doc:`/config/inputtransforms` for details.
369 :doc:`/config/inputtransforms` for details.
370
370
371 * :class:`IPython.core.inputsplitter.IPythonInputSplitter` no longer has a method
371 * :class:`IPython.core.inputsplitter.IPythonInputSplitter` no longer has a method
372 ``source_raw_reset()``, but gains :meth:`~IPython.core.inputsplitter.IPythonInputSplitter.raw_reset`
372 ``source_raw_reset()``, but gains :meth:`~IPython.core.inputsplitter.IPythonInputSplitter.raw_reset`
373 instead. Use of ``source_raw_reset`` can be replaced with::
373 instead. Use of ``source_raw_reset`` can be replaced with::
374
374
375 raw = isp.source_raw
375 raw = isp.source_raw
376 transformed = isp.source_reset()
376 transformed = isp.source_reset()
377
377
378 * The Azure notebook manager was removed as it was no longer compatible with the notebook storage scheme.
378 * The Azure notebook manager was removed as it was no longer compatible with the notebook storage scheme.
379
379
380 * Simplifying configurable URLs
380 * Simplifying configurable URLs
381
381
382 - base_project_url is renamed to base_url (base_project_url is kept as a deprecated alias, for now)
382 - base_project_url is renamed to base_url (base_project_url is kept as a deprecated alias, for now)
383 - base_kernel_url configurable is removed (use base_url)
383 - base_kernel_url configurable is removed (use base_url)
384 - websocket_url configurable is removed (use base_url)
384 - websocket_url configurable is removed (use base_url)
@@ -1,391 +1,391 b''
1 ============
1 ============
2 3.x Series
2 3.x Series
3 ============
3 ============
4
4
5 IPython 3.2.3
5 IPython 3.2.3
6 =============
6 =============
7
7
8 Fixes compatibility with Python 3.4.4.
8 Fixes compatibility with Python 3.4.4.
9
9
10 IPython 3.2.2
10 IPython 3.2.2
11 =============
11 =============
12
12
13 Address vulnerabilities when files have maliciously crafted filenames (CVE-2015-6938),
13 Address vulnerabilities when files have maliciously crafted filenames (CVE-2015-6938),
14 or vulnerability when opening text files with malicious binary content (CVE pending).
14 or vulnerability when opening text files with malicious binary content (CVE pending).
15
15
16 Users are **strongly** encouraged to upgrade immediately.
16 Users are **strongly** encouraged to upgrade immediately.
17 There are also a few small unicode and nbconvert-related fixes.
17 There are also a few small unicode and nbconvert-related fixes.
18
18
19
19
20 IPython 3.2.1
20 IPython 3.2.1
21 =============
21 =============
22
22
23 IPython 3.2.1 is a small bugfix release, primarily for cross-site security fixes in the notebook.
23 IPython 3.2.1 is a small bugfix release, primarily for cross-site security fixes in the notebook.
24 Users are **strongly** encouraged to upgrade immediately.
24 Users are **strongly** encouraged to upgrade immediately.
25 There are also a few small unicode and nbconvert-related fixes.
25 There are also a few small unicode and nbconvert-related fixes.
26
26
27 See :ref:`issues_list_3` for details.
27 See :ref:`issues_list_3` for details.
28
28
29
29
30 IPython 3.2
30 IPython 3.2
31 ===========
31 ===========
32
32
33 IPython 3.2 contains important security fixes. Users are **strongly** encouraged to upgrade immediately.
33 IPython 3.2 contains important security fixes. Users are **strongly** encouraged to upgrade immediately.
34
34
35 Highlights:
35 Highlights:
36
36
37 - Address cross-site scripting vulnerabilities CVE-2015-4706, CVE-2015-4707
37 - Address cross-site scripting vulnerabilities CVE-2015-4706, CVE-2015-4707
38 - A security improvement that set the secure attribute to login cookie to prevent them to be sent over http
38 - A security improvement that set the secure attribute to login cookie to prevent them to be sent over http
39 - Revert the face color of matplotlib axes in the inline backend to not be transparent.
39 - Revert the face color of matplotlib axes in the inline backend to not be transparent.
40 - Enable mathjax safe mode by default
40 - Enable mathjax safe mode by default
41 - Fix XSS vulnerability in JSON error messages
41 - Fix XSS vulnerability in JSON error messages
42 - Various widget-related fixes
42 - Various widget-related fixes
43
43
44 See :ref:`issues_list_3` for details.
44 See :ref:`issues_list_3` for details.
45
45
46
46
47 IPython 3.1
47 IPython 3.1
48 ===========
48 ===========
49
49
50 Released April 3, 2015
50 Released April 3, 2015
51
51
52 The first 3.x bugfix release, with 33 contributors and 344 commits.
52 The first 3.x bugfix release, with 33 contributors and 344 commits.
53 This primarily includes bugfixes to notebook layout and focus problems.
53 This primarily includes bugfixes to notebook layout and focus problems.
54
54
55
55
56 Highlights:
56 Highlights:
57
57
58 - Various focus jumping and scrolling fixes in the notebook.
58 - Various focus jumping and scrolling fixes in the notebook.
59 - Various message ordering and widget fixes in the notebook.
59 - Various message ordering and widget fixes in the notebook.
60 - Images in markdown and output are confined to the notebook width.
60 - Images in markdown and output are confined to the notebook width.
61 An `.unconfined` CSS class is added to disable this behavior per-image.
61 An `.unconfined` CSS class is added to disable this behavior per-image.
62 The resize handle on output images is removed.
62 The resize handle on output images is removed.
63 - Improved ordering of tooltip content for Python functions, putting the signature at the top.
63 - Improved ordering of tooltip content for Python functions, putting the signature at the top.
64 - Fix UnicodeErrors when displaying some objects with unicode reprs on Python 2.
64 - Fix UnicodeErrors when displaying some objects with unicode reprs on Python 2.
65 - Set the kernel's working directory to the notebook directory when running ``nbconvert --execute``,
65 - Set the kernel's working directory to the notebook directory when running ``nbconvert --execute``,
66 so that behavior matches the live notebook.
66 so that behavior matches the live notebook.
67 - Allow setting custom SSL options for the tornado server with ``NotebookApp.ssl_options``,
67 - Allow setting custom SSL options for the tornado server with ``NotebookApp.ssl_options``,
68 and protect against POODLE with default settings by disabling SSLv3.
68 and protect against POODLE with default settings by disabling SSLv3.
69 - Fix memory leak in the IPython.parallel Controller on Python 3.
69 - Fix memory leak in the IPython.parallel Controller on Python 3.
70
70
71
71
72 See :ref:`issues_list_3` for details.
72 See :ref:`issues_list_3` for details.
73
73
74
74
75 Release 3.0
75 Release 3.0
76 ===========
76 ===========
77
77
78 Released February 27, 2015
78 Released February 27, 2015
79
79
80 This is a really big release. Over 150 contributors, and almost 6000 commits in a bit under a year.
80 This is a really big release. Over 150 contributors, and almost 6000 commits in a bit under a year.
81 Support for languages other than Python is greatly improved,
81 Support for languages other than Python is greatly improved,
82 notebook UI has been significantly redesigned,
82 notebook UI has been significantly redesigned,
83 and a lot of improvement has happened in the experimental interactive widgets.
83 and a lot of improvement has happened in the experimental interactive widgets.
84 The message protocol and document format have both been updated,
84 The message protocol and document format have both been updated,
85 while maintaining better compatibility with previous versions than prior updates.
85 while maintaining better compatibility with previous versions than prior updates.
86 The notebook webapp now enables editing of any text file, and even
86 The notebook webapp now enables editing of any text file, and even
87 a web-based terminal (on Unix platforms).
87 a web-based terminal (on Unix platforms).
88
88
89 3.x will be the last monolithic release of IPython,
89 3.x will be the last monolithic release of IPython,
90 as the next release cycle will see the growing project split into its Python-specific and language-agnostic components.
90 as the next release cycle will see the growing project split into its Python-specific and language-agnostic components.
91 Language-agnostic projects (notebook, qtconsole, etc.) will move under the umbrella of the new Project Jupyter name,
91 Language-agnostic projects (notebook, qtconsole, etc.) will move under the umbrella of the new Project Jupyter name,
92 while Python-specific projects (interactive Python shell, Python kernel, IPython.parallel)
92 while Python-specific projects (interactive Python shell, Python kernel, IPython.parallel)
93 will remain under IPython, and be split into a few smaller packages.
93 will remain under IPython, and be split into a few smaller packages.
94 To reflect this, IPython is in a bit of a transition state.
94 To reflect this, IPython is in a bit of a transition state.
95 The logo on the notebook is now the Jupyter logo.
95 The logo on the notebook is now the Jupyter logo.
96 When installing kernels system-wide, they go in a `jupyter` directory.
96 When installing kernels system-wide, they go in a `jupyter` directory.
97 We are going to do our best to ease this transition for users and developers.
97 We are going to do our best to ease this transition for users and developers.
98
98
99 Big changes are ahead.
99 Big changes are ahead.
100
100
101
101
102 Using different kernels
102 Using different kernels
103 -----------------------
103 -----------------------
104
104
105 .. image:: ../_images/kernel_selector_screenshot.png
105 .. image:: ../_images/kernel_selector_screenshot.png
106 :alt: Screenshot of 'new' dropdown showing different kernels
106 :alt: Screenshot of 'new' dropdown showing different kernels
107 :align: center
107 :align: center
108
108
109 You can now choose a kernel for a notebook within the user interface, rather
109 You can now choose a kernel for a notebook within the user interface, rather
110 than starting up a separate notebook server for each kernel you want to use. The
110 than starting up a separate notebook server for each kernel you want to use. The
111 syntax highlighting adapts to match the language you're working in.
111 syntax highlighting adapts to match the language you're working in.
112
112
113 Information about the kernel is stored in the notebook file, so when you open a
113 Information about the kernel is stored in the notebook file, so when you open a
114 notebook, it will automatically start the correct kernel.
114 notebook, it will automatically start the correct kernel.
115
115
116 It is also easier to use the Qt console and the terminal console with other
116 It is also easier to use the Qt console and the terminal console with other
117 kernels, using the --kernel flag::
117 kernels, using the --kernel flag::
118
118
119 ipython qtconsole --kernel bash
119 ipython qtconsole --kernel bash
120 ipython console --kernel bash
120 ipython console --kernel bash
121
121
122 # To list available kernels
122 # To list available kernels
123 ipython kernelspec list
123 ipython kernelspec list
124
124
125 Kernel authors should see :ref:`kernelspecs` for how to register their kernels
125 Kernel authors should see :ref:`kernelspecs` for how to register their kernels
126 with IPython so that these mechanisms work.
126 with IPython so that these mechanisms work.
127
127
128 Typing unicode identifiers
128 Typing unicode identifiers
129 --------------------------
129 --------------------------
130
130
131 .. image:: /_images/unicode_completion.png
131 .. image:: /_images/unicode_completion.png
132
132
133 Complex expressions can be much cleaner when written with a wider choice of
133 Complex expressions can be much cleaner when written with a wider choice of
134 characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier
134 characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier
135 to type those, using a feature from Julia. Type a backslash followed by a LaTeX
135 to type those, using a feature from Julia. Type a backslash followed by a LaTeX
136 style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±.
136 style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±.
137
137
138 Widget migration guide
138 Widget migration guide
139 ----------------------
139 ----------------------
140 The widget framework has a lot of backwards incompatible changes.
140 The widget framework has a lot of backwards incompatible changes.
141 For information about migrating widget notebooks and custom widgets to 3.0 refer
141 For information about migrating widget notebooks and custom widgets to 3.0 refer
142 to the :doc:`widget migration guide<version3_widget_migration>`.
142 to the :doc:`widget migration guide<version3_widget_migration>`.
143
143
144 Other new features
144 Other new features
145 ------------------
145 ------------------
146
146
147 * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a
147 * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a
148 ``placeholder`` attribute, for displaying placeholder text before the
148 ``placeholder`` attribute, for displaying placeholder text before the
149 user has typed anything.
149 user has typed anything.
150
150
151 * The :magic:`load` magic can now find the source for objects in the user namespace.
151 * The :magic:`load` magic can now find the source for objects in the user namespace.
152 To enable searching the namespace, use the ``-n`` option.
152 To enable searching the namespace, use the ``-n`` option.
153
153
154 .. sourcecode:: ipython
154 .. sourcecode:: ipython
155
155
156 In [1]: %load -n my_module.some_function
156 In [1]: %load -n my_module.some_function
157
157
158 * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle`
158 * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle`
159 method, which works like ``view.use_dill()``, but causes the ``cloudpickle``
159 method, which works like ``view.use_dill()``, but causes the ``cloudpickle``
160 module from PiCloud's `cloud`__ library to be used rather than dill or the
160 module from PiCloud's `cloud`__ library to be used rather than dill or the
161 builtin pickle module.
161 builtin pickle module.
162
162
163 __ https://pypi.python.org/pypi/cloud
163 __ https://pypi.python.org/pypi/cloud
164
164
165 * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook`
165 * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook`
166 as a commandline argument to nbconvert.
166 as a commandline argument to nbconvert.
167
167
168 * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This
168 * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This
169 clears the output from IPython notebooks.
169 clears the output from IPython notebooks.
170
170
171 * New preprocessor for nbconvert that executes all the code cells in a notebook.
171 * New preprocessor for nbconvert that executes all the code cells in a notebook.
172 To run a notebook and save its output in a new notebook::
172 To run a notebook and save its output in a new notebook::
173
173
174 ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed
174 ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed
175
175
176 * Consecutive stream (stdout/stderr) output is merged into a single output
176 * Consecutive stream (stdout/stderr) output is merged into a single output
177 in the notebook document.
177 in the notebook document.
178 Previously, all output messages were preserved as separate output fields in the JSON.
178 Previously, all output messages were preserved as separate output fields in the JSON.
179 Now, the same merge is applied to the stored output as the displayed output,
179 Now, the same merge is applied to the stored output as the displayed output,
180 improving document load time for notebooks with many small outputs.
180 improving document load time for notebooks with many small outputs.
181
181
182 * ``NotebookApp.webapp_settings`` is deprecated and replaced with
182 * ``NotebookApp.webapp_settings`` is deprecated and replaced with
183 the more informatively named ``NotebookApp.tornado_settings``.
183 the more informatively named ``NotebookApp.tornado_settings``.
184
184
185 * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings
185 * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings
186 between the slowest and fastest runs, since this might meant that the multiple
186 between the slowest and fastest runs, since this might meant that the multiple
187 runs are not independent of one another.
187 runs are not independent of one another.
188
188
189 * It's now possible to provide mechanisms to integrate IPython with other event
189 * It's now possible to provide mechanisms to integrate IPython with other event
190 loops, in addition to the ones we already support. This lets you run GUI code
190 loops, in addition to the ones we already support. This lets you run GUI code
191 in IPython with an interactive prompt, and to embed the IPython
191 in IPython with an interactive prompt, and to embed the IPython
192 kernel in GUI applications. See :doc:`/config/eventloops` for details. As part
192 kernel in GUI applications. See :doc:`/config/eventloops` for details. As part
193 of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs
193 of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs
194 in :mod:`IPython.lib.inputhook` have been deprecated in favour of
194 in :mod:`IPython.lib.inputhook` have been deprecated in favour of
195 :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`.
195 :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`.
196
196
197 * A ``ScrollManager`` was added to the notebook. The ``ScrollManager`` controls how the notebook document is scrolled using keyboard. Users can inherit from the ``ScrollManager`` or ``TargetScrollManager`` to customize how their notebook scrolls. The default ``ScrollManager`` is the ``SlideScrollManager``, which tries to scroll to the nearest slide or sub-slide cell.
197 * A ``ScrollManager`` was added to the notebook. The ``ScrollManager`` controls how the notebook document is scrolled using keyboard. Users can inherit from the ``ScrollManager`` or ``TargetScrollManager`` to customize how their notebook scrolls. The default ``ScrollManager`` is the ``SlideScrollManager``, which tries to scroll to the nearest slide or sub-slide cell.
198
198
199 * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been
199 * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been
200 added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`,
200 added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`,
201 but adds a button to explicitly run the interacted-with function, rather than
201 but adds a button to explicitly run the interacted-with function, rather than
202 doing it automatically for every change of the parameter widgets. This should
202 doing it automatically for every change of the parameter widgets. This should
203 be useful for long-running functions.
203 be useful for long-running functions.
204
204
205 * The ``%cython`` magic is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now.
205 * The ``%cython`` magic is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now.
206
206
207 * The Notebook application now offers integrated terminals on Unix platforms,
207 * The Notebook application now offers integrated terminals on Unix platforms,
208 intended for when it is used on a remote server. To enable these, install
208 intended for when it is used on a remote server. To enable these, install
209 the ``terminado`` Python package.
209 the ``terminado`` Python package.
210
210
211 * The Notebook application can now edit any plain text files, via a full-page CodeMirror instance.
211 * The Notebook application can now edit any plain text files, via a full-page CodeMirror instance.
212
212
213 * Setting the default highlighting language for nbconvert with the config option
213 * Setting the default highlighting language for nbconvert with the config option
214 ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects
214 ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects
215 metadata stored in the :ref:`kernel spec <kernelspecs>`.
215 metadata stored in the :ref:`kernel spec <kernelspecs>`.
216
216
217 * IPython can now be configured systemwide, with files in :file:`/etc/ipython`
217 * IPython can now be configured systemwide, with files in :file:`/etc/ipython`
218 or :file:`/usr/local/etc/ipython` on Unix systems,
218 or :file:`/usr/local/etc/ipython` on Unix systems,
219 or :file:`{%PROGRAMDATA%}\\ipython` on Windows.
219 or :file:`{%PROGRAMDATA%}\\ipython` on Windows.
220
220
221 * Added support for configurable user-supplied `Jinja
221 * Added support for configurable user-supplied `Jinja
222 <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to
222 <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to
223 directories containing template files can be specified via
223 directories containing template files can be specified via
224 ``NotebookApp.extra_template_paths``. User-supplied template directories
224 ``NotebookApp.extra_template_paths``. User-supplied template directories
225 searched first by the notebook, making it possible to replace existing
225 searched first by the notebook, making it possible to replace existing
226 templates with your own files.
226 templates with your own files.
227
227
228 For example, to replace the notebook's built-in ``error.html`` with your own,
228 For example, to replace the notebook's built-in ``error.html`` with your own,
229 create a directory like ``/home/my_templates`` and put your override template
229 create a directory like ``/home/my_templates`` and put your override template
230 at ``/home/my_templates/error.html``. To start the notebook with your custom
230 at ``/home/my_templates/error.html``. To start the notebook with your custom
231 error page enabled, you would run::
231 error page enabled, you would run::
232
232
233 ipython notebook '--extra_template_paths=["/home/my_templates/"]'
233 ipython notebook '--extra_template_paths=["/home/my_templates/"]'
234
234
235 It's also possible to override a template while also `inheriting
235 It's also possible to override a template while also `inheriting
236 <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that
236 <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that
237 template, by prepending ``templates/`` to the ``{% extends %}`` target of
237 template, by prepending ``templates/`` to the ``{% extends %}`` target of
238 your child template. This is useful when you only want to override a
238 your child template. This is useful when you only want to override a
239 specific block of a template. For example, to add additional CSS to the
239 specific block of a template. For example, to add additional CSS to the
240 built-in ``error.html``, you might create an override that looks like::
240 built-in ``error.html``, you might create an override that looks like::
241
241
242 {% extends "templates/error.html" %}
242 {% extends "templates/error.html" %}
243
243
244 {% block stylesheet %}
244 {% block stylesheet %}
245 {{super()}}
245 {{super()}}
246 <style type="text/css">
246 <style type="text/css">
247 /* My Awesome CSS */
247 /* My Awesome CSS */
248 </style>
248 </style>
249 {% endblock %}
249 {% endblock %}
250
250
251 * Added a widget persistence API. This allows you to persist your notebooks interactive widgets.
251 * Added a widget persistence API. This allows you to persist your notebooks interactive widgets.
252 Two levels of control are provided:
252 Two levels of control are provided:
253 1. Higher level- ``WidgetManager.set_state_callbacks`` allows you to register callbacks for loading and saving widget state. The callbacks you register are automatically called when necessary.
253 1. Higher level- ``WidgetManager.set_state_callbacks`` allows you to register callbacks for loading and saving widget state. The callbacks you register are automatically called when necessary.
254 2. Lower level- the ``WidgetManager`` Javascript class now has ``get_state`` and ``set_state`` methods that allow you to get and set the state of the widget runtime.
254 2. Lower level- the ``WidgetManager`` Javascript class now has ``get_state`` and ``set_state`` methods that allow you to get and set the state of the widget runtime.
255
255
256 Example code for persisting your widget state to session data::
256 Example code for persisting your widget state to session data::
257
257
258 %%javascript
258 %%javascript
259 require(['widgets/js/manager'], function(manager) {
259 require(['widgets/js/manager'], function(manager) {
260 manager.WidgetManager.set_state_callbacks(function() { // Load
260 manager.WidgetManager.set_state_callbacks(function() { // Load
261 return JSON.parse(sessionStorage.widgets_state || '{}');
261 return JSON.parse(sessionStorage.widgets_state || '{}');
262 }, function(state) { // Save
262 }, function(state) { // Save
263 sessionStorage.widgets_state = JSON.stringify(state);
263 sessionStorage.widgets_state = JSON.stringify(state);
264 });
264 });
265 });
265 });
266
266
267 * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no
267 * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no
268 arguments displays all environment variables and values. Additionally,
268 arguments displays all environment variables and values. Additionally,
269 :magic:`env` can be used to get or set individual environment variables. To
269 :magic:`env` can be used to get or set individual environment variables. To
270 display an individual value, use the `%env var` syntax. To set a value, use
270 display an individual value, use the `%env var` syntax. To set a value, use
271 `env var val` or `env var=val`. Python value expansion using `$` works as usual.
271 `env var val` or `env var=val`. Python value expansion using `$` works as usual.
272
272
273
273
274 Backwards incompatible changes
274 Backwards incompatible changes
275 ------------------------------
275 ------------------------------
276
276
277 * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5.
277 * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5.
278 Adapters are included, so IPython frontends can still talk to kernels that
278 Adapters are included, so IPython frontends can still talk to kernels that
279 implement protocol version 4.
279 implement protocol version 4.
280
280
281 * The :ref:`notebook format <nbformat>` has been updated from version 3 to version 4.
281 * The notebook format has been updated from version 3 to version 4.
282 Read-only support for v4 notebooks has been backported to IPython 2.4.
282 Read-only support for v4 notebooks has been backported to IPython 2.4.
283 Notable changes:
283 Notable changes:
284
284
285 * heading cells are removed in favor or markdown headings
285 * heading cells are removed in favor or markdown headings
286 * notebook outputs and output messages are more consistent with each other
286 * notebook outputs and output messages are more consistent with each other
287 * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write`
287 * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write`
288 to read and write notebook files
288 to read and write notebook files
289 instead of the deprecated :mod:`IPython.nbformat.current` APIs.
289 instead of the deprecated :mod:`IPython.nbformat.current` APIs.
290
290
291 You can downgrade a notebook to v3 via ``nbconvert``::
291 You can downgrade a notebook to v3 via ``nbconvert``::
292
292
293 ipython nbconvert --to notebook --nbformat 3 <notebook>
293 ipython nbconvert --to notebook --nbformat 3 <notebook>
294
294
295 which will create :file:`notebook.v3.ipynb`, a copy of the notebook in v3 format.
295 which will create :file:`notebook.v3.ipynb`, a copy of the notebook in v3 format.
296
296
297 * :func:`IPython.core.oinspect.getsource` call specification has changed:
297 * :func:`IPython.core.oinspect.getsource` call specification has changed:
298
298
299 * `oname` keyword argument has been added for property source formatting
299 * `oname` keyword argument has been added for property source formatting
300 * `is_binary` keyword argument has been dropped, passing ``True`` had
300 * `is_binary` keyword argument has been dropped, passing ``True`` had
301 previously short-circuited the function to return ``None`` unconditionally
301 previously short-circuited the function to return ``None`` unconditionally
302
302
303 * Removed the octavemagic extension: it is now available as ``oct2py.ipython``.
303 * Removed the octavemagic extension: it is now available as ``oct2py.ipython``.
304
304
305 * Creating PDFs with LaTeX no longer uses a post processor.
305 * Creating PDFs with LaTeX no longer uses a post processor.
306 Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`.
306 Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`.
307
307
308 * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3.
308 * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3.
309
309
310 Additional changes:
310 Additional changes:
311
311
312 - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`)
312 - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`)
313 - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less`
313 - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less`
314 - Set `#header` div `margin-bottom: 0px;`
314 - Set `#header` div `margin-bottom: 0px;`
315 - Set `#menus` to `float: left;`
315 - Set `#menus` to `float: left;`
316 - Set `#maintoolbar .navbar-text` to `float: none;`
316 - Set `#maintoolbar .navbar-text` to `float: none;`
317 - Added no-padding convenience class.
317 - Added no-padding convenience class.
318 - Set border of #maintoolbar to 0px
318 - Set border of #maintoolbar to 0px
319
319
320 * Accessing the `container` DOM object when displaying javascript has been
320 * Accessing the `container` DOM object when displaying javascript has been
321 deprecated in IPython 2.0 in favor of accessing `element`. Starting with
321 deprecated in IPython 2.0 in favor of accessing `element`. Starting with
322 IPython 3.0 trying to access `container` will raise an error in browser
322 IPython 3.0 trying to access `container` will raise an error in browser
323 javascript console.
323 javascript console.
324
324
325 * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all
325 * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all
326 the same functionality.
326 the same functionality.
327
327
328 * The NotebookManager and ``/api/notebooks`` service has been replaced by
328 * The NotebookManager and ``/api/notebooks`` service has been replaced by
329 a more generic ContentsManager and ``/api/contents`` service,
329 a more generic ContentsManager and ``/api/contents`` service,
330 which supports all kinds of files.
330 which supports all kinds of files.
331 * The Dashboard now lists all files, not just notebooks and directories.
331 * The Dashboard now lists all files, not just notebooks and directories.
332 * The ``--script`` hook for saving notebooks to Python scripts is removed,
332 * The ``--script`` hook for saving notebooks to Python scripts is removed,
333 use :samp:`ipython nbconvert --to python {notebook}` instead.
333 use :samp:`ipython nbconvert --to python {notebook}` instead.
334
334
335 * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See
335 * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See
336 :mod:`rpy2.ipython.rmagic`.
336 :mod:`rpy2.ipython.rmagic`.
337
337
338 * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd`
338 * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd`
339 no longer accept a ``executable`` parameter. Use the kernelspec machinery instead.
339 no longer accept a ``executable`` parameter. Use the kernelspec machinery instead.
340
340
341 * The widget classes have been renamed from `*Widget` to `*`. The old names are
341 * The widget classes have been renamed from `*Widget` to `*`. The old names are
342 still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed
342 still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed
343 to `IntSlider`.
343 to `IntSlider`.
344 * The ContainerWidget was renamed to Box and no longer defaults as a flexible
344 * The ContainerWidget was renamed to Box and no longer defaults as a flexible
345 box in the web browser. A new FlexBox widget was added, which allows you to
345 box in the web browser. A new FlexBox widget was added, which allows you to
346 use the flexible box model.
346 use the flexible box model.
347
347
348 * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate
348 * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate
349 `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a
349 `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a
350 `channel` key in the message dict, for both send and recv.
350 `channel` key in the message dict, for both send and recv.
351
351
352
352
353 Content Security Policy
353 Content Security Policy
354 ```````````````````````
354 ```````````````````````
355
355
356 The Content Security Policy is a web standard for adding a layer of security to
356 The Content Security Policy is a web standard for adding a layer of security to
357 detect and mitigate certain classes of attacks, including Cross Site Scripting
357 detect and mitigate certain classes of attacks, including Cross Site Scripting
358 (XSS) and data injection attacks. This was introduced into the notebook to
358 (XSS) and data injection attacks. This was introduced into the notebook to
359 ensure that the IPython Notebook and its APIs (by default) can only be embedded
359 ensure that the IPython Notebook and its APIs (by default) can only be embedded
360 in an iframe on the same origin.
360 in an iframe on the same origin.
361
361
362 Override ``headers['Content-Security-Policy']`` within your notebook
362 Override ``headers['Content-Security-Policy']`` within your notebook
363 configuration to extend for alternate domains and security settings.::
363 configuration to extend for alternate domains and security settings.::
364
364
365 c.NotebookApp.tornado_settings = {
365 c.NotebookApp.tornado_settings = {
366 'headers': {
366 'headers': {
367 'Content-Security-Policy': "frame-ancestors 'self'"
367 'Content-Security-Policy': "frame-ancestors 'self'"
368 }
368 }
369 }
369 }
370
370
371 Example policies::
371 Example policies::
372
372
373 Content-Security-Policy: default-src 'self' https://*.jupyter.org
373 Content-Security-Policy: default-src 'self' https://*.jupyter.org
374
374
375 Matches embeddings on any subdomain of jupyter.org, so long as they are served
375 Matches embeddings on any subdomain of jupyter.org, so long as they are served
376 over SSL.
376 over SSL.
377
377
378 There is a `report-uri <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#report-uri>`_ endpoint available for logging CSP violations, located at
378 There is a `report-uri <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#report-uri>`_ endpoint available for logging CSP violations, located at
379 ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP::
379 ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP::
380
380
381 c.NotebookApp.tornado_settings = {
381 c.NotebookApp.tornado_settings = {
382 'headers': {
382 'headers': {
383 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report"
383 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report"
384 }
384 }
385 }
385 }
386
386
387 It simply provides the CSP report as a warning in IPython's logs. The default
387 It simply provides the CSP report as a warning in IPython's logs. The default
388 CSP sets this report-uri relative to the ``base_url`` (not shown above).
388 CSP sets this report-uri relative to the ``base_url`` (not shown above).
389
389
390 For a more thorough and accurate guide on Content Security Policies, check out
390 For a more thorough and accurate guide on Content Security Policies, check out
391 `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples.
391 `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples.
General Comments 0
You need to be logged in to leave comments. Login now