Debian Codegraph @

docs/source/whatsnew/version2.0.rst

raw
1 ============
2 2.x Series
3 ============
4
5 Release 2.4
6 ===========
7
8 January, 2014
9
10 .. note::
11
12 Some of the patches marked for 2.4 were left out of 2.4.0.
13 Please use 2.4.1.
14
15 - backport read support for nbformat v4 from IPython 3
16 - support for PyQt5 in the kernel (not QtConsole)
17 - support for Pygments 2.0
18
19 For more information on what fixes have been backported to 2.4,
20 see our :ref:`detailed release info <issues_list_200>`.
21
22
23 Release 2.3.1
24 =============
25
26 November, 2014
27
28 - Fix CRCRLF line-ending bug in notebooks on Windows
29
30 For more information on what fixes have been backported to 2.3.1,
31 see our :ref:`detailed release info <issues_list_200>`.
32
33 Release 2.3.0
34 =============
35
36 October, 2014
37
38 - improve qt5 support
39 - prevent notebook data loss with atomic writes
40
41 For more information on what fixes have been backported to 2.3,
42 see our :ref:`detailed release info <issues_list_200>`.
43
44 Release 2.2.0
45 =============
46
47 August, 2014
48
49 - Add CORS configuration
50
51 For more information on what fixes have been backported to 2.2,
52 see our :ref:`detailed release info <issues_list_200>`.
53
54 Release 2.1.0
55 =============
56
57 May, 2014
58
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,
61 see our :ref:`detailed release info
62 <issues_list_200>`.
63
64
65 Release 2.0.0
66 =============
67
68 April, 2014
69
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.
72
73 The principal milestones of 2.0 are:
74
75 - interactive widgets for the notebook
76 - directory navigation in the notebook dashboard
77 - persistent URLs for notebooks
78 - a new modal user interface in the notebook
79 - a security model for notebooks
80
81 Contribution summary since IPython 1.0 in August, 2013:
82
83 - ~8 months of work
84 - ~650 pull requests merged
85 - ~400 issues closed (non-pull requests)
86 - contributions from ~100 authors
87 - ~4000 commits
88
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
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.
93
94 New stuff in the IPython notebook
95 ---------------------------------
96
97 Directory navigation
98 ********************
99
100 .. image:: /_images/2.0/treeview.png
101 :width: 392px
102 :alt: Directory navigation
103 :align: center
104
105 The IPython notebook dashboard allows navigation into subdirectories.
106 URLs are persistent based on the notebook's path and name,
107 so no more random UUID URLs.
108
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.
111
112 Interactive widgets
113 *******************
114
115 .. image:: /_images/2.0/widgets.png
116 :width: 392px
117 :alt: Interactive widgets
118 :align: center
119
120 IPython 2.0 adds :mod:`IPython.html.widgets`, for manipulating
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,
123 and an API designed for developers to build more complex widgets.
124 See the `widget docs`_ for more information.
125
126 .. _widget docs: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Index.ipynb
127
128
129 Modal user interface
130 ********************
131
132 The notebook has added separate Edit and Command modes,
133 allowing easier keyboard commands and making keyboard shortcut customization possible.
134 See the new `User Interface notebook`_ for more information.
135
136 .. _User Interface Notebook: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/User%20Interface.ipynb
137
138
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
141 which can be started from the Help menu.
142
143 .. image:: /_images/2.0/user-interface.png
144 :width: 392px
145 :alt: Interface tour
146 :align: center
147
148
149 Security
150 ********
151
152 2.0 introduces a security model for notebooks,
153 to prevent untrusted code from executing on users' behalf when notebooks open.
154 A quick summary of the model:
155
156 - Trust is determined by signing notebooks.
157 - Untrusted HTML output is sanitized.
158 - Untrusted Javascript is never executed.
159 - HTML and Javascript in Markdown are never trusted.
160
161 Dashboard "Running" tab
162 ***********************
163
164 .. image:: /_images/2.0/running-crop.png
165 :width: 392px
166 :alt: Running tab
167 :align: center
168
169 The dashboard now has a "Running" tab which shows all of the running notebooks.
170
171 Single codebase Python 3 support
172 --------------------------------
173
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
176 and 3.3.
177
178 Selecting matplotlib figure formats
179 -----------------------------------
180
181 Deprecate single-format ``InlineBackend.figure_format``
182 configurable in favor of ``InlineBackend.figure_formats``,
183 which is a set, supporting multiple simultaneous figure formats (e.g. png, pdf).
184
185 This is available at runtime with the new API function :func:`IPython.display.set_matplotlib_formats`.
186
187 clear_output changes
188 --------------------
189
190 * There is no longer a 500ms delay when calling ``clear_output``.
191 * The ability to clear stderr and stdout individually was removed.
192 * A new ``wait`` flag that prevents ``clear_output`` from being executed until new
193 output is available. This eliminates animation flickering by allowing the
194 user to double buffer the output.
195 * The output div height is remembered when the ``wait=True`` flag is used.
196
197 Extending configurable containers
198 ---------------------------------
199
200 Some configurable traits are containers (list, dict, set)
201 Config objects now support calling ``extend``, ``update``, ``insert``, etc.
202 on traits in config files, which will ultimately result in calling
203 those methods on the original object.
204
205 The effect being that you can now add to containers without having to copy/paste
206 the initial value::
207
208 c = get_config()
209 c.InlineBackend.rc.update({ 'figure.figsize' : (6, 4) })
210
211 Changes to hidden namespace on startup
212 --------------------------------------
213
214 Previously, all names declared in code run at startup
215 (startup files, ``ipython -i script.py``, etc.)
216 were added to the hidden namespace, which hides the names from tools like ``%whos``.
217 There are two changes to this behavior:
218
219 1. Scripts run on the command-line ``ipython -i script.py``now behave the same as if they were
220 passed to ``%run``, so their variables are never hidden.
221 2. A boolean config flag ``InteractiveShellApp.hide_initial_ns`` has been added to optionally
222 disable the hidden behavior altogether. The default behavior is unchanged.
223
224 Using dill to expand serialization support
225 ------------------------------------------
226
227 The new function :func:`~IPython.utils.pickleutil.use_dill` allows
228 dill to extend serialization support in :mod:`IPython.parallel` (closures, etc.).
229 A :meth:`DirectView.use_dill` convenience method was also added, to enable dill
230 locally and on all engines with one call.
231
232 New IPython console lexer
233 -------------------------
234
235 The IPython console lexer has been rewritten and now supports tracebacks
236 and customized input/output prompts.
237
238 DisplayFormatter changes
239 ------------------------
240
241 There was no official way to query or remove callbacks in the Formatter API.
242 To remedy this, the following methods are added to :class:`BaseFormatter`:
243
244 - ``lookup(instance)`` - return appropriate callback or a given object
245 - ``lookup_by_type(type_or_str)`` - return appropriate callback for a given type or ``'mod.name'`` type string
246 - ``pop(type_or_str)`` - remove a type (by type or string).
247 Pass a second argument to avoid KeyError (like dict).
248
249 All of the above methods raise a KeyError if no match is found.
250
251 And the following methods are changed:
252
253 - ``for_type(type_or_str)`` - behaves the same as before, only adding support for ``'mod.name'``
254 type strings in addition to plain types. This removes the need for ``for_type_by_name()``,
255 but it remains for backward compatibility.
256
257 Formatters can now raise NotImplementedError in addition to returning None
258 to indicate that they cannot format a given object.
259
260 Exceptions and Warnings
261 ***********************
262
263 Exceptions are no longer silenced when formatters fail.
264 Instead, these are turned into a :class:`~IPython.core.formatters.FormatterWarning`.
265 A FormatterWarning will also be issued if a formatter returns data of an invalid type
266 (e.g. an integer for 'image/png').
267
268
269 Other changes
270 -------------
271
272 * `%%capture` cell magic now captures the rich display output, not just
273 stdout/stderr
274
275 * In notebook, Showing tooltip on tab has been disables to avoid conflict with
276 completion, Shift-Tab could still be used to invoke tooltip when inside
277 function signature and/or on selection.
278
279 * ``object_info_request`` has been replaced by ``object_info`` for consistency in the javascript API.
280 ``object_info`` is a simpler interface to register callback that is incompatible with ``object_info_request``.
281
282 * Previous versions of IPython on Linux would use the XDG config directory,
283 creating :file:`~/.config/ipython` by default. We have decided to go
284 back to :file:`~/.ipython` for consistency among systems. IPython will
285 issue a warning if it finds the XDG location, and will move it to the new
286 location if there isn't already a directory there.
287
288 * Equations, images and tables are now centered in Markdown cells.
289 * Multiline equations are now centered in output areas; single line equations
290 remain left justified.
291
292 * IPython config objects can be loaded from and serialized to JSON.
293 JSON config file have the same base name as their ``.py`` counterpart,
294 and will be loaded with higher priority if found.
295
296 * bash completion updated with support for all ipython subcommands and flags, including nbconvert
297
298 * ``ipython history trim``: added ``--keep=<N>`` as an alias for the more verbose
299 ``--HistoryTrim.keep=<N>``
300 * New ``ipython history clear`` subcommand, which is the same as the newly supported
301 ``ipython history trim --keep=0``
302
303 * You can now run notebooks in an interactive session via ``%run notebook.ipynb``.
304
305 * Print preview is back in the notebook menus, along with options to
306 download the open notebook in various formats. This is powered by
307 nbconvert.
308
309 * :exc:`~IPython.nbconvert.utils.pandoc.PandocMissing` exceptions will be
310 raised if Pandoc is unavailable, and warnings will be printed if the version
311 found is too old. The recommended Pandoc version for use with nbconvert is
312 1.12.1.
313
314 * The InlineBackend.figure_format now supports JPEG output if PIL/Pillow is available.
315
316 * Input transformers (see :doc:`/config/inputtransforms`) may now raise
317 :exc:`SyntaxError` if they determine that input is invalid. The input
318 transformation machinery in IPython will handle displaying the exception to
319 the user and resetting state.
320
321 * Calling ``container.show()`` on javascript display is deprecated and will
322 trigger errors on future IPython notebook versions. ``container`` now show
323 itself as soon as non-empty
324
325 * Added ``InlineBackend.print_figure_kwargs`` to allow passing keyword arguments
326 to matplotlib's ``Canvas.print_figure``. This can be used to change the value of
327 ``bbox_inches``, which is 'tight' by default, or set the quality of JPEG figures.
328
329 * A new callback system has been introduced. For details, see :doc:`/config/callbacks`.
330
331 * jQuery and require.js are loaded from CDNs in the default HTML template,
332 so javascript is available in static HTML export (e.g. nbviewer).
333
334 Backwards incompatible changes
335 ------------------------------
336
337 * Python 2.6 and 3.2 are no longer supported: the minimum required
338 Python versions are now 2.7 and 3.3.
339 * The Transformer classes have been renamed to Preprocessor in nbconvert and
340 their ``call`` methods have been renamed to ``preprocess``.
341 * The ``call`` methods of nbconvert post-processors have been renamed to
342 ``postprocess``.
343
344 * The module ``IPython.core.fakemodule`` has been removed.
345
346 * The alias system has been reimplemented to use magic functions. There should be little
347 visible difference while automagics are enabled, as they are by default, but parts of the
348 :class:`~IPython.core.alias.AliasManager` API have been removed.
349
350 * We fixed an issue with switching between matplotlib inline and GUI backends,
351 but the fix requires matplotlib 1.1 or newer. So from now on, we consider
352 matplotlib 1.1 to be the minimally supported version for IPython. Older
353 versions for the most part will work, but we make no guarantees about it.
354
355 * The :command:`pycolor` command has been removed. We recommend the much more capable
356 :command:`pygmentize` command from the `Pygments <http://pygments.org/>`_ project.
357 If you need to keep the exact output of :command:`pycolor`, you can still use
358 ``python -m IPython.utils.PyColorize foo.py``.
359
360 * :mod:`IPython.lib.irunner` and its command-line entry point have been removed.
361 It had fallen out of use long ago.
362
363 * The ``input_prefilter`` hook has been removed, as it was never
364 actually used by the code. The input transformer system offers much
365 more powerful APIs to work with input code. See
366 :doc:`/config/inputtransforms` for details.
367
368 * :class:`IPython.core.inputsplitter.IPythonInputSplitter` no longer has a method
369 ``source_raw_reset()``, but gains :meth:`~IPython.core.inputsplitter.IPythonInputSplitter.raw_reset`
370 instead. Use of ``source_raw_reset`` can be replaced with::
371
372 raw = isp.source_raw
373 transformed = isp.source_reset()
374
375 * The Azure notebook manager was removed as it was no longer compatible with the notebook storage scheme.
376
377 * Simplifying configurable URLs
378
379 - base_project_url is renamed to base_url (base_project_url is kept as a deprecated alias, for now)
380 - base_kernel_url configurable is removed (use base_url)
381 - websocket_url configurable is removed (use base_url)