##// END OF EJS Templates
add zero-import get_ipython example
MinRK -
Show More
@@ -1,277 +1,287 b''
1 ============
1 ============
2 1.0 Series
2 1.0 Series
3 ============
3 ============
4
4
5 Release 1.0
5 Release 1.0
6 ===========
6 ===========
7
7
8 IPython 1.0 requires Python β‰₯ 2.6.5 or β‰₯ 3.2.1.
8 IPython 1.0 requires Python β‰₯ 2.6.5 or β‰₯ 3.2.1.
9 It does not support Python 3.0, 3.1, or 2.5.
9 It does not support Python 3.0, 3.1, or 2.5.
10
10
11 This is a big release. The principal milestone is the addition of :mod:`IPython.nbconvert`,
11 This is a big release. The principal milestone is the addition of :mod:`IPython.nbconvert`,
12 but there has been a great deal of work improving all parts of IPython as well.
12 but there has been a great deal of work improving all parts of IPython as well.
13
13
14 The previous version (0.13) was released on June 30, 2012,
14 The previous version (0.13) was released on June 30, 2012,
15 and in this development cycle we had:
15 and in this development cycle we had:
16
16
17 - ~12 months of work.
17 - ~12 months of work.
18 - ~700 pull requests merged.
18 - ~700 pull requests merged.
19 - ~600 issues closed (non-pull requests).
19 - ~600 issues closed (non-pull requests).
20 - contributions from ~150 authors.
20 - contributions from ~150 authors.
21 - ~4000 commits.
21 - ~4000 commits.
22
22
23 The amount of work included in this release is so large that we can only cover
23 The amount of work included in this release is so large that we can only cover
24 here the main highlights; please see our :ref:`detailed release statistics
24 here the main highlights; please see our :ref:`detailed release statistics
25 <issues_list_100>` for links to every issue and pull request closed on GitHub
25 <issues_list_100>` for links to every issue and pull request closed on GitHub
26 as well as a full list of individual contributors.
26 as well as a full list of individual contributors.
27 It includes
27 It includes
28
28
29 Reorganization
29 Reorganization
30 --------------
30 --------------
31
31
32 There have been two major reorganizations in IPython 1.0:
32 There have been two major reorganizations in IPython 1.0:
33
33
34 - Added :mod:`IPython.kernel` for all kernel-related code.
34 - Added :mod:`IPython.kernel` for all kernel-related code.
35 This means that :mod:`IPython.zmq` has been removed,
35 This means that :mod:`IPython.zmq` has been removed,
36 and much of it is now in :mod:`IPython.kernel.zmq`,
36 and much of it is now in :mod:`IPython.kernel.zmq`,
37 some of it being in the top-level :mod:`IPython.kernel`.
37 some of it being in the top-level :mod:`IPython.kernel`.
38 - We have removed the `frontend` subpackage,
38 - We have removed the `frontend` subpackage,
39 as it caused unnecessary depth. So what was :mod:`IPython.frontend.qt`
39 as it caused unnecessary depth. So what was :mod:`IPython.frontend.qt`
40 is now :mod:`IPython.qt`, and so on. The one difference is that
40 is now :mod:`IPython.qt`, and so on. The one difference is that
41 the notebook has been further flattened, so that
41 the notebook has been further flattened, so that
42 :mod:`IPython.frontend.html.notebook` is now just `IPython.html`.
42 :mod:`IPython.frontend.html.notebook` is now just `IPython.html`.
43 There is a shim module, so :mod:`IPython.frontend` is still
43 There is a shim module, so :mod:`IPython.frontend` is still
44 importable in 1.0, but there will be a warning.
44 importable in 1.0, but there will be a warning.
45 - The IPython sphinx directives are now installed in :mod:`IPython.sphinx`,
45 - The IPython sphinx directives are now installed in :mod:`IPython.sphinx`,
46 so they can be imported by other projects.
46 so they can be imported by other projects.
47
47
48
48
49 Public APIs
49 Public APIs
50 -----------
50 -----------
51
51
52 For the first time since 0.10 (sorry, everyone),
52 For the first time since 0.10 (sorry, everyone),
53 there is an official public API for starting IPython:
53 there is an official public API for starting IPython:
54
54
55 .. sourcecode:: python
55 .. sourcecode:: python
56
56
57 from IPython import start_ipython
57 from IPython import start_ipython
58 start_ipython()
58 start_ipython()
59
59
60 This is what packages should use that start their own IPython session,
60 This is what packages should use that start their own IPython session,
61 but don't actually want embedded IPython (most cases).
61 but don't actually want embedded IPython (most cases).
62
62
63 We also have added:
63 We also have added:
64
64
65 .. sourcecode:: python
65 .. sourcecode:: python
66
66
67 from IPython import get_ipython
67 from IPython import get_ipython
68
68
69
69
70 Which is a *library* function for getting the current IPython instance,
70 Which is a *library* function for getting the current IPython instance,
71 and will return ``None`` if no IPython instance is running.
71 and will return ``None`` if no IPython instance is running.
72 This is the official way to check whether your code is called from inside an IPython session.
72 This is the official way to check whether your code is called from inside an IPython session.
73 If you want to check for IPython without unnecessarily importing IPython,
74 use this function:
73
75
76 .. sourcecode:: python
77
78 def get_ipython():
79 """return IPython instance if there is one, None otherwise"""
80 import sys
81 if "IPython" in sys.modules:
82 import IPython
83 return IPython.get_ipython()
74
84
75 Core
85 Core
76 ----
86 ----
77
87
78 - The input transformation framework has been reworked. This fixes some corner
88 - The input transformation framework has been reworked. This fixes some corner
79 cases, and adds more flexibility for projects which use IPython, like SymPy &
89 cases, and adds more flexibility for projects which use IPython, like SymPy &
80 SAGE. For more details, see :doc:`/config/inputtransforms`.
90 SAGE. For more details, see :doc:`/config/inputtransforms`.
81 - Exception types can now be displayed with a custom traceback, by defining a
91 - Exception types can now be displayed with a custom traceback, by defining a
82 ``_render_traceback_()`` method which returns a list of strings, each
92 ``_render_traceback_()`` method which returns a list of strings, each
83 containing one line of the traceback.
93 containing one line of the traceback.
84 - A new command, ``ipython history trim`` can be used to delete everything but
94 - A new command, ``ipython history trim`` can be used to delete everything but
85 the last 1000 entries in the history database.
95 the last 1000 entries in the history database.
86 - ``__file__`` is defined in both config files at load time,
96 - ``__file__`` is defined in both config files at load time,
87 and ``.ipy`` files executed with ``%run``.
97 and ``.ipy`` files executed with ``%run``.
88 - ``%logstart`` and ``%logappend`` are no longer broken.
98 - ``%logstart`` and ``%logappend`` are no longer broken.
89 - Add glob expansion for ``%run``, e.g. ``%run -g script.py *.txt``.
99 - Add glob expansion for ``%run``, e.g. ``%run -g script.py *.txt``.
90 - Expand variables (``$foo``) in Cell Magic argument line.
100 - Expand variables (``$foo``) in Cell Magic argument line.
91 - By default, :command:`iptest` will exclude various slow tests.
101 - By default, :command:`iptest` will exclude various slow tests.
92 All tests can be run with :command:`iptest --all`.
102 All tests can be run with :command:`iptest --all`.
93 - SQLite history can be disabled in the various cases that it does not behave well.
103 - SQLite history can be disabled in the various cases that it does not behave well.
94 - ``%edit`` works on interactively defined variables.
104 - ``%edit`` works on interactively defined variables.
95 - editor hooks have been restored from quarantine, enabling TextMate as editor,
105 - editor hooks have been restored from quarantine, enabling TextMate as editor,
96 etc.
106 etc.
97 - The env variable PYTHONSTARTUP is respected by IPython.
107 - The env variable PYTHONSTARTUP is respected by IPython.
98 - A ``%matplotlib`` magic is added, which is like the old ``%pylab`` magic,
108 - A ``%matplotlib`` magic is added, which is like the old ``%pylab`` magic,
99 but it does not import anything to the interactive namespace.
109 but it does not import anything to the interactive namespace.
100 It is recommended that users switch to ``%matplotlib`` and explicit imports.
110 It is recommended that users switch to ``%matplotlib`` and explicit imports.
101
111
102
112
103 Backwards incompatible changes
113 Backwards incompatible changes
104 ******************************
114 ******************************
105
115
106 - Calling :meth:`InteractiveShell.prefilter` will no longer perform static
116 - Calling :meth:`InteractiveShell.prefilter` will no longer perform static
107 transformations - the processing of escaped commands such as ``%magic`` and
117 transformations - the processing of escaped commands such as ``%magic`` and
108 ``!system``, and stripping input prompts from code blocks. This functionality
118 ``!system``, and stripping input prompts from code blocks. This functionality
109 was duplicated in :mod:`IPython.core.inputsplitter`, and the latter version
119 was duplicated in :mod:`IPython.core.inputsplitter`, and the latter version
110 was already what IPython relied on. A new API to transform input will be ready
120 was already what IPython relied on. A new API to transform input will be ready
111 before release.
121 before release.
112 - Functions from :mod:`IPython.lib.inputhook` to control integration with GUI
122 - Functions from :mod:`IPython.lib.inputhook` to control integration with GUI
113 event loops are no longer exposed in the top level of :mod:`IPython.lib`.
123 event loops are no longer exposed in the top level of :mod:`IPython.lib`.
114 Code calling these should make sure to import them from
124 Code calling these should make sure to import them from
115 :mod:`IPython.lib.inputhook`.
125 :mod:`IPython.lib.inputhook`.
116 - For all kernel managers, the ``sub_channel`` attribute has been renamed to
126 - For all kernel managers, the ``sub_channel`` attribute has been renamed to
117 ``iopub_channel``.
127 ``iopub_channel``.
118 - Users on Python versions before 2.6.6, 2.7.1 or 3.2 will now need to call
128 - Users on Python versions before 2.6.6, 2.7.1 or 3.2 will now need to call
119 :func:`IPython.utils.doctestreload.doctest_reload` to make doctests run
129 :func:`IPython.utils.doctestreload.doctest_reload` to make doctests run
120 correctly inside IPython. Python releases since those versions are unaffected.
130 correctly inside IPython. Python releases since those versions are unaffected.
121 For details, see :ghpull:`3068` and `Python issue 8048 <http://bugs.python.org/issue8048>`_.
131 For details, see :ghpull:`3068` and `Python issue 8048 <http://bugs.python.org/issue8048>`_.
122 - The ``InteractiveShell.cache_main_mod()`` method has been removed, and
132 - The ``InteractiveShell.cache_main_mod()`` method has been removed, and
123 :meth:`~IPython.core.interactiveshell.InteractiveShell.new_main_mod` has a
133 :meth:`~IPython.core.interactiveshell.InteractiveShell.new_main_mod` has a
124 different signature, expecting a filename where earlier versions expected
134 different signature, expecting a filename where earlier versions expected
125 a namespace. See :ghpull:`3555` for details.
135 a namespace. See :ghpull:`3555` for details.
126 - The short-lived plugin system has been removed. Extensions are the way to go.
136 - The short-lived plugin system has been removed. Extensions are the way to go.
127
137
128
138
129 NbConvert
139 NbConvert
130 ---------
140 ---------
131
141
132 The major milestone for IPython 1.0 is the addition of :mod:`IPython.nbconvert` - tools for converting
142 The major milestone for IPython 1.0 is the addition of :mod:`IPython.nbconvert` - tools for converting
133 IPython notebooks to various other formats.
143 IPython notebooks to various other formats.
134
144
135 .. warning::
145 .. warning::
136
146
137 nbconvert is Ξ±-level preview code in 1.0
147 nbconvert is Ξ±-level preview code in 1.0
138
148
139 To use nbconvert to convert various file formats::
149 To use nbconvert to convert various file formats::
140
150
141 ipython nbconvert --format full_html *.ipynb
151 ipython nbconvert --format full_html *.ipynb
142
152
143 See ``ipython nbconvert --help`` for more information.
153 See ``ipython nbconvert --help`` for more information.
144 nbconvert depends on `pandoc`_ for many of the translations to and from various formats.
154 nbconvert depends on `pandoc`_ for many of the translations to and from various formats.
145
155
146 .. _pandoc: http://johnmacfarlane.net/pandoc/
156 .. _pandoc: http://johnmacfarlane.net/pandoc/
147
157
148 Notebook
158 Notebook
149 --------
159 --------
150
160
151 Major changes to the IPython Notebook in 1.0:
161 Major changes to the IPython Notebook in 1.0:
152
162
153 - The notebook is now autosaved, by default at an interval of two minutes.
163 - The notebook is now autosaved, by default at an interval of two minutes.
154 When you press 'save' or Ctrl-S, a *checkpoint* is made, in a hidden folder.
164 When you press 'save' or Ctrl-S, a *checkpoint* is made, in a hidden folder.
155 This checkpoint can be restored, so that the autosave model is strictly safer
165 This checkpoint can be restored, so that the autosave model is strictly safer
156 than traditional save. If you change nothing about your save habits,
166 than traditional save. If you change nothing about your save habits,
157 you will always have a checkpoint that you have written,
167 you will always have a checkpoint that you have written,
158 and an autosaved file that is kept up to date.
168 and an autosaved file that is kept up to date.
159 - You can load custom javascript and CSS in the notebook by editing the files
169 - You can load custom javascript and CSS in the notebook by editing the files
160 :file:`$(ipython locate profile)/static/custom/custom.{js,css}`.
170 :file:`$(ipython locate profile)/static/custom/custom.{js,css}`.
161 - Add ``%%html``, ``%%svg``, ``%%javascript``, and ``%%latex`` cell magics
171 - Add ``%%html``, ``%%svg``, ``%%javascript``, and ``%%latex`` cell magics
162 for writing raw output in notebook cells.
172 for writing raw output in notebook cells.
163 - add a redirect handler and anchors on heading cells, so you can link
173 - add a redirect handler and anchors on heading cells, so you can link
164 across notebooks, directly to heading cells in other notebooks.
174 across notebooks, directly to heading cells in other notebooks.
165 - Images support width and height metadata,
175 - Images support width and height metadata,
166 and thereby 2x scaling (retina support).
176 and thereby 2x scaling (retina support).
167 - ``_repr_foo_`` methods can return a tuple of (data, metadata),
177 - ``_repr_foo_`` methods can return a tuple of (data, metadata),
168 where metadata is a dict containing metadata about the displayed object.
178 where metadata is a dict containing metadata about the displayed object.
169 This is used to set size, etc. for retina graphics. To enable retina matplotlib figures,
179 This is used to set size, etc. for retina graphics. To enable retina matplotlib figures,
170 simply set ``InlineBackend.figure_format = 'retina'`` for 2x PNG figures.
180 simply set ``InlineBackend.figure_format = 'retina'`` for 2x PNG figures.
171 - Add display.FileLink and FileLinks for quickly displaying HTML links to local files.
181 - Add display.FileLink and FileLinks for quickly displaying HTML links to local files.
172 - Cells have metadata, which can be edited via cell toolbars.
182 - Cells have metadata, which can be edited via cell toolbars.
173 This metadata can be used by external code (e.g. reveal.js or exporters),
183 This metadata can be used by external code (e.g. reveal.js or exporters),
174 when examining the notebook.
184 when examining the notebook.
175 - Fix an issue parsing LaTeX in markdown cells, which required users to type ``\\\``,
185 - Fix an issue parsing LaTeX in markdown cells, which required users to type ``\\\``,
176 instead of ``\\``.
186 instead of ``\\``.
177 - Notebook templates are rendered with Jinja instead of Tornado.
187 - Notebook templates are rendered with Jinja instead of Tornado.
178 - ``%%file`` has been renamed ``%%writefile`` (``%%file``) is deprecated.
188 - ``%%file`` has been renamed ``%%writefile`` (``%%file``) is deprecated.
179 - ANSI (and VT100) color parsing has been improved in both performance and
189 - ANSI (and VT100) color parsing has been improved in both performance and
180 supported values.
190 supported values.
181 - The static files path can be found as ``IPython.html.DEFAULT_STATIC_FILES_PATH``,
191 - The static files path can be found as ``IPython.html.DEFAULT_STATIC_FILES_PATH``,
182 which may be changed by package managers.
192 which may be changed by package managers.
183 - The notebook supports :func:`raw_input`, and thus also ``%debug``.
193 - The notebook supports :func:`raw_input`, and thus also ``%debug``.
184 - IPython's CSS is installed in :file:`static/css/style.min.css`
194 - IPython's CSS is installed in :file:`static/css/style.min.css`
185 (all style, including bootstrap), and :file:`static/css/ipython.min.css`,
195 (all style, including bootstrap), and :file:`static/css/ipython.min.css`,
186 which only has IPython's own CSS. The latter file should be useful for embedding
196 which only has IPython's own CSS. The latter file should be useful for embedding
187 IPython notebooks in other pages, blogs, etc.
197 IPython notebooks in other pages, blogs, etc.
188
198
189 Javascript Components
199 Javascript Components
190 *********************
200 *********************
191
201
192 The javascript components used in the notebook have been updated significantly.
202 The javascript components used in the notebook have been updated significantly.
193
203
194 - updates to jQuery (2.0) and jQueryUI (1.10)
204 - updates to jQuery (2.0) and jQueryUI (1.10)
195 - Update CodeMirror to 3.14
205 - Update CodeMirror to 3.14
196 - Twitter Bootstrap (2.3) for layout
206 - Twitter Bootstrap (2.3) for layout
197 - Font-Awesome (3.1) for icons
207 - Font-Awesome (3.1) for icons
198 - highlight.js (7.3) for syntax highlighting
208 - highlight.js (7.3) for syntax highlighting
199 - marked (0.2.8) for markdown rendering
209 - marked (0.2.8) for markdown rendering
200 - require.js (2.1) for loading javascript
210 - require.js (2.1) for loading javascript
201
211
202 Some relevant changes that are results of this:
212 Some relevant changes that are results of this:
203
213
204 - Markdown cells now support GitHub-flavored Markdown (GFM),
214 - Markdown cells now support GitHub-flavored Markdown (GFM),
205 which includes ``\`\`\`python`` code blocks and tables.
215 which includes ``\`\`\`python`` code blocks and tables.
206 - Notebook UI behaves better on more screen sizes.
216 - Notebook UI behaves better on more screen sizes.
207 - Various code cell input issues have been fixed.
217 - Various code cell input issues have been fixed.
208
218
209
219
210 Kernel
220 Kernel
211 ------
221 ------
212
222
213 The kernel code has been substantially reorganized.
223 The kernel code has been substantially reorganized.
214
224
215 New features in the kernel:
225 New features in the kernel:
216
226
217 - Kernels support ZeroMQ IPC transport, not just TCP
227 - Kernels support ZeroMQ IPC transport, not just TCP
218 - The message protocol has added a top-level metadata field,
228 - The message protocol has added a top-level metadata field,
219 used for information about messages.
229 used for information about messages.
220 - Add a `data_pub` message that functions much like `display_pub`,
230 - Add a `data_pub` message that functions much like `display_pub`,
221 but publishes raw (usually pickled) data, rather than representations.
231 but publishes raw (usually pickled) data, rather than representations.
222 - Ensure that ``sys.stdout.encoding`` is defined in Kernels.
232 - Ensure that ``sys.stdout.encoding`` is defined in Kernels.
223 - Stdout from forked subprocesses should be forwarded to frontends (instead of crashing).
233 - Stdout from forked subprocesses should be forwarded to frontends (instead of crashing).
224
234
225 IPEP 13
235 IPEP 13
226 *******
236 *******
227
237
228 The KernelManager has been split into a :class:`~.KernelManager` and a :class:`~.KernelClient`.
238 The KernelManager has been split into a :class:`~.KernelManager` and a :class:`~.KernelClient`.
229 The Manager owns a kernel and starts / signals / restarts it. There is always zero or one
239 The Manager owns a kernel and starts / signals / restarts it. There is always zero or one
230 KernelManager per Kernel. Clients communicate with Kernels via zmq channels,
240 KernelManager per Kernel. Clients communicate with Kernels via zmq channels,
231 and there can be zero-to-many Clients connected to a Kernel at any given time.
241 and there can be zero-to-many Clients connected to a Kernel at any given time.
232
242
233 The KernelManager now automatically restarts the kernel when it dies,
243 The KernelManager now automatically restarts the kernel when it dies,
234 rather than requiring user input at the notebook or QtConsole UI
244 rather than requiring user input at the notebook or QtConsole UI
235 (which may or may not exist at restart time).
245 (which may or may not exist at restart time).
236
246
237 In-process kernels
247 In-process kernels
238 ******************
248 ******************
239
249
240 The Python-language frontends, particularly the Qt console, may now communicate
250 The Python-language frontends, particularly the Qt console, may now communicate
241 with in-process kernels, in addition to the traditional out-of-process
251 with in-process kernels, in addition to the traditional out-of-process
242 kernels. An in-process kernel permits direct access to the kernel namespace,
252 kernels. An in-process kernel permits direct access to the kernel namespace,
243 which is necessary in some applications. It should be understood, however, that
253 which is necessary in some applications. It should be understood, however, that
244 the in-process kernel is not robust to bad user input and will block the main
254 the in-process kernel is not robust to bad user input and will block the main
245 (GUI) thread while executing. Developers must decide on a case-by-case basis
255 (GUI) thread while executing. Developers must decide on a case-by-case basis
246 whether this tradeoff is appropriate for their application.
256 whether this tradeoff is appropriate for their application.
247
257
248
258
249
259
250 Parallel
260 Parallel
251 --------
261 --------
252
262
253 IPython.parallel has had some refactoring as well.
263 IPython.parallel has had some refactoring as well.
254 There are many improvements and fixes, but these are the major changes:
264 There are many improvements and fixes, but these are the major changes:
255
265
256 - Connections have been simplified. All ports and the serialization in use
266 - Connections have been simplified. All ports and the serialization in use
257 are written to the connection file, rather than the initial two-stage system.
267 are written to the connection file, rather than the initial two-stage system.
258 - Serialization has been rewritten, fixing many bugs and dramatically improving
268 - Serialization has been rewritten, fixing many bugs and dramatically improving
259 performance serializing large containers.
269 performance serializing large containers.
260 - Load-balancing scheduler performance with large numbers of tasks has been dramatically improved.
270 - Load-balancing scheduler performance with large numbers of tasks has been dramatically improved.
261 - There should be fewer (hopefully zero) false-positives for engine failures.
271 - There should be fewer (hopefully zero) false-positives for engine failures.
262 - Increased compatibility with various use cases that produced serialization / argument errors
272 - Increased compatibility with various use cases that produced serialization / argument errors
263 with map, etc.
273 with map, etc.
264 - The controller can attempt to resume operation if it has crashed,
274 - The controller can attempt to resume operation if it has crashed,
265 by passing ``ipcontroller --restore``.
275 by passing ``ipcontroller --restore``.
266 - Engines can monitor the Hub heartbeat, and shutdown if the Hub disappears for too long.
276 - Engines can monitor the Hub heartbeat, and shutdown if the Hub disappears for too long.
267 - add HTCondor support in launchers
277 - add HTCondor support in launchers
268
278
269
279
270 QtConsole
280 QtConsole
271 ---------
281 ---------
272
282
273 Various fixes, including improved performance with lots of text output,
283 Various fixes, including improved performance with lots of text output,
274 and better drag and drop support.
284 and better drag and drop support.
275 The initial window size of the qtconsole is now configurable via ``IPythonWidget.width``
285 The initial window size of the qtconsole is now configurable via ``IPythonWidget.width``
276 and ``IPythonWidget.height``.
286 and ``IPythonWidget.height``.
277
287
General Comments 0
You need to be logged in to leave comments. Login now