| 1 |
============= |
| 2 |
0.13 Series |
| 3 |
============= |
| 4 |
|
| 5 |
Release 0.13 |
| 6 |
============ |
| 7 |
|
| 8 |
IPython 0.13 contains several major new features, as well as a large amount of |
| 9 |
bug and regression fixes. The previous version (0.12) was released on December |
| 10 |
19 2011, and in this development cycle we had: |
| 11 |
|
| 12 |
- ~6 months of work. |
| 13 |
- 373 pull requests merged. |
| 14 |
- 742 issues closed (non-pull requests). |
| 15 |
- contributions from 62 authors. |
| 16 |
- 1760 commits. |
| 17 |
- a diff of 114226 lines. |
| 18 |
|
| 19 |
The amount of work included in this release is so large, that we can only cover |
| 20 |
here the main highlights; please see our :ref:`detailed release statistics |
| 21 |
<issues_list_013>` for links to every issue and pull request closed on GitHub |
| 22 |
as well as a full list of individual contributors. |
| 23 |
|
| 24 |
|
| 25 |
Major Notebook improvements: new user interface and more |
| 26 |
-------------------------------------------------------- |
| 27 |
|
| 28 |
The IPython Notebook, which has proven since its release to be wildly popular, |
| 29 |
has seen a massive amount of work in this release cycle, leading to a |
| 30 |
significantly improved user experience as well as many new features. |
| 31 |
|
| 32 |
The first user-visible change is a reorganization of the user interface; the |
| 33 |
left panel has been removed and was replaced by a real menu system and a |
| 34 |
toolbar with icons. Both the toolbar and the header above the menu can be |
| 35 |
collapsed to leave an unobstructed working area: |
| 36 |
|
| 37 |
.. image:: ../_images/ipy_013_notebook_spectrogram.png |
| 38 |
:width: 460px |
| 39 |
:alt: New user interface for Notebook |
| 40 |
:align: center |
| 41 |
:target: ../_images/ipy_013_notebook_spectrogram.png |
| 42 |
|
| 43 |
The notebook handles very long outputs much better than before (this was a |
| 44 |
serious usability issue when running processes that generated massive amounts |
| 45 |
of output). Now, in the presence of outputs longer than ~100 lines, the |
| 46 |
notebook will automatically collapse to a scrollable area and the entire left |
| 47 |
part of this area controls the display: one click in this area will expand the |
| 48 |
output region completely, and a double-click will hide it completely. This |
| 49 |
figure shows both the scrolled and hidden modes: |
| 50 |
|
| 51 |
.. image:: ../_images/ipy_013_notebook_long_out.png |
| 52 |
:width: 460px |
| 53 |
:alt: Scrolling and hiding of long output in the notebook. |
| 54 |
:align: center |
| 55 |
:target: ../_images/ipy_013_notebook_long_out.png |
| 56 |
|
| 57 |
.. note:: |
| 58 |
|
| 59 |
The auto-folding of long outputs is disabled in Firefox due to bugs in its |
| 60 |
scrolling behavior. See :ghpull:`2047` for details. |
| 61 |
|
| 62 |
Uploading notebooks to the dashboard is now easier: in addition to drag and |
| 63 |
drop (which can be finicky sometimes), you can now click on the upload text and |
| 64 |
use a regular file dialog box to select notebooks to upload. Furthermore, the |
| 65 |
notebook dashboard now auto-refreshes its contents and offers buttons to shut |
| 66 |
down any running kernels (:ghpull:`1739`): |
| 67 |
|
| 68 |
.. image:: ../_images/ipy_013_dashboard.png |
| 69 |
:width: 460px |
| 70 |
:alt: Improved dashboard |
| 71 |
:align: center |
| 72 |
:target: ../_images/ipy_013_dashboard.png |
| 73 |
|
| 74 |
|
| 75 |
Cluster management |
| 76 |
~~~~~~~~~~~~~~~~~~ |
| 77 |
|
| 78 |
The notebook dashboard can now also start and stop clusters, thanks to a new |
| 79 |
tab in the dashboard user interface: |
| 80 |
|
| 81 |
.. image:: ../_images/ipy_013_dashboard_cluster.png |
| 82 |
:width: 460px |
| 83 |
:alt: Cluster management from the notebook dashboard |
| 84 |
:align: center |
| 85 |
:target: ../_images/ipy_013_dashboard_cluster.png |
| 86 |
|
| 87 |
This interface allows, for each profile you have configured, to start and stop |
| 88 |
a cluster (and optionally override the default number of engines corresponding |
| 89 |
to that configuration). While this hides all error reporting, once you have a |
| 90 |
configuration that you know works smoothly, it is a very convenient interface |
| 91 |
for controlling your parallel resources. |
| 92 |
|
| 93 |
|
| 94 |
New notebook format |
| 95 |
~~~~~~~~~~~~~~~~~~~ |
| 96 |
|
| 97 |
The notebooks saved now use version 3 of our format, which supports heading |
| 98 |
levels as well as the concept of 'raw' text cells that are not rendered as |
| 99 |
Markdown. These will be useful with converters_ we are developing, to pass raw |
| 100 |
markup (say LaTeX). That conversion code is still under heavy development and |
| 101 |
not quite ready for prime time, but we welcome help on this front so that we |
| 102 |
can merge it for full production use as soon as possible. |
| 103 |
|
| 104 |
.. _converters: https://github.com/ipython/nbconvert |
| 105 |
|
| 106 |
.. note:: |
| 107 |
|
| 108 |
v3 notebooks can *not* be read by older versions of IPython, but we provide |
| 109 |
a `simple script`_ that you can use in case you need to export a v3 |
| 110 |
notebook to share with a v2 user. |
| 111 |
|
| 112 |
.. _simple script: https://gist.github.com/1935808 |
| 113 |
|
| 114 |
|
| 115 |
JavaScript refactoring |
| 116 |
~~~~~~~~~~~~~~~~~~~~~~ |
| 117 |
|
| 118 |
All the client-side JavaScript has been decoupled to ease reuse of parts of the |
| 119 |
machinery without having to build a full-blown notebook. This will make it much |
| 120 |
easier to communicate with an IPython kernel from existing web pages and to |
| 121 |
integrate single cells into other sites, without loading the full notebook |
| 122 |
document-like UI. :ghpull:`1711`. |
| 123 |
|
| 124 |
This refactoring also enables the possibility of writing dynamic javascript |
| 125 |
widgets that are returned from Python code and that present an interactive view |
| 126 |
to the user, with callbacks in Javascript executing calls to the Kernel. This |
| 127 |
will enable many interactive elements to be added by users in notebooks. |
| 128 |
|
| 129 |
An example of this capability has been provided as a proof of concept in |
| 130 |
:file:`examples/widgets` that lets you directly communicate with one or more |
| 131 |
parallel engines, acting as a mini-console for parallel debugging and |
| 132 |
introspection. |
| 133 |
|
| 134 |
|
| 135 |
Improved tooltips |
| 136 |
~~~~~~~~~~~~~~~~~ |
| 137 |
|
| 138 |
The object tooltips have gained some new functionality. By pressing tab several |
| 139 |
times, you can expand them to see more of a docstring, keep them visible as you |
| 140 |
fill in a function's parameters, or transfer the information to the pager at the |
| 141 |
bottom of the screen. For the details, look at the example notebook |
| 142 |
:file:`01_notebook_introduction.ipynb`. |
| 143 |
|
| 144 |
.. figure:: ../_images/ipy_013_notebook_tooltip.png |
| 145 |
:width: 460px |
| 146 |
:alt: Improved tooltips in the notebook. |
| 147 |
:align: center |
| 148 |
:target: ../_images/ipy_013_notebook_tooltip.png |
| 149 |
|
| 150 |
The new notebook tooltips. |
| 151 |
|
| 152 |
Other improvements to the Notebook |
| 153 |
---------------------------------- |
| 154 |
|
| 155 |
These are some other notable small improvements to the notebook, in addition to |
| 156 |
many bug fixes and minor changes to add polish and robustness throughout: |
| 157 |
|
| 158 |
* The notebook pager (the area at the bottom) is now Resizable by dragging its |
| 159 |
divider handle, a feature that had been requested many times by just about |
| 160 |
anyone who had used the notebook system. :ghpull:`1705`. |
| 161 |
|
| 162 |
* It is now possible to open notebooks directly from the command line; for |
| 163 |
example: ``ipython notebook path/`` will automatically set ``path/`` as the |
| 164 |
notebook directory, and ``ipython notebook path/foo.ipynb`` will further |
| 165 |
start with the ``foo.ipynb`` notebook opened. :ghpull:`1686`. |
| 166 |
|
| 167 |
* If a notebook directory is specified with ``--notebook-dir`` (or with the |
| 168 |
corresponding configuration flag ``NotebookManager.notebook_dir``), all |
| 169 |
kernels start in this directory. |
| 170 |
|
| 171 |
* Fix codemirror clearing of cells with ``Ctrl-Z``; :ghpull:`1965`. |
| 172 |
|
| 173 |
* Text (markdown) cells now line wrap correctly in the notebook, making them |
| 174 |
much easier to edit :ghpull:`1330`. |
| 175 |
|
| 176 |
* PNG and JPEG figures returned from plots can be interactively resized in the |
| 177 |
notebook, by dragging them from their lower left corner. :ghpull:`1832`. |
| 178 |
|
| 179 |
* Clear ``In []`` prompt numbers on "Clear All Output". For more |
| 180 |
version-control-friendly ``.ipynb`` files, we now strip all prompt numbers |
| 181 |
when doing a "Clear all output". This reduces the amount of noise in |
| 182 |
commit-to-commit diffs that would otherwise show the (highly variable) prompt |
| 183 |
number changes. :ghpull:`1621`. |
| 184 |
|
| 185 |
* The notebook server now requires *two* consecutive ``Ctrl-C`` within 5 |
| 186 |
seconds (or an interactive confirmation) to terminate operation. This makes |
| 187 |
it less likely that you will accidentally kill a long-running server by |
| 188 |
typing ``Ctrl-C`` in the wrong terminal. :ghpull:`1609`. |
| 189 |
|
| 190 |
* Using ``Ctrl-S`` (or ``Cmd-S`` on a Mac) actually saves the notebook rather |
| 191 |
than providing the fairly useless browser html save dialog. :ghpull:`1334`. |
| 192 |
|
| 193 |
* Allow accessing local files from the notebook (in urls), by serving any local |
| 194 |
file as the url ``files/<relativepath>``. This makes it possible to, for |
| 195 |
example, embed local images in a notebook. :ghpull:`1211`. |
| 196 |
|
| 197 |
|
| 198 |
Cell magics |
| 199 |
----------- |
| 200 |
|
| 201 |
We have completely refactored the magic system, finally moving the magic |
| 202 |
objects to standalone, independent objects instead of being the mixin class |
| 203 |
we'd had since the beginning of IPython (:ghpull:`1732`). Now, a separate base |
| 204 |
class is provided in :class:`IPython.core.magic.Magics` that users can subclass |
| 205 |
to create their own magics. Decorators are also provided to create magics from |
| 206 |
simple functions without the need for object orientation. Please see the |
| 207 |
:ref:`magic` docs for further details. |
| 208 |
|
| 209 |
All builtin magics now exist in a few subclasses that group together related |
| 210 |
functionality, and the new :mod:`IPython.core.magics` package has been created |
| 211 |
to organize this into smaller files. |
| 212 |
|
| 213 |
This cleanup was the last major piece of deep refactoring needed from the |
| 214 |
original 2001 codebase. |
| 215 |
|
| 216 |
We have also introduced a new type of magic function, prefixed with `%%` |
| 217 |
instead of `%`, which operates at the whole-cell level. A cell magic receives |
| 218 |
two arguments: the line it is called on (like a line magic) and the body of the |
| 219 |
cell below it. |
| 220 |
|
| 221 |
Cell magics are most natural in the notebook, but they also work in the |
| 222 |
terminal and qt console, with the usual approach of using a blank line to |
| 223 |
signal cell termination. |
| 224 |
|
| 225 |
For example, to time the execution of several statements:: |
| 226 |
|
| 227 |
%%timeit x = 0 # setup |
| 228 |
for i in range(100000): |
| 229 |
x += i**2 |
| 230 |
|
| 231 |
This is particularly useful to integrate code in another language, and cell |
| 232 |
magics already exist for shell scripts, Cython, R and Octave. Using ``%%script |
| 233 |
/usr/bin/foo``, you can run a cell in any interpreter that accepts code via |
| 234 |
stdin. |
| 235 |
|
| 236 |
Another handy cell magic makes it easy to write short text files: ``%%file |
| 237 |
~/save/to/here.txt``. |
| 238 |
|
| 239 |
The following cell magics are now included by default; all those that use |
| 240 |
special interpreters (Perl, Ruby, bash, etc.) assume you have the requisite |
| 241 |
interpreter installed: |
| 242 |
|
| 243 |
* ``%%!``: run cell body with the underlying OS shell; this is similar to |
| 244 |
prefixing every line in the cell with ``!``. |
| 245 |
|
| 246 |
* ``%%bash``: run cell body under bash. |
| 247 |
|
| 248 |
* ``%%capture``: capture the output of the code in the cell (and stderr as |
| 249 |
well). Useful to run codes that produce too much output that you don't even |
| 250 |
want scrolled. |
| 251 |
|
| 252 |
* ``%%file``: save cell body as a file. |
| 253 |
|
| 254 |
* ``%%perl``: run cell body using Perl. |
| 255 |
|
| 256 |
* ``%%prun``: run cell body with profiler (cell extension of ``%prun``). |
| 257 |
|
| 258 |
* ``%%python3``: run cell body using Python 3. |
| 259 |
|
| 260 |
* ``%%ruby``: run cell body using Ruby. |
| 261 |
|
| 262 |
* ``%%script``: run cell body with the script specified in the first line. |
| 263 |
|
| 264 |
* ``%%sh``: run cell body using sh. |
| 265 |
|
| 266 |
* ``%%sx``: run cell with system shell and capture process output (cell |
| 267 |
extension of ``%sx``). |
| 268 |
|
| 269 |
* ``%%system``: run cell with system shell (``%%!`` is an alias to this). |
| 270 |
|
| 271 |
* ``%%timeit``: time the execution of the cell (extension of ``%timeit``). |
| 272 |
|
| 273 |
This is what some of the script-related magics look like in action: |
| 274 |
|
| 275 |
.. image:: ../_images/ipy_013_notebook_script_cells.png |
| 276 |
:width: 460px |
| 277 |
:alt: Cluster management from the notebook dashboard |
| 278 |
:align: center |
| 279 |
:target: ../_images/ipy_013_notebook_script_cells.png |
| 280 |
|
| 281 |
In addition, we have also a number of :ref:`extensions <extensions_overview>` |
| 282 |
that provide specialized magics. These typically require additional software |
| 283 |
to run and must be manually loaded via ``%load_ext <extension name>``, but are |
| 284 |
extremely useful. The following extensions are provided: |
| 285 |
|
| 286 |
**Cython magics** (extension ``cythonmagic``) |
| 287 |
This extension provides magics to automatically build and compile Python |
| 288 |
extension modules using the Cython_ language. You must install Cython |
| 289 |
separately, as well as a C compiler, for this to work. The examples |
| 290 |
directory in the source distribution ships with a full notebook |
| 291 |
demonstrating these capabilities: |
| 292 |
|
| 293 |
.. image:: ../_images/ipy_013_notebook_cythonmagic.png |
| 294 |
:width: 460px |
| 295 |
:alt: Cython magic |
| 296 |
:align: center |
| 297 |
:target: ../_images/ipy_013_notebook_cythonmagic.png |
| 298 |
|
| 299 |
.. _cython: http://cython.org |
| 300 |
|
| 301 |
**Octave magics** (extension ``octavemagic``) |
| 302 |
This extension provides several magics that support calling code written in |
| 303 |
the Octave_ language for numerical computing. You can execute single-lines |
| 304 |
or whole blocks of Octave code, capture both output and figures inline |
| 305 |
(just like matplotlib plots), and have variables automatically converted |
| 306 |
between the two languages. To use this extension, you must have Octave |
| 307 |
installed as well as the oct2py_ package. The examples |
| 308 |
directory in the source distribution ships with a full notebook |
| 309 |
demonstrating these capabilities: |
| 310 |
|
| 311 |
.. image:: ../_images/ipy_013_notebook_octavemagic.png |
| 312 |
:width: 460px |
| 313 |
:alt: Octave magic |
| 314 |
:align: center |
| 315 |
:target: ../_images/ipy_013_notebook_octavemagic.png |
| 316 |
|
| 317 |
.. _octave: http://www.gnu.org/software/octave |
| 318 |
.. _oct2py: http://pypi.python.org/pypi/oct2py |
| 319 |
|
| 320 |
**R magics** (extension ``rmagic``) |
| 321 |
This extension provides several magics that support calling code written in |
| 322 |
the R_ language for statistical data analysis. You can execute |
| 323 |
single-lines or whole blocks of R code, capture both output and figures |
| 324 |
inline (just like matplotlib plots), and have variables automatically |
| 325 |
converted between the two languages. To use this extension, you must have |
| 326 |
R installed as well as the rpy2_ package that bridges Python and R. The |
| 327 |
examples directory in the source distribution ships with a full notebook |
| 328 |
demonstrating these capabilities: |
| 329 |
|
| 330 |
.. image:: ../_images/ipy_013_notebook_rmagic.png |
| 331 |
:width: 460px |
| 332 |
:alt: R magic |
| 333 |
:align: center |
| 334 |
:target: ../_images/ipy_013_notebook_rmagic.png |
| 335 |
|
| 336 |
.. _R: http://www.r-project.org |
| 337 |
.. _rpy2: http://rpy.sourceforge.net/rpy2.html |
| 338 |
|
| 339 |
|
| 340 |
Tab completer improvements |
| 341 |
-------------------------- |
| 342 |
|
| 343 |
Useful tab-completion based on live inspection of objects is one of the most |
| 344 |
popular features of IPython. To make this process even more user-friendly, the |
| 345 |
completers of both the Qt console and the Notebook have been reworked. |
| 346 |
|
| 347 |
The Qt console comes with a new ncurses-like tab completer, activated by |
| 348 |
default, which lets you cycle through the available completions by pressing tab, |
| 349 |
or select a completion with the arrow keys (:ghpull:`1851`). |
| 350 |
|
| 351 |
.. figure:: ../_images/ipy_013_qtconsole_completer.png |
| 352 |
:width: 460px |
| 353 |
:alt: ncurses-like completer, with highlighted selection. |
| 354 |
:align: center |
| 355 |
:target: ../_images/ipy_013_qtconsole_completer.png |
| 356 |
|
| 357 |
The new improved Qt console's ncurses-like completer allows to easily |
| 358 |
navigate thought long list of completions. |
| 359 |
|
| 360 |
In the notebook, completions are now sourced both from object introspection and |
| 361 |
analysis of surrounding code, so limited completions can be offered for |
| 362 |
variables defined in the current cell, or while the kernel is busy |
| 363 |
(:ghpull:`1711`). |
| 364 |
|
| 365 |
|
| 366 |
We have implemented a new configurable flag to control tab completion on |
| 367 |
modules that provide the ``__all__`` attribute:: |
| 368 |
|
| 369 |
IPCompleter.limit_to__all__= Boolean |
| 370 |
|
| 371 |
This instructs the completer to honor ``__all__`` for the completion. |
| 372 |
Specifically, when completing on ``object.<tab>``, if True: only those names |
| 373 |
in ``obj.__all__`` will be included. When False [default]: the ``__all__`` |
| 374 |
attribute is ignored. :ghpull:`1529`. |
| 375 |
|
| 376 |
|
| 377 |
Improvements to the Qt console |
| 378 |
------------------------------ |
| 379 |
|
| 380 |
The Qt console continues to receive improvements and refinements, despite the |
| 381 |
fact that it is by now a fairly mature and robust component. Lots of small |
| 382 |
polish has gone into it, here are a few highlights: |
| 383 |
|
| 384 |
* A number of changes were made to the underlying code for easier integration |
| 385 |
into other projects such as Spyder_ (:ghpull:`2007`, :ghpull:`2024`). |
| 386 |
|
| 387 |
* Improved menus with a new Magic menu that is organized by magic groups (this |
| 388 |
was made possible by the reorganization of the magic system |
| 389 |
internals). :ghpull:`1782`. |
| 390 |
|
| 391 |
* Allow for restarting kernels without clearing the qtconsole, while leaving a |
| 392 |
visible indication that the kernel has restarted. :ghpull:`1681`. |
| 393 |
|
| 394 |
* Allow the native display of jpeg images in the qtconsole. :ghpull:`1643`. |
| 395 |
|
| 396 |
.. _spyder: https://code.google.com/p/spyderlib |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
Parallel |
| 401 |
-------- |
| 402 |
|
| 403 |
The parallel tools have been improved and fine-tuned on multiple fronts. Now, |
| 404 |
the creation of an :class:`IPython.parallel.Client` object automatically |
| 405 |
activates a line and cell magic function ``px`` that sends its code to all the |
| 406 |
engines. Further magics can be easily created with the :meth:`.Client.activate` |
| 407 |
method, to conveniently execute code on any subset of engines. :ghpull:`1893`. |
| 408 |
|
| 409 |
The ``%%px`` cell magic can also be given an optional targets argument, as well |
| 410 |
as a ``--out`` argument for storing its output. |
| 411 |
|
| 412 |
A new magic has also been added, ``%pxconfig``, that lets you configure various |
| 413 |
defaults of the parallel magics. As usual, type ``%pxconfig?`` for details. |
| 414 |
|
| 415 |
The exception reporting in parallel contexts has been improved to be easier to |
| 416 |
read. Now, IPython directly reports the remote exceptions without showing any |
| 417 |
of the internal execution parts: |
| 418 |
|
| 419 |
.. image:: ../_images/ipy_013_par_tb.png |
| 420 |
:width: 460px |
| 421 |
:alt: Improved parallel exceptions. |
| 422 |
:align: center |
| 423 |
:target: ../_images/ipy_013_par_tb.png |
| 424 |
|
| 425 |
The parallel tools now default to using ``NoDB`` as the storage backend for |
| 426 |
intermediate results. This means that the default usage case will have a |
| 427 |
significantly reduced memory footprint, though certain advanced features are |
| 428 |
not available with this backend. |
| 429 |
|
| 430 |
The parallel magics now display all output, so you can do parallel plotting or |
| 431 |
other actions with complex display. The ``px`` magic has now both line and cell |
| 432 |
modes, and in cell mode finer control has been added about how to collate |
| 433 |
output from multiple engines. :ghpull:`1768`. |
| 434 |
|
| 435 |
There have also been incremental improvements to the SSH launchers: |
| 436 |
|
| 437 |
* add to_send/fetch steps for moving connection files around. |
| 438 |
|
| 439 |
* add SSHProxyEngineSetLauncher, for invoking to `ipcluster engines` on a |
| 440 |
remote host. This can be used to start a set of engines via PBS/SGE/MPI |
| 441 |
*remotely*. |
| 442 |
|
| 443 |
This makes the SSHLauncher usable on machines without shared filesystems. |
| 444 |
|
| 445 |
A number of 'sugar' methods/properties were added to AsyncResult that are |
| 446 |
quite useful (:ghpull:`1548`) for everday work: |
| 447 |
|
| 448 |
* ``ar.wall_time`` = received - submitted |
| 449 |
* ``ar.serial_time`` = sum of serial computation time |
| 450 |
* ``ar.elapsed`` = time since submission (wall_time if done) |
| 451 |
* ``ar.progress`` = (int) number of sub-tasks that have completed |
| 452 |
* ``len(ar)`` = # of tasks |
| 453 |
* ``ar.wait_interactive()``: prints progress |
| 454 |
|
| 455 |
Added :meth:`.Client.spin_thread` / :meth:`~.Client.stop_spin_thread` for |
| 456 |
running spin in a background thread, to keep zmq queue clear. This can be used |
| 457 |
to ensure that timing information is as accurate as possible (at the cost of |
| 458 |
having a background thread active). |
| 459 |
|
| 460 |
Set TaskScheduler.hwm default to 1 instead of 0. 1 has more |
| 461 |
predictable/intuitive behavior, if often slower, and thus a more logical |
| 462 |
default. Users whose workloads require maximum throughput and are largely |
| 463 |
homogeneous in time per task can make the optimization themselves, but now the |
| 464 |
behavior will be less surprising to new users. :ghpull:`1294`. |
| 465 |
|
| 466 |
|
| 467 |
Kernel/Engine unification |
| 468 |
------------------------- |
| 469 |
|
| 470 |
This is mostly work 'under the hood', but it is actually a *major* achievement |
| 471 |
for the project that has deep implications in the long term: at last, we have |
| 472 |
unified the main object that executes as the user's interactive shell (which we |
| 473 |
refer to as the *IPython kernel*) with the objects that run in all the worker |
| 474 |
nodes of the parallel computing facilities (the *IPython engines*). Ever since |
| 475 |
the first implementation of IPython's parallel code back in 2006, we had wanted |
| 476 |
to have these two roles be played by the same machinery, but a number of |
| 477 |
technical reasons had prevented that from being true. |
| 478 |
|
| 479 |
In this release we have now merged them, and this has a number of important |
| 480 |
consequences: |
| 481 |
|
| 482 |
* It is now possible to connect any of our clients (qtconsole or terminal |
| 483 |
console) to any individual parallel engine, with the *exact* behavior of |
| 484 |
working at a 'regular' IPython console/qtconsole. This makes debugging, |
| 485 |
plotting, etc. in parallel scenarios vastly easier. |
| 486 |
|
| 487 |
* Parallel engines can always execute arbitrary 'IPython code', that is, code |
| 488 |
that has magics, shell extensions, etc. In combination with the ``%%px`` |
| 489 |
magics, it is thus extremely natural for example to send to all engines a |
| 490 |
block of Cython or R code to be executed via the new Cython and R magics. For |
| 491 |
example, this snippet would send the R block to all active engines in a |
| 492 |
cluster:: |
| 493 |
|
| 494 |
%%px |
| 495 |
%%R |
| 496 |
... R code goes here |
| 497 |
|
| 498 |
* It is possible to embed not only an interactive shell with the |
| 499 |
:func:`IPython.embed` call as always, but now you can also embed a *kernel* |
| 500 |
with :func:`IPython.embed_kernel()`. Embedding an IPython kernel in an |
| 501 |
application is useful when you want to use :func:`IPython.embed` but don't |
| 502 |
have a terminal attached on stdin and stdout. |
| 503 |
|
| 504 |
* The new :func:`IPython.parallel.bind_kernel` allows you to promote Engines to |
| 505 |
listening Kernels, and connect QtConsoles to an Engine and debug it |
| 506 |
directly. |
| 507 |
|
| 508 |
In addition, having a single core object through our entire architecture also |
| 509 |
makes the project conceptually cleaner, easier to maintain and more robust. |
| 510 |
This took a lot of work to get in place, but we are thrilled to have this major |
| 511 |
piece of architecture finally where we'd always wanted it to be. |
| 512 |
|
| 513 |
|
| 514 |
Official Public API |
| 515 |
------------------- |
| 516 |
|
| 517 |
We have begun organizing our API for easier public use, with an eye towards an |
| 518 |
official IPython 1.0 release which will firmly maintain this API compatible for |
| 519 |
its entire lifecycle. There is now an :mod:`IPython.display` module that |
| 520 |
aggregates all display routines, and the :mod:`traitlets.config` namespace has |
| 521 |
all public configuration tools. We will continue improving our public API |
| 522 |
layout so that users only need to import names one level deeper than the main |
| 523 |
``IPython`` package to access all public namespaces. |
| 524 |
|
| 525 |
|
| 526 |
IPython notebook file icons |
| 527 |
--------------------------- |
| 528 |
|
| 529 |
The directory ``docs/resources`` in the source distribution contains SVG and |
| 530 |
PNG versions of our file icons, as well as an ``Info.plist.example`` file with |
| 531 |
instructions to install them on Mac OSX. This is a first draft of our icons, |
| 532 |
and we encourage contributions from users with graphic talent to improve them |
| 533 |
in the future. |
| 534 |
|
| 535 |
|
| 536 |
New top-level `locate` command |
| 537 |
------------------------------ |
| 538 |
|
| 539 |
Add `locate` entry points; these would be useful for quickly locating IPython |
| 540 |
directories and profiles from other (non-Python) applications. :ghpull:`1762`. |
| 541 |
|
| 542 |
Examples:: |
| 543 |
|
| 544 |
$> ipython locate |
| 545 |
/Users/me/.ipython |
| 546 |
|
| 547 |
$> ipython locate profile foo |
| 548 |
/Users/me/.ipython/profile_foo |
| 549 |
|
| 550 |
$> ipython locate profile |
| 551 |
/Users/me/.ipython/profile_default |
| 552 |
|
| 553 |
$> ipython locate profile dne |
| 554 |
[ProfileLocate] Profile u'dne' not found. |
| 555 |
|
| 556 |
|
| 557 |
Other new features and improvements |
| 558 |
----------------------------------- |
| 559 |
|
| 560 |
* **%install_ext**: A new magic function to install an IPython extension from |
| 561 |
a URL. E.g. ``%install_ext |
| 562 |
https://bitbucket.org/birkenfeld/ipython-physics/raw/default/physics.py``. |
| 563 |
|
| 564 |
* The ``%loadpy`` magic is no longer restricted to Python files, and has been |
| 565 |
renamed ``%load``. The old name remains as an alias. |
| 566 |
|
| 567 |
* New command line arguments will help external programs find IPython folders: |
| 568 |
``ipython locate`` finds the user's IPython directory, and ``ipython locate |
| 569 |
profile foo`` finds the folder for the 'foo' profile (if it exists). |
| 570 |
|
| 571 |
* The :envvar:`IPYTHON_DIR` environment variable, introduced in the Great |
| 572 |
Reorganization of 0.11 and existing only in versions 0.11-0.13, has been |
| 573 |
deprecated. As described in :ghpull:`1167`, the complexity and confusion of |
| 574 |
migrating to this variable is not worth the aesthetic improvement. Please use |
| 575 |
the historical :envvar:`IPYTHONDIR` environment variable instead. |
| 576 |
|
| 577 |
* The default value of *interactivity* passed from |
| 578 |
:meth:`~IPython.core.interactiveshell.InteractiveShell.run_cell` to |
| 579 |
:meth:`~IPython.core.interactiveshell.InteractiveShell.run_ast_nodes` |
| 580 |
is now configurable. |
| 581 |
|
| 582 |
* New ``%alias_magic`` function to conveniently create aliases of existing |
| 583 |
magics, if you prefer to have shorter names for personal use. |
| 584 |
|
| 585 |
* We ship unminified versions of the JavaScript libraries we use, to better |
| 586 |
comply with Debian's packaging policies. |
| 587 |
|
| 588 |
* Simplify the information presented by ``obj?/obj??`` to eliminate a few |
| 589 |
redundant fields when possible. :ghpull:`2038`. |
| 590 |
|
| 591 |
* Improved continuous integration for IPython. We now have automated test runs |
| 592 |
on `Shining Panda <https://jenkins.shiningpanda.com/ipython>`_ and `Travis-CI |
| 593 |
<http://travis-ci.org/#!/ipython/ipython>`_, as well as `Tox support |
| 594 |
<http://tox.testrun.org>`_. |
| 595 |
|
| 596 |
* The `vim-ipython`_ functionality (externally developed) has been updated to |
| 597 |
the latest version. |
| 598 |
|
| 599 |
.. _vim-ipython: https://github.com/ivanov/vim-ipython |
| 600 |
|
| 601 |
* The ``%save`` magic now has a ``-f`` flag to force overwriting, which makes |
| 602 |
it much more usable in the notebook where it is not possible to reply to |
| 603 |
interactive questions from the kernel. :ghpull:`1937`. |
| 604 |
|
| 605 |
* Use dvipng to format sympy.Matrix, enabling display of matrices in the Qt |
| 606 |
console with the sympy printing extension. :ghpull:`1861`. |
| 607 |
|
| 608 |
* Our messaging protocol now has a reasonable test suite, helping ensure that |
| 609 |
we don't accidentally deviate from the spec and possibly break third-party |
| 610 |
applications that may have been using it. We encourage users to contribute |
| 611 |
more stringent tests to this part of the test suite. :ghpull:`1627`. |
| 612 |
|
| 613 |
* Use LaTeX to display, on output, various built-in types with the SymPy |
| 614 |
printing extension. :ghpull:`1399`. |
| 615 |
|
| 616 |
* Add Gtk3 event loop integration and example. :ghpull:`1588`. |
| 617 |
|
| 618 |
* ``clear_output`` improvements, which allow things like progress bars and other |
| 619 |
simple animations to work well in the notebook (:ghpull:`1563`): |
| 620 |
|
| 621 |
* `clear_output()` clears the line, even in terminal IPython, the QtConsole |
| 622 |
and plain Python as well, by printing `\r` to streams. |
| 623 |
|
| 624 |
* `clear_output()` avoids the flicker in the notebook by adding a delay, |
| 625 |
and firing immediately upon the next actual display message. |
| 626 |
|
| 627 |
* `display_javascript` hides its `output_area` element, so using display to |
| 628 |
run a bunch of javascript doesn't result in ever-growing vertical space. |
| 629 |
|
| 630 |
* Add simple support for running inside a virtualenv. While this doesn't |
| 631 |
supplant proper installation (as users should do), it helps ad-hoc calling of |
| 632 |
IPython from inside a virtualenv. :ghpull:`1388`. |
| 633 |
|
| 634 |
|
| 635 |
Major Bugs fixed |
| 636 |
---------------- |
| 637 |
|
| 638 |
In this cycle, we have :ref:`closed over 740 issues <issues_list_013>`, but a |
| 639 |
few major ones merit special mention: |
| 640 |
|
| 641 |
* The ``%pastebin`` magic has been updated to point to gist.github.com, since |
| 642 |
unfortunately http://paste.pocoo.org has closed down. We also added a -d flag |
| 643 |
for the user to provide a gist description string. :ghpull:`1670`. |
| 644 |
|
| 645 |
* Fix ``%paste`` that would reject certain valid inputs. :ghpull:`1258`. |
| 646 |
|
| 647 |
* Fix sending and receiving of Numpy structured arrays (those with composite |
| 648 |
dtypes, often used as recarrays). :ghpull:`2034`. |
| 649 |
|
| 650 |
* Reconnect when the websocket connection closes unexpectedly. :ghpull:`1577`. |
| 651 |
|
| 652 |
* Fix truncated representation of objects in the debugger by showing at least |
| 653 |
80 characters' worth of information. :ghpull:`1793`. |
| 654 |
|
| 655 |
* Fix logger to be Unicode-aware: logging could crash ipython if there was |
| 656 |
unicode in the input. :ghpull:`1792`. |
| 657 |
|
| 658 |
* Fix images missing from XML/SVG export in the Qt console. :ghpull:`1449`. |
| 659 |
|
| 660 |
* Fix deepreload on Python 3. :ghpull:`1625`, as well as having a much cleaner |
| 661 |
and more robust implementation of deepreload in general. :ghpull:`1457`. |
| 662 |
|
| 663 |
|
| 664 |
Backwards incompatible changes |
| 665 |
------------------------------ |
| 666 |
|
| 667 |
* The exception :exc:`IPython.core.error.TryNext` previously accepted |
| 668 |
arguments and keyword arguments to be passed to the next implementation |
| 669 |
of the hook. This feature was removed as it made error message propagation |
| 670 |
difficult and violated the principle of loose coupling. |