Show More
@@ -0,0 +1,40 b'' | |||||
|
1 | """A simple interactive demo to illustrate the use of IPython's Demo class. | |||
|
2 | ||||
|
3 | Any python script can be run as a demo, but that does little more than showing | |||
|
4 | it on-screen, syntax-highlighted in one shot. If you add a little simple | |||
|
5 | markup, you can stop at specified intervals and return to the ipython prompt, | |||
|
6 | resuming execution later. | |||
|
7 | """ | |||
|
8 | ||||
|
9 | print 'Hello, welcome to an interactive IPython demo.' | |||
|
10 | print 'Executing this block should require confirmation before proceeding,' | |||
|
11 | print 'unless auto_all has been set to true in the demo object' | |||
|
12 | ||||
|
13 | # The mark below defines a block boundary, which is a point where IPython will | |||
|
14 | # stop execution and return to the interactive prompt. | |||
|
15 | # Note that in actual interactive execution, | |||
|
16 | # <demo> --- stop --- | |||
|
17 | ||||
|
18 | x = 1 | |||
|
19 | y = 2 | |||
|
20 | ||||
|
21 | # <demo> --- stop --- | |||
|
22 | ||||
|
23 | # the mark below makes this block as silent | |||
|
24 | # <demo> silent | |||
|
25 | ||||
|
26 | print 'This is a silent block, which gets executed but not printed.' | |||
|
27 | ||||
|
28 | # <demo> --- stop --- | |||
|
29 | # <demo> auto | |||
|
30 | print 'This is an automatic block.' | |||
|
31 | print 'It is executed without asking for confirmation, but printed.' | |||
|
32 | z = x+y | |||
|
33 | ||||
|
34 | print 'z=',x | |||
|
35 | ||||
|
36 | # <demo> --- stop --- | |||
|
37 | # This is just another normal block. | |||
|
38 | print 'z is now:', z | |||
|
39 | ||||
|
40 | print 'bye!' |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
This diff has been collapsed as it changes many lines, (521 lines changed) Show them Hide them | |||||
@@ -0,0 +1,521 b'' | |||||
|
1 | We closed a total of 510 issues, 225 pull requests and 285 regular issues; this | |||
|
2 | is the full list (generated with the script `tools/github_stats.py`). We should | |||
|
3 | note that a few of these were made on the 0.10.x series, but we have no | |||
|
4 | automatic way of filtering the issues by branch, so this reflects all of our | |||
|
5 | development over the last two years, including work already released in 0.10.2: | |||
|
6 | ||||
|
7 | Pull requests (225): | |||
|
8 | ||||
|
9 | * `642 <https://github.com/ipython/ipython/issues/642>`_: fix typo in docs/examples/vim/README.rst | |||
|
10 | * `631 <https://github.com/ipython/ipython/issues/631>`_: two-way vim-ipython integration | |||
|
11 | * `637 <https://github.com/ipython/ipython/issues/637>`_: print is a function, this allows to properly exit ipython | |||
|
12 | * `635 <https://github.com/ipython/ipython/issues/635>`_: support html representations in the notebook frontend | |||
|
13 | * `639 <https://github.com/ipython/ipython/issues/639>`_: Updating the credits file | |||
|
14 | * `628 <https://github.com/ipython/ipython/issues/628>`_: import pexpect from IPython.external in irunner | |||
|
15 | * `596 <https://github.com/ipython/ipython/issues/596>`_: Irunner | |||
|
16 | * `598 <https://github.com/ipython/ipython/issues/598>`_: Fix templates for CrashHandler | |||
|
17 | * `590 <https://github.com/ipython/ipython/issues/590>`_: Desktop | |||
|
18 | * `600 <https://github.com/ipython/ipython/issues/600>`_: Fix bug with non-ascii reprs inside pretty-printed lists. | |||
|
19 | * `618 <https://github.com/ipython/ipython/issues/618>`_: I617 | |||
|
20 | * `599 <https://github.com/ipython/ipython/issues/599>`_: Gui Qt example and docs | |||
|
21 | * `619 <https://github.com/ipython/ipython/issues/619>`_: manpage update | |||
|
22 | * `582 <https://github.com/ipython/ipython/issues/582>`_: Updating sympy profile to match the exec_lines of isympy. | |||
|
23 | * `578 <https://github.com/ipython/ipython/issues/578>`_: Check to see if correct source for decorated functions can be displayed | |||
|
24 | * `589 <https://github.com/ipython/ipython/issues/589>`_: issue 588 | |||
|
25 | * `591 <https://github.com/ipython/ipython/issues/591>`_: simulate shell expansion on %run arguments, at least tilde expansion | |||
|
26 | * `576 <https://github.com/ipython/ipython/issues/576>`_: Show message about %paste magic on an IndentationError | |||
|
27 | * `574 <https://github.com/ipython/ipython/issues/574>`_: Getcwdu | |||
|
28 | * `565 <https://github.com/ipython/ipython/issues/565>`_: don't move old config files, keep nagging the user | |||
|
29 | * `575 <https://github.com/ipython/ipython/issues/575>`_: Added more docstrings to IPython.zmq.session. | |||
|
30 | * `567 <https://github.com/ipython/ipython/issues/567>`_: fix trailing whitespace from reseting indentation | |||
|
31 | * `564 <https://github.com/ipython/ipython/issues/564>`_: Command line args in docs | |||
|
32 | * `560 <https://github.com/ipython/ipython/issues/560>`_: reorder qt support in kernel | |||
|
33 | * `561 <https://github.com/ipython/ipython/issues/561>`_: command-line suggestions | |||
|
34 | * `556 <https://github.com/ipython/ipython/issues/556>`_: qt_for_kernel: use matplotlib rcParams to decide between PyQt4 and PySide | |||
|
35 | * `557 <https://github.com/ipython/ipython/issues/557>`_: Update usage.py to newapp | |||
|
36 | * `555 <https://github.com/ipython/ipython/issues/555>`_: Rm default old config | |||
|
37 | * `552 <https://github.com/ipython/ipython/issues/552>`_: update parallel code for py3k | |||
|
38 | * `504 <https://github.com/ipython/ipython/issues/504>`_: Updating string formatting | |||
|
39 | * `551 <https://github.com/ipython/ipython/issues/551>`_: Make pylab import all configurable | |||
|
40 | * `496 <https://github.com/ipython/ipython/issues/496>`_: Qt editing keybindings | |||
|
41 | * `550 <https://github.com/ipython/ipython/issues/550>`_: Support v2 PyQt4 APIs and PySide in kernel's GUI support | |||
|
42 | * `546 <https://github.com/ipython/ipython/issues/546>`_: doc update | |||
|
43 | * `548 <https://github.com/ipython/ipython/issues/548>`_: Fix sympy profile to work with sympy 0.7. | |||
|
44 | * `542 <https://github.com/ipython/ipython/issues/542>`_: issue 440 | |||
|
45 | * `533 <https://github.com/ipython/ipython/issues/533>`_: Remove unused configobj and validate libraries from externals. | |||
|
46 | * `538 <https://github.com/ipython/ipython/issues/538>`_: fix various tests on Windows | |||
|
47 | * `540 <https://github.com/ipython/ipython/issues/540>`_: support `-pylab` flag with deprecation warning | |||
|
48 | * `537 <https://github.com/ipython/ipython/issues/537>`_: Docs update | |||
|
49 | * `536 <https://github.com/ipython/ipython/issues/536>`_: `setup.py install` depends on setuptools on Windows | |||
|
50 | * `480 <https://github.com/ipython/ipython/issues/480>`_: Get help mid-command | |||
|
51 | * `462 <https://github.com/ipython/ipython/issues/462>`_: Str and Bytes traitlets | |||
|
52 | * `534 <https://github.com/ipython/ipython/issues/534>`_: Handle unicode properly in IPython.zmq.iostream | |||
|
53 | * `527 <https://github.com/ipython/ipython/issues/527>`_: ZMQ displayhook | |||
|
54 | * `526 <https://github.com/ipython/ipython/issues/526>`_: Handle asynchronous output in Qt console | |||
|
55 | * `528 <https://github.com/ipython/ipython/issues/528>`_: Do not import deprecated functions from external decorators library. | |||
|
56 | * `454 <https://github.com/ipython/ipython/issues/454>`_: New BaseIPythonApplication | |||
|
57 | * `532 <https://github.com/ipython/ipython/issues/532>`_: Zmq unicode | |||
|
58 | * `531 <https://github.com/ipython/ipython/issues/531>`_: Fix Parallel test | |||
|
59 | * `525 <https://github.com/ipython/ipython/issues/525>`_: fallback on lsof if otool not found in libedit detection | |||
|
60 | * `517 <https://github.com/ipython/ipython/issues/517>`_: Merge IPython.parallel.streamsession into IPython.zmq.session | |||
|
61 | * `521 <https://github.com/ipython/ipython/issues/521>`_: use dict.get(key) instead of dict[key] for safety from KeyErrors | |||
|
62 | * `492 <https://github.com/ipython/ipython/issues/492>`_: add QtConsoleApp using newapplication | |||
|
63 | * `485 <https://github.com/ipython/ipython/issues/485>`_: terminal IPython with newapp | |||
|
64 | * `486 <https://github.com/ipython/ipython/issues/486>`_: Use newapp in parallel code | |||
|
65 | * `511 <https://github.com/ipython/ipython/issues/511>`_: Add a new line before displaying multiline strings in the Qt console. | |||
|
66 | * `509 <https://github.com/ipython/ipython/issues/509>`_: i508 | |||
|
67 | * `501 <https://github.com/ipython/ipython/issues/501>`_: ignore EINTR in channel loops | |||
|
68 | * `495 <https://github.com/ipython/ipython/issues/495>`_: Better selection of Qt bindings when QT_API is not specified | |||
|
69 | * `498 <https://github.com/ipython/ipython/issues/498>`_: Check for .pyd as extension for binary files. | |||
|
70 | * `494 <https://github.com/ipython/ipython/issues/494>`_: QtConsole zoom adjustments | |||
|
71 | * `490 <https://github.com/ipython/ipython/issues/490>`_: fix UnicodeEncodeError writing SVG string to .svg file, fixes #489 | |||
|
72 | * `491 <https://github.com/ipython/ipython/issues/491>`_: add QtConsoleApp using newapplication | |||
|
73 | * `479 <https://github.com/ipython/ipython/issues/479>`_: embed() doesn't load default config | |||
|
74 | * `483 <https://github.com/ipython/ipython/issues/483>`_: Links launchpad -> github | |||
|
75 | * `419 <https://github.com/ipython/ipython/issues/419>`_: %xdel magic | |||
|
76 | * `477 <https://github.com/ipython/ipython/issues/477>`_: Add \n to lines in the log | |||
|
77 | * `459 <https://github.com/ipython/ipython/issues/459>`_: use os.system for shell.system in Terminal frontend | |||
|
78 | * `475 <https://github.com/ipython/ipython/issues/475>`_: i473 | |||
|
79 | * `471 <https://github.com/ipython/ipython/issues/471>`_: Add test decorator onlyif_unicode_paths. | |||
|
80 | * `474 <https://github.com/ipython/ipython/issues/474>`_: Fix support for raw GTK and WX matplotlib backends. | |||
|
81 | * `472 <https://github.com/ipython/ipython/issues/472>`_: Kernel event loop is robust against random SIGINT. | |||
|
82 | * `460 <https://github.com/ipython/ipython/issues/460>`_: Share code for magic_edit | |||
|
83 | * `469 <https://github.com/ipython/ipython/issues/469>`_: Add exit code when running all tests with iptest. | |||
|
84 | * `464 <https://github.com/ipython/ipython/issues/464>`_: Add home directory expansion to IPYTHON_DIR environment variables. | |||
|
85 | * `455 <https://github.com/ipython/ipython/issues/455>`_: Bugfix with logger | |||
|
86 | * `448 <https://github.com/ipython/ipython/issues/448>`_: Separate out skip_doctest decorator | |||
|
87 | * `453 <https://github.com/ipython/ipython/issues/453>`_: Draft of new main BaseIPythonApplication. | |||
|
88 | * `452 <https://github.com/ipython/ipython/issues/452>`_: Use list/tuple/dict/set subclass's overridden __repr__ instead of the pretty | |||
|
89 | * `398 <https://github.com/ipython/ipython/issues/398>`_: allow toggle of svg/png inline figure format | |||
|
90 | * `381 <https://github.com/ipython/ipython/issues/381>`_: Support inline PNGs of matplotlib plots | |||
|
91 | * `413 <https://github.com/ipython/ipython/issues/413>`_: Retries and Resubmit (#411 and #412) | |||
|
92 | * `370 <https://github.com/ipython/ipython/issues/370>`_: Fixes to the display system | |||
|
93 | * `449 <https://github.com/ipython/ipython/issues/449>`_: Fix issue 447 - inspecting old-style classes. | |||
|
94 | * `423 <https://github.com/ipython/ipython/issues/423>`_: Allow type checking on elements of List,Tuple,Set traits | |||
|
95 | * `400 <https://github.com/ipython/ipython/issues/400>`_: Config5 | |||
|
96 | * `421 <https://github.com/ipython/ipython/issues/421>`_: Generalise mechanism to put text at the next prompt in the Qt console. | |||
|
97 | * `443 <https://github.com/ipython/ipython/issues/443>`_: pinfo code duplication | |||
|
98 | * `429 <https://github.com/ipython/ipython/issues/429>`_: add check_pid, and handle stale PID info in ipcluster. | |||
|
99 | * `431 <https://github.com/ipython/ipython/issues/431>`_: Fix error message in test_irunner | |||
|
100 | * `427 <https://github.com/ipython/ipython/issues/427>`_: handle different SyntaxError messages in test_irunner | |||
|
101 | * `424 <https://github.com/ipython/ipython/issues/424>`_: Irunner test failure | |||
|
102 | * `430 <https://github.com/ipython/ipython/issues/430>`_: Small parallel doc typo | |||
|
103 | * `422 <https://github.com/ipython/ipython/issues/422>`_: Make ipython-qtconsole a GUI script | |||
|
104 | * `420 <https://github.com/ipython/ipython/issues/420>`_: Permit kernel std* to be redirected | |||
|
105 | * `408 <https://github.com/ipython/ipython/issues/408>`_: History request | |||
|
106 | * `388 <https://github.com/ipython/ipython/issues/388>`_: Add Emacs-style kill ring to Qt console | |||
|
107 | * `414 <https://github.com/ipython/ipython/issues/414>`_: Warn on old config files | |||
|
108 | * `415 <https://github.com/ipython/ipython/issues/415>`_: Prevent prefilter from crashing IPython | |||
|
109 | * `418 <https://github.com/ipython/ipython/issues/418>`_: Minor configuration doc fixes | |||
|
110 | * `407 <https://github.com/ipython/ipython/issues/407>`_: Update What's new documentation | |||
|
111 | * `410 <https://github.com/ipython/ipython/issues/410>`_: Install notebook frontend | |||
|
112 | * `406 <https://github.com/ipython/ipython/issues/406>`_: install IPython.zmq.gui | |||
|
113 | * `393 <https://github.com/ipython/ipython/issues/393>`_: ipdir unicode | |||
|
114 | * `397 <https://github.com/ipython/ipython/issues/397>`_: utils.io.Term.cin/out/err -> utils.io.stdin/out/err | |||
|
115 | * `389 <https://github.com/ipython/ipython/issues/389>`_: DB fixes and Scheduler HWM | |||
|
116 | * `374 <https://github.com/ipython/ipython/issues/374>`_: Various Windows-related fixes to IPython.parallel | |||
|
117 | * `362 <https://github.com/ipython/ipython/issues/362>`_: fallback on defaultencoding if filesystemencoding is None | |||
|
118 | * `382 <https://github.com/ipython/ipython/issues/382>`_: Shell's reset method clears namespace from last %run command. | |||
|
119 | * `385 <https://github.com/ipython/ipython/issues/385>`_: Update iptest exclusions (fix #375) | |||
|
120 | * `383 <https://github.com/ipython/ipython/issues/383>`_: Catch errors in querying readline which occur with pyreadline. | |||
|
121 | * `373 <https://github.com/ipython/ipython/issues/373>`_: Remove runlines etc. | |||
|
122 | * `364 <https://github.com/ipython/ipython/issues/364>`_: Single output | |||
|
123 | * `372 <https://github.com/ipython/ipython/issues/372>`_: Multiline input push | |||
|
124 | * `363 <https://github.com/ipython/ipython/issues/363>`_: Issue 125 | |||
|
125 | * `361 <https://github.com/ipython/ipython/issues/361>`_: don't rely on setuptools for readline dependency check | |||
|
126 | * `349 <https://github.com/ipython/ipython/issues/349>`_: Fix %autopx magic | |||
|
127 | * `355 <https://github.com/ipython/ipython/issues/355>`_: History save thread | |||
|
128 | * `356 <https://github.com/ipython/ipython/issues/356>`_: Usability improvements to history in Qt console | |||
|
129 | * `357 <https://github.com/ipython/ipython/issues/357>`_: Exit autocall | |||
|
130 | * `353 <https://github.com/ipython/ipython/issues/353>`_: Rewrite quit()/exit()/Quit()/Exit() calls as magic | |||
|
131 | * `354 <https://github.com/ipython/ipython/issues/354>`_: Cell tweaks | |||
|
132 | * `345 <https://github.com/ipython/ipython/issues/345>`_: Attempt to address (partly) issue ipython/#342 by rewriting quit(), exit(), etc. | |||
|
133 | * `352 <https://github.com/ipython/ipython/issues/352>`_: #342: Try to recover as intelligently as possible if user calls magic(). | |||
|
134 | * `346 <https://github.com/ipython/ipython/issues/346>`_: Dedent prefix bugfix + tests: #142 | |||
|
135 | * `348 <https://github.com/ipython/ipython/issues/348>`_: %reset doesn't reset prompt number. | |||
|
136 | * `347 <https://github.com/ipython/ipython/issues/347>`_: Make ip.reset() work the same in interactive or non-interactive code. | |||
|
137 | * `343 <https://github.com/ipython/ipython/issues/343>`_: make readline a dependency on OSX | |||
|
138 | * `344 <https://github.com/ipython/ipython/issues/344>`_: restore auto debug behavior | |||
|
139 | * `339 <https://github.com/ipython/ipython/issues/339>`_: fix for issue 337: incorrect/phantom tooltips for magics | |||
|
140 | * `254 <https://github.com/ipython/ipython/issues/254>`_: newparallel branch (add zmq.parallel submodule) | |||
|
141 | * `334 <https://github.com/ipython/ipython/issues/334>`_: Hard reset | |||
|
142 | * `316 <https://github.com/ipython/ipython/issues/316>`_: Unicode win process | |||
|
143 | * `332 <https://github.com/ipython/ipython/issues/332>`_: AST splitter | |||
|
144 | * `325 <https://github.com/ipython/ipython/issues/325>`_: Removetwisted | |||
|
145 | * `330 <https://github.com/ipython/ipython/issues/330>`_: Magic pastebin | |||
|
146 | * `309 <https://github.com/ipython/ipython/issues/309>`_: Bug tests for GH Issues 238, 284, 306, 307. Skip module machinery if not installed. Known failures reported as 'K' | |||
|
147 | * `331 <https://github.com/ipython/ipython/issues/331>`_: Tweak config loader for PyPy compatibility. | |||
|
148 | * `319 <https://github.com/ipython/ipython/issues/319>`_: Rewrite code to restore readline history after an action | |||
|
149 | * `329 <https://github.com/ipython/ipython/issues/329>`_: Do not store file contents in history when running a .ipy file. | |||
|
150 | * `179 <https://github.com/ipython/ipython/issues/179>`_: Html notebook | |||
|
151 | * `323 <https://github.com/ipython/ipython/issues/323>`_: Add missing external.pexpect to packages | |||
|
152 | * `295 <https://github.com/ipython/ipython/issues/295>`_: Magic local scope | |||
|
153 | * `315 <https://github.com/ipython/ipython/issues/315>`_: Unicode magic args | |||
|
154 | * `310 <https://github.com/ipython/ipython/issues/310>`_: allow Unicode Command-Line options | |||
|
155 | * `313 <https://github.com/ipython/ipython/issues/313>`_: Readline shortcuts | |||
|
156 | * `311 <https://github.com/ipython/ipython/issues/311>`_: Qtconsole exit | |||
|
157 | * `312 <https://github.com/ipython/ipython/issues/312>`_: History memory | |||
|
158 | * `294 <https://github.com/ipython/ipython/issues/294>`_: Issue 290 | |||
|
159 | * `292 <https://github.com/ipython/ipython/issues/292>`_: Issue 31 | |||
|
160 | * `252 <https://github.com/ipython/ipython/issues/252>`_: Unicode issues | |||
|
161 | * `235 <https://github.com/ipython/ipython/issues/235>`_: Fix history magic command's bugs wrt to full history and add -O option to display full history | |||
|
162 | * `236 <https://github.com/ipython/ipython/issues/236>`_: History minus p flag | |||
|
163 | * `261 <https://github.com/ipython/ipython/issues/261>`_: Adapt magic commands to new history system. | |||
|
164 | * `282 <https://github.com/ipython/ipython/issues/282>`_: SQLite history | |||
|
165 | * `191 <https://github.com/ipython/ipython/issues/191>`_: Unbundle external libraries | |||
|
166 | * `199 <https://github.com/ipython/ipython/issues/199>`_: Magic arguments | |||
|
167 | * `204 <https://github.com/ipython/ipython/issues/204>`_: Emacs completion bugfix | |||
|
168 | * `293 <https://github.com/ipython/ipython/issues/293>`_: Issue 133 | |||
|
169 | * `249 <https://github.com/ipython/ipython/issues/249>`_: Writing unicode characters to a log file. (IPython 0.10.2.git) | |||
|
170 | * `283 <https://github.com/ipython/ipython/issues/283>`_: Support for 256-color escape sequences in Qt console | |||
|
171 | * `281 <https://github.com/ipython/ipython/issues/281>`_: Refactored and improved Qt console's HTML export facility | |||
|
172 | * `237 <https://github.com/ipython/ipython/issues/237>`_: Fix185 (take two) | |||
|
173 | * `251 <https://github.com/ipython/ipython/issues/251>`_: Issue 129 | |||
|
174 | * `278 <https://github.com/ipython/ipython/issues/278>`_: add basic XDG_CONFIG_HOME support | |||
|
175 | * `275 <https://github.com/ipython/ipython/issues/275>`_: inline pylab cuts off labels on log plots | |||
|
176 | * `280 <https://github.com/ipython/ipython/issues/280>`_: Add %precision magic | |||
|
177 | * `259 <https://github.com/ipython/ipython/issues/259>`_: Pyside support | |||
|
178 | * `193 <https://github.com/ipython/ipython/issues/193>`_: Make ipython cProfile-able | |||
|
179 | * `272 <https://github.com/ipython/ipython/issues/272>`_: Magic examples | |||
|
180 | * `219 <https://github.com/ipython/ipython/issues/219>`_: Doc magic pycat | |||
|
181 | * `221 <https://github.com/ipython/ipython/issues/221>`_: Doc magic alias | |||
|
182 | * `230 <https://github.com/ipython/ipython/issues/230>`_: Doc magic edit | |||
|
183 | * `224 <https://github.com/ipython/ipython/issues/224>`_: Doc magic cpaste | |||
|
184 | * `229 <https://github.com/ipython/ipython/issues/229>`_: Doc magic pdef | |||
|
185 | * `273 <https://github.com/ipython/ipython/issues/273>`_: Docs build | |||
|
186 | * `228 <https://github.com/ipython/ipython/issues/228>`_: Doc magic who | |||
|
187 | * `233 <https://github.com/ipython/ipython/issues/233>`_: Doc magic cd | |||
|
188 | * `226 <https://github.com/ipython/ipython/issues/226>`_: Doc magic pwd | |||
|
189 | * `218 <https://github.com/ipython/ipython/issues/218>`_: Doc magic history | |||
|
190 | * `231 <https://github.com/ipython/ipython/issues/231>`_: Doc magic reset | |||
|
191 | * `225 <https://github.com/ipython/ipython/issues/225>`_: Doc magic save | |||
|
192 | * `222 <https://github.com/ipython/ipython/issues/222>`_: Doc magic timeit | |||
|
193 | * `223 <https://github.com/ipython/ipython/issues/223>`_: Doc magic colors | |||
|
194 | * `203 <https://github.com/ipython/ipython/issues/203>`_: Small typos in zmq/blockingkernelmanager.py | |||
|
195 | * `227 <https://github.com/ipython/ipython/issues/227>`_: Doc magic logon | |||
|
196 | * `232 <https://github.com/ipython/ipython/issues/232>`_: Doc magic profile | |||
|
197 | * `264 <https://github.com/ipython/ipython/issues/264>`_: Kernel logging | |||
|
198 | * `220 <https://github.com/ipython/ipython/issues/220>`_: Doc magic edit | |||
|
199 | * `268 <https://github.com/ipython/ipython/issues/268>`_: PyZMQ >= 2.0.10 | |||
|
200 | * `267 <https://github.com/ipython/ipython/issues/267>`_: GitHub Pages (again) | |||
|
201 | * `266 <https://github.com/ipython/ipython/issues/266>`_: OSX-specific fixes to the Qt console | |||
|
202 | * `255 <https://github.com/ipython/ipython/issues/255>`_: Gitwash typo | |||
|
203 | * `265 <https://github.com/ipython/ipython/issues/265>`_: Fix string input2 | |||
|
204 | * `260 <https://github.com/ipython/ipython/issues/260>`_: Kernel crash with empty history | |||
|
205 | * `243 <https://github.com/ipython/ipython/issues/243>`_: New display system | |||
|
206 | * `242 <https://github.com/ipython/ipython/issues/242>`_: Fix terminal exit | |||
|
207 | * `250 <https://github.com/ipython/ipython/issues/250>`_: always use Session.send | |||
|
208 | * `239 <https://github.com/ipython/ipython/issues/239>`_: Makefile command & script for GitHub Pages | |||
|
209 | * `244 <https://github.com/ipython/ipython/issues/244>`_: My exit | |||
|
210 | * `234 <https://github.com/ipython/ipython/issues/234>`_: Timed history save | |||
|
211 | * `217 <https://github.com/ipython/ipython/issues/217>`_: Doc magic lsmagic | |||
|
212 | * `215 <https://github.com/ipython/ipython/issues/215>`_: History fix | |||
|
213 | * `195 <https://github.com/ipython/ipython/issues/195>`_: Formatters | |||
|
214 | * `192 <https://github.com/ipython/ipython/issues/192>`_: Ready colorize bug | |||
|
215 | * `198 <https://github.com/ipython/ipython/issues/198>`_: Windows workdir | |||
|
216 | * `174 <https://github.com/ipython/ipython/issues/174>`_: Whitespace cleanup | |||
|
217 | * `188 <https://github.com/ipython/ipython/issues/188>`_: Version info: update our version management system to use git. | |||
|
218 | * `158 <https://github.com/ipython/ipython/issues/158>`_: Ready for merge | |||
|
219 | * `187 <https://github.com/ipython/ipython/issues/187>`_: Resolved Print shortcut collision with ctrl-P emacs binding | |||
|
220 | * `183 <https://github.com/ipython/ipython/issues/183>`_: cleanup of exit/quit commands for qt console | |||
|
221 | * `184 <https://github.com/ipython/ipython/issues/184>`_: Logo added to sphinx docs | |||
|
222 | * `180 <https://github.com/ipython/ipython/issues/180>`_: Cleanup old code | |||
|
223 | * `171 <https://github.com/ipython/ipython/issues/171>`_: Expose Pygments styles as options | |||
|
224 | * `170 <https://github.com/ipython/ipython/issues/170>`_: HTML Fixes | |||
|
225 | * `172 <https://github.com/ipython/ipython/issues/172>`_: Fix del method exit test | |||
|
226 | * `164 <https://github.com/ipython/ipython/issues/164>`_: Qt frontend shutdown behavior fixes and enhancements | |||
|
227 | * `167 <https://github.com/ipython/ipython/issues/167>`_: Added HTML export | |||
|
228 | * `163 <https://github.com/ipython/ipython/issues/163>`_: Execution refactor | |||
|
229 | * `159 <https://github.com/ipython/ipython/issues/159>`_: Ipy3 preparation | |||
|
230 | * `155 <https://github.com/ipython/ipython/issues/155>`_: Ready startup fix | |||
|
231 | * `152 <https://github.com/ipython/ipython/issues/152>`_: 0.10.1 sge | |||
|
232 | * `151 <https://github.com/ipython/ipython/issues/151>`_: mk_object_info -> object_info | |||
|
233 | * `149 <https://github.com/ipython/ipython/issues/149>`_: Simple bug-fix | |||
|
234 | ||||
|
235 | Regular issues (285): | |||
|
236 | ||||
|
237 | * `630 <https://github.com/ipython/ipython/issues/630>`_: new.py in pwd prevents ipython from starting | |||
|
238 | * `623 <https://github.com/ipython/ipython/issues/623>`_: Execute DirectView commands while running LoadBalancedView tasks | |||
|
239 | * `437 <https://github.com/ipython/ipython/issues/437>`_: Users should have autocompletion in the notebook | |||
|
240 | * `583 <https://github.com/ipython/ipython/issues/583>`_: update manpages | |||
|
241 | * `594 <https://github.com/ipython/ipython/issues/594>`_: irunner command line options defer to file extensions | |||
|
242 | * `603 <https://github.com/ipython/ipython/issues/603>`_: Users should see colored text in tracebacks and the pager | |||
|
243 | * `597 <https://github.com/ipython/ipython/issues/597>`_: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 | |||
|
244 | * `608 <https://github.com/ipython/ipython/issues/608>`_: Organize and layout buttons in the notebook panel sections | |||
|
245 | * `609 <https://github.com/ipython/ipython/issues/609>`_: Implement controls in the Kernel panel section | |||
|
246 | * `611 <https://github.com/ipython/ipython/issues/611>`_: Add kernel status widget back to notebook | |||
|
247 | * `610 <https://github.com/ipython/ipython/issues/610>`_: Implement controls in the Cell section panel | |||
|
248 | * `612 <https://github.com/ipython/ipython/issues/612>`_: Implement Help panel section | |||
|
249 | * `621 <https://github.com/ipython/ipython/issues/621>`_: [qtconsole] on windows xp, cannot PageUp more than once | |||
|
250 | * `616 <https://github.com/ipython/ipython/issues/616>`_: Store exit status of last command | |||
|
251 | * `605 <https://github.com/ipython/ipython/issues/605>`_: Users should be able to open different notebooks in the cwd | |||
|
252 | * `302 <https://github.com/ipython/ipython/issues/302>`_: Users should see a consistent behavior in the Out prompt in the html notebook | |||
|
253 | * `435 <https://github.com/ipython/ipython/issues/435>`_: Notebook should not import anything by default | |||
|
254 | * `595 <https://github.com/ipython/ipython/issues/595>`_: qtconsole command issue | |||
|
255 | * `588 <https://github.com/ipython/ipython/issues/588>`_: ipython-qtconsole uses 100% CPU | |||
|
256 | * `586 <https://github.com/ipython/ipython/issues/586>`_: ? + plot() Command B0rks QTConsole Strangely | |||
|
257 | * `585 <https://github.com/ipython/ipython/issues/585>`_: %pdoc throws Errors for classes without __init__ or docstring | |||
|
258 | * `584 <https://github.com/ipython/ipython/issues/584>`_: %pdoc throws TypeError | |||
|
259 | * `580 <https://github.com/ipython/ipython/issues/580>`_: Client instantiation AssertionError | |||
|
260 | * `569 <https://github.com/ipython/ipython/issues/569>`_: UnicodeDecodeError during startup | |||
|
261 | * `572 <https://github.com/ipython/ipython/issues/572>`_: Indented command hits error | |||
|
262 | * `573 <https://github.com/ipython/ipython/issues/573>`_: -wthread breaks indented top-level statements | |||
|
263 | * `570 <https://github.com/ipython/ipython/issues/570>`_: "--pylab inline" vs. "--pylab=inline" | |||
|
264 | * `566 <https://github.com/ipython/ipython/issues/566>`_: Can't use exec_file in config file | |||
|
265 | * `562 <https://github.com/ipython/ipython/issues/562>`_: update docs to reflect '--args=values' | |||
|
266 | * `558 <https://github.com/ipython/ipython/issues/558>`_: triple quote and %s at beginning of line | |||
|
267 | * `554 <https://github.com/ipython/ipython/issues/554>`_: Update 0.11 docs to explain Qt console and how to do a clean install | |||
|
268 | * `553 <https://github.com/ipython/ipython/issues/553>`_: embed() fails if config files not installed | |||
|
269 | * `8 <https://github.com/ipython/ipython/issues/8>`_: Ensure %gui qt works with new Mayavi and pylab | |||
|
270 | * `269 <https://github.com/ipython/ipython/issues/269>`_: Provide compatibility api for IPython.Shell().start().mainloop() | |||
|
271 | * `66 <https://github.com/ipython/ipython/issues/66>`_: Update the main What's New document to reflect work on 0.11 | |||
|
272 | * `549 <https://github.com/ipython/ipython/issues/549>`_: Don't check for 'linux2' value in sys.platform | |||
|
273 | * `505 <https://github.com/ipython/ipython/issues/505>`_: Qt windows created within imported functions won't show() | |||
|
274 | * `545 <https://github.com/ipython/ipython/issues/545>`_: qtconsole ignores exec_lines | |||
|
275 | * `371 <https://github.com/ipython/ipython/issues/371>`_: segfault in qtconsole when kernel quits | |||
|
276 | * `377 <https://github.com/ipython/ipython/issues/377>`_: Failure: error (nothing to repeat) | |||
|
277 | * `544 <https://github.com/ipython/ipython/issues/544>`_: Ipython qtconsole pylab config issue. | |||
|
278 | * `543 <https://github.com/ipython/ipython/issues/543>`_: RuntimeError in completer | |||
|
279 | * `440 <https://github.com/ipython/ipython/issues/440>`_: %run filename autocompletion "The kernel heartbeat has been inactive ... " error | |||
|
280 | * `541 <https://github.com/ipython/ipython/issues/541>`_: log_level is broken in the ipython Application | |||
|
281 | * `369 <https://github.com/ipython/ipython/issues/369>`_: windows source install doesn't create scripts correctly | |||
|
282 | * `351 <https://github.com/ipython/ipython/issues/351>`_: Make sure that the Windows installer handles the top-level IPython scripts. | |||
|
283 | * `512 <https://github.com/ipython/ipython/issues/512>`_: Two displayhooks in zmq | |||
|
284 | * `340 <https://github.com/ipython/ipython/issues/340>`_: Make sure that the Windows HPC scheduler support is working for 0.11 | |||
|
285 | * `98 <https://github.com/ipython/ipython/issues/98>`_: Should be able to get help on an object mid-command | |||
|
286 | * `529 <https://github.com/ipython/ipython/issues/529>`_: unicode problem in qtconsole for windows | |||
|
287 | * `476 <https://github.com/ipython/ipython/issues/476>`_: Separate input area in Qt Console | |||
|
288 | * `175 <https://github.com/ipython/ipython/issues/175>`_: Qt console needs configuration support | |||
|
289 | * `156 <https://github.com/ipython/ipython/issues/156>`_: Key history lost when debugging program crash | |||
|
290 | * `470 <https://github.com/ipython/ipython/issues/470>`_: decorator: uses deprecated features | |||
|
291 | * `30 <https://github.com/ipython/ipython/issues/30>`_: readline in OS X does not have correct key bindings | |||
|
292 | * `503 <https://github.com/ipython/ipython/issues/503>`_: merge IPython.parallel.streamsession and IPython.zmq.session | |||
|
293 | * `456 <https://github.com/ipython/ipython/issues/456>`_: pathname in document punctuated by dots not slashes | |||
|
294 | * `451 <https://github.com/ipython/ipython/issues/451>`_: Allow switching the default image format for inline mpl backend | |||
|
295 | * `79 <https://github.com/ipython/ipython/issues/79>`_: Implement more robust handling of config stages in Application | |||
|
296 | * `522 <https://github.com/ipython/ipython/issues/522>`_: Encoding problems | |||
|
297 | * `524 <https://github.com/ipython/ipython/issues/524>`_: otool should not be unconditionally called on osx | |||
|
298 | * `523 <https://github.com/ipython/ipython/issues/523>`_: Get profile and config file inheritance working | |||
|
299 | * `519 <https://github.com/ipython/ipython/issues/519>`_: qtconsole --pure: "TypeError: string indices must be integers, not str" | |||
|
300 | * `516 <https://github.com/ipython/ipython/issues/516>`_: qtconsole --pure: "KeyError: 'ismagic'" | |||
|
301 | * `520 <https://github.com/ipython/ipython/issues/520>`_: qtconsole --pure: "TypeError: string indices must be integers, not str" | |||
|
302 | * `450 <https://github.com/ipython/ipython/issues/450>`_: resubmitted tasks sometimes stuck as pending | |||
|
303 | * `518 <https://github.com/ipython/ipython/issues/518>`_: JSON serialization problems with ObjectId type (MongoDB) | |||
|
304 | * `178 <https://github.com/ipython/ipython/issues/178>`_: Channels should be named for their function, not their socket type | |||
|
305 | * `515 <https://github.com/ipython/ipython/issues/515>`_: [ipcluster] termination on os x | |||
|
306 | * `510 <https://github.com/ipython/ipython/issues/510>`_: qtconsole: indentation problem printing numpy arrays | |||
|
307 | * `508 <https://github.com/ipython/ipython/issues/508>`_: "AssertionError: Missing message part." in ipython-qtconsole --pure | |||
|
308 | * `499 <https://github.com/ipython/ipython/issues/499>`_: "ZMQError: Interrupted system call" when saving inline figure | |||
|
309 | * `426 <https://github.com/ipython/ipython/issues/426>`_: %edit magic fails in qtconsole | |||
|
310 | * `497 <https://github.com/ipython/ipython/issues/497>`_: Don't show info from .pyd files | |||
|
311 | * `493 <https://github.com/ipython/ipython/issues/493>`_: QFont::setPointSize: Point size <= 0 (0), must be greater than 0 | |||
|
312 | * `489 <https://github.com/ipython/ipython/issues/489>`_: UnicodeEncodeError in qt.svg.save_svg | |||
|
313 | * `458 <https://github.com/ipython/ipython/issues/458>`_: embed() doesn't load default config | |||
|
314 | * `488 <https://github.com/ipython/ipython/issues/488>`_: Using IPython with RubyPython leads to problems with IPython.parallel.client.client.Client.__init() | |||
|
315 | * `401 <https://github.com/ipython/ipython/issues/401>`_: Race condition when running lbview.apply() fast multiple times in loop | |||
|
316 | * `168 <https://github.com/ipython/ipython/issues/168>`_: Scrub Launchpad links from code, docs | |||
|
317 | * `141 <https://github.com/ipython/ipython/issues/141>`_: garbage collection problem (revisited) | |||
|
318 | * `59 <https://github.com/ipython/ipython/issues/59>`_: test_magic.test_obj_del fails on win32 | |||
|
319 | * `457 <https://github.com/ipython/ipython/issues/457>`_: Backgrounded Tasks not Allowed? (but easy to slip by . . .) | |||
|
320 | * `297 <https://github.com/ipython/ipython/issues/297>`_: Shouldn't use pexpect for subprocesses in in-process terminal frontend | |||
|
321 | * `110 <https://github.com/ipython/ipython/issues/110>`_: magic to return exit status | |||
|
322 | * `473 <https://github.com/ipython/ipython/issues/473>`_: OSX readline detection fails in the debugger | |||
|
323 | * `466 <https://github.com/ipython/ipython/issues/466>`_: tests fail without unicode filename support | |||
|
324 | * `468 <https://github.com/ipython/ipython/issues/468>`_: iptest script has 0 exit code even when tests fail | |||
|
325 | * `465 <https://github.com/ipython/ipython/issues/465>`_: client.db_query() behaves different with SQLite and MongoDB | |||
|
326 | * `467 <https://github.com/ipython/ipython/issues/467>`_: magic_install_default_config test fails when there is no .ipython directory | |||
|
327 | * `463 <https://github.com/ipython/ipython/issues/463>`_: IPYTHON_DIR (and IPYTHONDIR) don't expand tilde to '~' directory | |||
|
328 | * `446 <https://github.com/ipython/ipython/issues/446>`_: Test machinery is imported at normal runtime | |||
|
329 | * `438 <https://github.com/ipython/ipython/issues/438>`_: Users should be able to use Up/Down for cell navigation | |||
|
330 | * `439 <https://github.com/ipython/ipython/issues/439>`_: Users should be able to copy notebook input and output | |||
|
331 | * `291 <https://github.com/ipython/ipython/issues/291>`_: Rename special display methods and put them lower in priority than display functions | |||
|
332 | * `447 <https://github.com/ipython/ipython/issues/447>`_: Instantiating classes without __init__ function causes kernel to crash | |||
|
333 | * `444 <https://github.com/ipython/ipython/issues/444>`_: Ctrl + t in WxIPython Causes Unexpected Behavior | |||
|
334 | * `445 <https://github.com/ipython/ipython/issues/445>`_: qt and console Based Startup Errors | |||
|
335 | * `428 <https://github.com/ipython/ipython/issues/428>`_: ipcluster doesn't handle stale pid info well | |||
|
336 | * `434 <https://github.com/ipython/ipython/issues/434>`_: 10.0.2 seg fault with rpy2 | |||
|
337 | * `441 <https://github.com/ipython/ipython/issues/441>`_: Allow running a block of code in a file | |||
|
338 | * `432 <https://github.com/ipython/ipython/issues/432>`_: Silent request fails | |||
|
339 | * `409 <https://github.com/ipython/ipython/issues/409>`_: Test failure in IPython.lib | |||
|
340 | * `402 <https://github.com/ipython/ipython/issues/402>`_: History section of messaging spec is incorrect | |||
|
341 | * `88 <https://github.com/ipython/ipython/issues/88>`_: Error when inputting UTF8 CJK characters | |||
|
342 | * `366 <https://github.com/ipython/ipython/issues/366>`_: Ctrl-K should kill line and store it, so that Ctrl-y can yank it back | |||
|
343 | * `425 <https://github.com/ipython/ipython/issues/425>`_: typo in %gui magic help | |||
|
344 | * `304 <https://github.com/ipython/ipython/issues/304>`_: Persistent warnings if old configuration files exist | |||
|
345 | * `216 <https://github.com/ipython/ipython/issues/216>`_: crash of ipython when alias is used with %s and echo | |||
|
346 | * `412 <https://github.com/ipython/ipython/issues/412>`_: add support to automatic retry of tasks | |||
|
347 | * `411 <https://github.com/ipython/ipython/issues/411>`_: add support to continue tasks | |||
|
348 | * `417 <https://github.com/ipython/ipython/issues/417>`_: IPython should display things unsorted if it can't sort them | |||
|
349 | * `416 <https://github.com/ipython/ipython/issues/416>`_: wrong encode when printing unicode string | |||
|
350 | * `376 <https://github.com/ipython/ipython/issues/376>`_: Failing InputsplitterTest | |||
|
351 | * `405 <https://github.com/ipython/ipython/issues/405>`_: TraitError in traitlets.py(332) on any input | |||
|
352 | * `392 <https://github.com/ipython/ipython/issues/392>`_: UnicodeEncodeError on start | |||
|
353 | * `137 <https://github.com/ipython/ipython/issues/137>`_: sys.getfilesystemencoding return value not checked | |||
|
354 | * `300 <https://github.com/ipython/ipython/issues/300>`_: Users should be able to manage kernels and kernel sessions from the notebook UI | |||
|
355 | * `301 <https://github.com/ipython/ipython/issues/301>`_: Users should have access to working Kernel, Tabs, Edit, Help menus in the notebook | |||
|
356 | * `396 <https://github.com/ipython/ipython/issues/396>`_: cursor move triggers a lot of IO access | |||
|
357 | * `379 <https://github.com/ipython/ipython/issues/379>`_: Minor doc nit: --paging argument | |||
|
358 | * `399 <https://github.com/ipython/ipython/issues/399>`_: Add task queue limit in engine when load-balancing | |||
|
359 | * `78 <https://github.com/ipython/ipython/issues/78>`_: StringTask won't take unicode code strings | |||
|
360 | * `391 <https://github.com/ipython/ipython/issues/391>`_: MongoDB.add_record() does not work in 0.11dev | |||
|
361 | * `365 <https://github.com/ipython/ipython/issues/365>`_: newparallel on Windows | |||
|
362 | * `386 <https://github.com/ipython/ipython/issues/386>`_: FAIL: test that pushed functions have access to globals | |||
|
363 | * `387 <https://github.com/ipython/ipython/issues/387>`_: Interactively defined functions can't access user namespace | |||
|
364 | * `118 <https://github.com/ipython/ipython/issues/118>`_: Snow Leopard ipy_vimserver POLL error | |||
|
365 | * `394 <https://github.com/ipython/ipython/issues/394>`_: System escape interpreted in multi-line string | |||
|
366 | * `26 <https://github.com/ipython/ipython/issues/26>`_: find_job_cmd is too hasty to fail on Windows | |||
|
367 | * `368 <https://github.com/ipython/ipython/issues/368>`_: Installation instructions in dev docs are completely wrong | |||
|
368 | * `380 <https://github.com/ipython/ipython/issues/380>`_: qtconsole pager RST - HTML not happening consistently | |||
|
369 | * `367 <https://github.com/ipython/ipython/issues/367>`_: Qt console doesn't support ibus input method | |||
|
370 | * `375 <https://github.com/ipython/ipython/issues/375>`_: Missing libraries cause ImportError in tests | |||
|
371 | * `71 <https://github.com/ipython/ipython/issues/71>`_: temp file errors in iptest IPython.core | |||
|
372 | * `350 <https://github.com/ipython/ipython/issues/350>`_: Decide how to handle displayhook being triggered multiple times | |||
|
373 | * `360 <https://github.com/ipython/ipython/issues/360>`_: Remove `runlines` method | |||
|
374 | * `125 <https://github.com/ipython/ipython/issues/125>`_: Exec lines in config should not contribute to line numbering or history | |||
|
375 | * `20 <https://github.com/ipython/ipython/issues/20>`_: Robust readline support on OS X's builtin Python | |||
|
376 | * `147 <https://github.com/ipython/ipython/issues/147>`_: On Windows, %page is being too restrictive to split line by \r\n only | |||
|
377 | * `326 <https://github.com/ipython/ipython/issues/326>`_: Update docs and examples for parallel stuff to reflect movement away from Twisted | |||
|
378 | * `341 <https://github.com/ipython/ipython/issues/341>`_: FIx Parallel Magics for newparallel | |||
|
379 | * `338 <https://github.com/ipython/ipython/issues/338>`_: Usability improvements to Qt console | |||
|
380 | * `142 <https://github.com/ipython/ipython/issues/142>`_: unexpected auto-indenting when varibles names that start with 'pass' | |||
|
381 | * `296 <https://github.com/ipython/ipython/issues/296>`_: Automatic PDB via %pdb doesn't work | |||
|
382 | * `337 <https://github.com/ipython/ipython/issues/337>`_: exit( and quit( in Qt console produces phantom signature/docstring popup, even though quit() or exit() raises NameError | |||
|
383 | * `318 <https://github.com/ipython/ipython/issues/318>`_: %debug broken in master: invokes missing save_history() method | |||
|
384 | * `307 <https://github.com/ipython/ipython/issues/307>`_: lines ending with semicolon should not go to cache | |||
|
385 | * `104 <https://github.com/ipython/ipython/issues/104>`_: have ipengine run start-up scripts before registering with the controller | |||
|
386 | * `33 <https://github.com/ipython/ipython/issues/33>`_: The skip_doctest decorator is failing to work on Shell.MatplotlibShellBase.magic_run | |||
|
387 | * `336 <https://github.com/ipython/ipython/issues/336>`_: Missing figure development/figs/iopubfade.png for docs | |||
|
388 | * `49 <https://github.com/ipython/ipython/issues/49>`_: %clear should also delete _NN references and Out[NN] ones | |||
|
389 | * `335 <https://github.com/ipython/ipython/issues/335>`_: using setuptools installs every script twice | |||
|
390 | * `306 <https://github.com/ipython/ipython/issues/306>`_: multiline strings at end of input cause noop | |||
|
391 | * `327 <https://github.com/ipython/ipython/issues/327>`_: PyPy compatibility | |||
|
392 | * `328 <https://github.com/ipython/ipython/issues/328>`_: %run script.ipy raises "ERROR! Session/line number was not unique in database." | |||
|
393 | * `7 <https://github.com/ipython/ipython/issues/7>`_: Update the changes doc to reflect the kernel config work | |||
|
394 | * `303 <https://github.com/ipython/ipython/issues/303>`_: Users should be able to scroll a notebook w/o moving the menu/buttons | |||
|
395 | * `322 <https://github.com/ipython/ipython/issues/322>`_: Embedding an interactive IPython shell | |||
|
396 | * `321 <https://github.com/ipython/ipython/issues/321>`_: %debug broken in master | |||
|
397 | * `287 <https://github.com/ipython/ipython/issues/287>`_: Crash when using %macros in sqlite-history branch | |||
|
398 | * `55 <https://github.com/ipython/ipython/issues/55>`_: Can't edit files whose names begin with numbers | |||
|
399 | * `284 <https://github.com/ipython/ipython/issues/284>`_: In variable no longer works in 0.11 | |||
|
400 | * `92 <https://github.com/ipython/ipython/issues/92>`_: Using multiprocessing module crashes parallel iPython | |||
|
401 | * `262 <https://github.com/ipython/ipython/issues/262>`_: Fail to recover history after force-kill. | |||
|
402 | * `320 <https://github.com/ipython/ipython/issues/320>`_: Tab completing re.search objects crashes IPython | |||
|
403 | * `317 <https://github.com/ipython/ipython/issues/317>`_: IPython.kernel: parallel map issues | |||
|
404 | * `197 <https://github.com/ipython/ipython/issues/197>`_: ipython-qtconsole unicode problem in magic ls | |||
|
405 | * `305 <https://github.com/ipython/ipython/issues/305>`_: more readline shortcuts in qtconsole | |||
|
406 | * `314 <https://github.com/ipython/ipython/issues/314>`_: Multi-line, multi-block cells can't be executed. | |||
|
407 | * `308 <https://github.com/ipython/ipython/issues/308>`_: Test suite should set sqlite history to work in :memory: | |||
|
408 | * `202 <https://github.com/ipython/ipython/issues/202>`_: Matplotlib native 'MacOSX' backend broken in '-pylab' mode | |||
|
409 | * `196 <https://github.com/ipython/ipython/issues/196>`_: IPython can't deal with unicode file name. | |||
|
410 | * `25 <https://github.com/ipython/ipython/issues/25>`_: unicode bug - encoding input | |||
|
411 | * `290 <https://github.com/ipython/ipython/issues/290>`_: try/except/else clauses can't be typed, code input stops too early. | |||
|
412 | * `43 <https://github.com/ipython/ipython/issues/43>`_: Implement SSH support in ipcluster | |||
|
413 | * `6 <https://github.com/ipython/ipython/issues/6>`_: Update the Sphinx docs for the new ipcluster | |||
|
414 | * `9 <https://github.com/ipython/ipython/issues/9>`_: Getting "DeadReferenceError: Calling Stale Broker" after ipcontroller restart | |||
|
415 | * `132 <https://github.com/ipython/ipython/issues/132>`_: Ipython prevent south from working | |||
|
416 | * `27 <https://github.com/ipython/ipython/issues/27>`_: generics.complete_object broken | |||
|
417 | * `60 <https://github.com/ipython/ipython/issues/60>`_: Improve absolute import management for iptest.py | |||
|
418 | * `31 <https://github.com/ipython/ipython/issues/31>`_: Issues in magic_whos code | |||
|
419 | * `52 <https://github.com/ipython/ipython/issues/52>`_: Document testing process better | |||
|
420 | * `44 <https://github.com/ipython/ipython/issues/44>`_: Merge history from multiple sessions | |||
|
421 | * `182 <https://github.com/ipython/ipython/issues/182>`_: ipython q4thread in version 10.1 not starting properly | |||
|
422 | * `143 <https://github.com/ipython/ipython/issues/143>`_: Ipython.gui.wx.ipython_view.IPShellWidget: ignores user*_ns arguments | |||
|
423 | * `127 <https://github.com/ipython/ipython/issues/127>`_: %edit does not work on filenames consisted of pure numbers | |||
|
424 | * `126 <https://github.com/ipython/ipython/issues/126>`_: Can't transfer command line argument to script | |||
|
425 | * `28 <https://github.com/ipython/ipython/issues/28>`_: Offer finer control for initialization of input streams | |||
|
426 | * `58 <https://github.com/ipython/ipython/issues/58>`_: ipython change char '0xe9' to 4 spaces | |||
|
427 | * `68 <https://github.com/ipython/ipython/issues/68>`_: Problems with Control-C stopping ipcluster on Windows/Python2.6 | |||
|
428 | * `24 <https://github.com/ipython/ipython/issues/24>`_: ipcluster does not start all the engines | |||
|
429 | * `240 <https://github.com/ipython/ipython/issues/240>`_: Incorrect method displayed in %psource | |||
|
430 | * `120 <https://github.com/ipython/ipython/issues/120>`_: inspect.getsource fails for functions defined on command line | |||
|
431 | * `212 <https://github.com/ipython/ipython/issues/212>`_: IPython ignores exceptions in the first evaulation of class attrs | |||
|
432 | * `108 <https://github.com/ipython/ipython/issues/108>`_: ipython disables python logger | |||
|
433 | * `100 <https://github.com/ipython/ipython/issues/100>`_: Overzealous introspection | |||
|
434 | * `18 <https://github.com/ipython/ipython/issues/18>`_: %cpaste freeze sync frontend | |||
|
435 | * `200 <https://github.com/ipython/ipython/issues/200>`_: Unicode error when starting ipython in a folder with non-ascii path | |||
|
436 | * `130 <https://github.com/ipython/ipython/issues/130>`_: Deadlock when importing a module that creates an IPython client | |||
|
437 | * `134 <https://github.com/ipython/ipython/issues/134>`_: multline block scrolling | |||
|
438 | * `46 <https://github.com/ipython/ipython/issues/46>`_: Input to %timeit is not preparsed | |||
|
439 | * `285 <https://github.com/ipython/ipython/issues/285>`_: ipcluster local -n 4 fails | |||
|
440 | * `205 <https://github.com/ipython/ipython/issues/205>`_: In the Qt console, Tab should insert 4 spaces when not completing | |||
|
441 | * `145 <https://github.com/ipython/ipython/issues/145>`_: Bug on MSW sytems: idle can not be set as default IPython editor. Fix Suggested. | |||
|
442 | * `77 <https://github.com/ipython/ipython/issues/77>`_: ipython oops in cygwin | |||
|
443 | * `121 <https://github.com/ipython/ipython/issues/121>`_: If plot windows are closed via window controls, no more plotting is possible. | |||
|
444 | * `111 <https://github.com/ipython/ipython/issues/111>`_: Iterator version of TaskClient.map() that returns results as they become available | |||
|
445 | * `109 <https://github.com/ipython/ipython/issues/109>`_: WinHPCLauncher is a hard dependency that causes errors in the test suite | |||
|
446 | * `86 <https://github.com/ipython/ipython/issues/86>`_: Make IPython work with multiprocessing | |||
|
447 | * `15 <https://github.com/ipython/ipython/issues/15>`_: Implement SGE support in ipcluster | |||
|
448 | * `3 <https://github.com/ipython/ipython/issues/3>`_: Implement PBS support in ipcluster | |||
|
449 | * `53 <https://github.com/ipython/ipython/issues/53>`_: Internal Python error in the inspect module | |||
|
450 | * `74 <https://github.com/ipython/ipython/issues/74>`_: Manager() [from multiprocessing module] hangs ipythonx but not ipython | |||
|
451 | * `51 <https://github.com/ipython/ipython/issues/51>`_: Out not working with ipythonx | |||
|
452 | * `201 <https://github.com/ipython/ipython/issues/201>`_: use session.send throughout zmq code | |||
|
453 | * `115 <https://github.com/ipython/ipython/issues/115>`_: multiline specials not defined in 0.11 branch | |||
|
454 | * `93 <https://github.com/ipython/ipython/issues/93>`_: when looping, cursor appears at leftmost point in newline | |||
|
455 | * `133 <https://github.com/ipython/ipython/issues/133>`_: whitespace after Source introspection | |||
|
456 | * `50 <https://github.com/ipython/ipython/issues/50>`_: Ctrl-C with -gthread on Windows, causes uncaught IOError | |||
|
457 | * `65 <https://github.com/ipython/ipython/issues/65>`_: Do not use .message attributes in exceptions, deprecated in 2.6 | |||
|
458 | * `76 <https://github.com/ipython/ipython/issues/76>`_: syntax error when raise is inside except process | |||
|
459 | * `107 <https://github.com/ipython/ipython/issues/107>`_: bdist_rpm causes traceback looking for a non-existant file | |||
|
460 | * `113 <https://github.com/ipython/ipython/issues/113>`_: initial magic ? (question mark) fails before wildcard | |||
|
461 | * `128 <https://github.com/ipython/ipython/issues/128>`_: Pdb instance has no attribute 'curframe' | |||
|
462 | * `139 <https://github.com/ipython/ipython/issues/139>`_: running with -pylab pollutes namespace | |||
|
463 | * `140 <https://github.com/ipython/ipython/issues/140>`_: malloc error during tab completion of numpy array member functions starting with 'c' | |||
|
464 | * `153 <https://github.com/ipython/ipython/issues/153>`_: ipy_vimserver traceback on Windows | |||
|
465 | * `154 <https://github.com/ipython/ipython/issues/154>`_: using ipython in Slicer3 show how os.environ['HOME'] is not defined | |||
|
466 | * `185 <https://github.com/ipython/ipython/issues/185>`_: show() blocks in pylab mode with ipython 0.10.1 | |||
|
467 | * `189 <https://github.com/ipython/ipython/issues/189>`_: Crash on tab completion | |||
|
468 | * `274 <https://github.com/ipython/ipython/issues/274>`_: bashism in sshx.sh | |||
|
469 | * `276 <https://github.com/ipython/ipython/issues/276>`_: Calling `sip.setapi` does not work if app has already imported from PyQt4 | |||
|
470 | * `277 <https://github.com/ipython/ipython/issues/277>`_: matplotlib.image imgshow from 10.1 segfault | |||
|
471 | * `288 <https://github.com/ipython/ipython/issues/288>`_: Incorrect docstring in zmq/kernelmanager.py | |||
|
472 | * `286 <https://github.com/ipython/ipython/issues/286>`_: Fix IPython.Shell compatibility layer | |||
|
473 | * `99 <https://github.com/ipython/ipython/issues/99>`_: blank lines in history | |||
|
474 | * `129 <https://github.com/ipython/ipython/issues/129>`_: psearch: TypeError: expected string or buffer | |||
|
475 | * `190 <https://github.com/ipython/ipython/issues/190>`_: Add option to format float point output | |||
|
476 | * `246 <https://github.com/ipython/ipython/issues/246>`_: Application not conforms XDG Base Directory Specification | |||
|
477 | * `48 <https://github.com/ipython/ipython/issues/48>`_: IPython should follow the XDG Base Directory spec for configuration | |||
|
478 | * `176 <https://github.com/ipython/ipython/issues/176>`_: Make client-side history persistence readline-independent | |||
|
479 | * `279 <https://github.com/ipython/ipython/issues/279>`_: Backtraces when using ipdb do not respect -colour LightBG setting | |||
|
480 | * `119 <https://github.com/ipython/ipython/issues/119>`_: Broken type filter in magic_who_ls | |||
|
481 | * `271 <https://github.com/ipython/ipython/issues/271>`_: Intermittent problem with print output in Qt console. | |||
|
482 | * `270 <https://github.com/ipython/ipython/issues/270>`_: Small typo in IPython developer’s guide | |||
|
483 | * `166 <https://github.com/ipython/ipython/issues/166>`_: Add keyboard accelerators to Qt close dialog | |||
|
484 | * `173 <https://github.com/ipython/ipython/issues/173>`_: asymmetrical ctrl-A/ctrl-E behavior in multiline | |||
|
485 | * `45 <https://github.com/ipython/ipython/issues/45>`_: Autosave history for robustness | |||
|
486 | * `162 <https://github.com/ipython/ipython/issues/162>`_: make command history persist in ipythonqt | |||
|
487 | * `161 <https://github.com/ipython/ipython/issues/161>`_: make ipythonqt exit without dialog when exit() is called | |||
|
488 | * `263 <https://github.com/ipython/ipython/issues/263>`_: [ipython + numpy] Some test errors | |||
|
489 | * `256 <https://github.com/ipython/ipython/issues/256>`_: reset docstring ipython 0.10 | |||
|
490 | * `258 <https://github.com/ipython/ipython/issues/258>`_: allow caching to avoid matplotlib object referrences | |||
|
491 | * `248 <https://github.com/ipython/ipython/issues/248>`_: Can't open and read files after upgrade from 0.10 to 0.10.0 | |||
|
492 | * `247 <https://github.com/ipython/ipython/issues/247>`_: ipython + Stackless | |||
|
493 | * `245 <https://github.com/ipython/ipython/issues/245>`_: Magic save and macro missing newlines, line ranges don't match prompt numbers. | |||
|
494 | * `241 <https://github.com/ipython/ipython/issues/241>`_: "exit" hangs on terminal version of IPython | |||
|
495 | * `213 <https://github.com/ipython/ipython/issues/213>`_: ipython -pylab no longer plots interactively on 0.10.1 | |||
|
496 | * `4 <https://github.com/ipython/ipython/issues/4>`_: wx frontend don't display well commands output | |||
|
497 | * `5 <https://github.com/ipython/ipython/issues/5>`_: ls command not supported in ipythonx wx frontend | |||
|
498 | * `1 <https://github.com/ipython/ipython/issues/1>`_: Document winhpcjob.py and launcher.py | |||
|
499 | * `83 <https://github.com/ipython/ipython/issues/83>`_: Usage of testing.util.DeferredTestCase should be replace with twisted.trial.unittest.TestCase | |||
|
500 | * `117 <https://github.com/ipython/ipython/issues/117>`_: Redesign how Component instances are tracked and queried | |||
|
501 | * `47 <https://github.com/ipython/ipython/issues/47>`_: IPython.kernel.client cannot be imported inside an engine | |||
|
502 | * `105 <https://github.com/ipython/ipython/issues/105>`_: Refactor the task dependencies system | |||
|
503 | * `210 <https://github.com/ipython/ipython/issues/210>`_: 0.10.1 doc mistake - New IPython Sphinx directive error | |||
|
504 | * `209 <https://github.com/ipython/ipython/issues/209>`_: can't activate IPython parallel magics | |||
|
505 | * `206 <https://github.com/ipython/ipython/issues/206>`_: Buggy linewrap in Mac OSX Terminal | |||
|
506 | * `194 <https://github.com/ipython/ipython/issues/194>`_: !sudo <command> displays password in plain text | |||
|
507 | * `186 <https://github.com/ipython/ipython/issues/186>`_: %edit issue under OS X 10.5 - IPython 0.10.1 | |||
|
508 | * `11 <https://github.com/ipython/ipython/issues/11>`_: Create a daily build PPA for ipython | |||
|
509 | * `144 <https://github.com/ipython/ipython/issues/144>`_: logo missing from sphinx docs | |||
|
510 | * `181 <https://github.com/ipython/ipython/issues/181>`_: cls command does not work on windows | |||
|
511 | * `169 <https://github.com/ipython/ipython/issues/169>`_: Kernel can only be bound to localhost | |||
|
512 | * `36 <https://github.com/ipython/ipython/issues/36>`_: tab completion does not escape () | |||
|
513 | * `177 <https://github.com/ipython/ipython/issues/177>`_: Report tracebacks of interactively entered input | |||
|
514 | * `148 <https://github.com/ipython/ipython/issues/148>`_: dictionary having multiple keys having frozenset fails to print on iPython | |||
|
515 | * `160 <https://github.com/ipython/ipython/issues/160>`_: magic_gui throws TypeError when gui magic is used | |||
|
516 | * `150 <https://github.com/ipython/ipython/issues/150>`_: History entries ending with parentheses corrupt command line on OS X 10.6.4 | |||
|
517 | * `146 <https://github.com/ipython/ipython/issues/146>`_: -ipythondir - using an alternative .ipython dir for rc type stuff | |||
|
518 | * `114 <https://github.com/ipython/ipython/issues/114>`_: Interactive strings get mangled with "_ip.magic" | |||
|
519 | * `135 <https://github.com/ipython/ipython/issues/135>`_: crash on invalid print | |||
|
520 | * `69 <https://github.com/ipython/ipython/issues/69>`_: Usage of "mycluster" profile in docs and examples | |||
|
521 | * `37 <https://github.com/ipython/ipython/issues/37>`_: Fix colors in output of ResultList on Windows |
@@ -693,7 +693,7 b" def magic_history(self, parameter_s = ''):" | |||||
693 |
|
693 | |||
694 |
|
694 | |||
695 | def magic_rep(self, arg): |
|
695 | def magic_rep(self, arg): | |
696 |
r""" |
|
696 | r"""Repeat a command, or get command to input line for editing | |
697 |
|
697 | |||
698 | - %rep (no arguments): |
|
698 | - %rep (no arguments): | |
699 |
|
699 |
@@ -385,20 +385,6 b' IPython ships with automagic on, so you should only rarely need the % escape.' | |||||
385 | Example: typing '%cd mydir' (without the quotes) changes you working directory |
|
385 | Example: typing '%cd mydir' (without the quotes) changes you working directory | |
386 | to 'mydir', if it exists. |
|
386 | to 'mydir', if it exists. | |
387 |
|
387 | |||
388 | You can define your own magic functions to extend the system. See the supplied |
|
|||
389 | ipythonrc and example-magic.py files for details (in your ipython |
|
|||
390 | configuration directory, typically $HOME/.config/ipython on Linux or $HOME/.ipython elsewhere). |
|
|||
391 |
|
||||
392 | You can also define your own aliased names for magic functions. In your |
|
|||
393 | ipythonrc file, placing a line like: |
|
|||
394 |
|
||||
395 | execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile |
|
|||
396 |
|
||||
397 | will define %pf as a new name for %profile. |
|
|||
398 |
|
||||
399 | You can also call magics in code using the magic() function, which IPython |
|
|||
400 | automatically adds to the builtin namespace. Type 'magic?' for details. |
|
|||
401 |
|
||||
402 | For a list of the available magic functions, use %lsmagic. For a description |
|
388 | For a list of the available magic functions, use %lsmagic. For a description | |
403 | of any of them, type %magic_name?, e.g. '%cd?'. |
|
389 | of any of them, type %magic_name?, e.g. '%cd?'. | |
404 |
|
390 |
@@ -26,7 +26,6 b' Tools for Interactive Computing in Python' | |||||
26 |
|
26 | |||
27 |
|
27 | |||
28 | Usage |
|
28 | Usage | |
29 | ----- |
|
|||
30 |
|
29 | |||
31 | ipython [subcommand] [options] [files] |
|
30 | ipython [subcommand] [options] [files] | |
32 |
|
31 |
1 | NO CONTENT: modified file chmod 100644 => 100755 |
|
NO CONTENT: modified file chmod 100644 => 100755 |
@@ -115,13 +115,14 b' class InputHookManager(object):' | |||||
115 | elif self._apps.has_key(gui): |
|
115 | elif self._apps.has_key(gui): | |
116 | del self._apps[gui] |
|
116 | del self._apps[gui] | |
117 |
|
117 | |||
118 | def enable_wx(self): |
|
118 | def enable_wx(self, app=None): | |
119 | """Enable event loop integration with wxPython. |
|
119 | """Enable event loop integration with wxPython. | |
120 |
|
120 | |||
121 | Parameters |
|
121 | Parameters | |
122 | ---------- |
|
122 | ---------- | |
123 | app : bool |
|
123 | app : WX Application, optional. | |
124 | Create a running application object or not. |
|
124 | Running application to use. If not given, we probe WX for an | |
|
125 | existing application object, and create a new one if none is found. | |||
125 |
|
126 | |||
126 | Notes |
|
127 | Notes | |
127 | ----- |
|
128 | ----- | |
@@ -129,22 +130,19 b' class InputHookManager(object):' | |||||
129 | the wxPython to integrate with terminal based applications like |
|
130 | the wxPython to integrate with terminal based applications like | |
130 | IPython. |
|
131 | IPython. | |
131 |
|
132 | |||
132 | If ``app`` is True, we create an :class:`wx.App` as follows:: |
|
133 | If ``app`` is not given we probe for an existing one, and return it if | |
|
134 | found. If no existing app is found, we create an :class:`wx.App` as | |||
|
135 | follows:: | |||
133 |
|
136 | |||
134 | import wx |
|
137 | import wx | |
135 | app = wx.App(redirect=False, clearSigInt=False) |
|
138 | app = wx.App(redirect=False, clearSigInt=False) | |
136 |
|
||||
137 | Both options this constructor are important for things to work |
|
|||
138 | properly in an interactive context. |
|
|||
139 |
|
||||
140 | But, we first check to see if an application has already been |
|
|||
141 | created. If so, we simply return that instance. |
|
|||
142 | """ |
|
139 | """ | |
143 | from IPython.lib.inputhookwx import inputhook_wx |
|
140 | from IPython.lib.inputhookwx import inputhook_wx | |
144 | self.set_inputhook(inputhook_wx) |
|
141 | self.set_inputhook(inputhook_wx) | |
145 | self._current_gui = GUI_WX |
|
142 | self._current_gui = GUI_WX | |
146 | import wx |
|
143 | import wx | |
147 | app = wx.GetApp() |
|
144 | if app is None: | |
|
145 | app = wx.GetApp() | |||
148 | if app is None: |
|
146 | if app is None: | |
149 | app = wx.App(redirect=False, clearSigInt=False) |
|
147 | app = wx.App(redirect=False, clearSigInt=False) | |
150 | app._in_event_loop = True |
|
148 | app._in_event_loop = True | |
@@ -160,13 +158,14 b' class InputHookManager(object):' | |||||
160 | self._apps[GUI_WX]._in_event_loop = False |
|
158 | self._apps[GUI_WX]._in_event_loop = False | |
161 | self.clear_inputhook() |
|
159 | self.clear_inputhook() | |
162 |
|
160 | |||
163 | def enable_qt4(self): |
|
161 | def enable_qt4(self, app=None): | |
164 | """Enable event loop integration with PyQt4. |
|
162 | """Enable event loop integration with PyQt4. | |
165 |
|
163 | |||
166 | Parameters |
|
164 | Parameters | |
167 | ---------- |
|
165 | ---------- | |
168 | app : bool |
|
166 | app : Qt Application, optional. | |
169 | Create a running application object or not. |
|
167 | Running application to use. If not given, we probe Qt for an | |
|
168 | existing application object, and create a new one if none is found. | |||
170 |
|
169 | |||
171 | Notes |
|
170 | Notes | |
172 | ----- |
|
171 | ----- | |
@@ -174,13 +173,12 b' class InputHookManager(object):' | |||||
174 | the PyQt4 to integrate with terminal based applications like |
|
173 | the PyQt4 to integrate with terminal based applications like | |
175 | IPython. |
|
174 | IPython. | |
176 |
|
175 | |||
177 | If ``app`` is True, we create an :class:`QApplication` as follows:: |
|
176 | If ``app`` is not given we probe for an existing one, and return it if | |
|
177 | found. If no existing app is found, we create an :class:`QApplication` | |||
|
178 | as follows:: | |||
178 |
|
179 | |||
179 | from PyQt4 import QtCore |
|
180 | from PyQt4 import QtCore | |
180 | app = QtGui.QApplication(sys.argv) |
|
181 | app = QtGui.QApplication(sys.argv) | |
181 |
|
||||
182 | But, we first check to see if an application has already been |
|
|||
183 | created. If so, we simply return that instance. |
|
|||
184 | """ |
|
182 | """ | |
185 | from IPython.external.qt_for_kernel import QtCore, QtGui |
|
183 | from IPython.external.qt_for_kernel import QtCore, QtGui | |
186 |
|
184 | |||
@@ -205,7 +203,8 b' class InputHookManager(object):' | |||||
205 | pass |
|
203 | pass | |
206 |
|
204 | |||
207 | self._current_gui = GUI_QT4 |
|
205 | self._current_gui = GUI_QT4 | |
208 | app = QtCore.QCoreApplication.instance() |
|
206 | if app is None: | |
|
207 | app = QtCore.QCoreApplication.instance() | |||
209 | if app is None: |
|
208 | if app is None: | |
210 | app = QtGui.QApplication([" "]) |
|
209 | app = QtGui.QApplication([" "]) | |
211 | app._in_event_loop = True |
|
210 | app._in_event_loop = True | |
@@ -221,14 +220,15 b' class InputHookManager(object):' | |||||
221 | self._apps[GUI_QT4]._in_event_loop = False |
|
220 | self._apps[GUI_QT4]._in_event_loop = False | |
222 | self.clear_inputhook() |
|
221 | self.clear_inputhook() | |
223 |
|
222 | |||
224 |
def enable_gtk(self, app= |
|
223 | def enable_gtk(self, app=None): | |
225 | """Enable event loop integration with PyGTK. |
|
224 | """Enable event loop integration with PyGTK. | |
226 |
|
225 | |||
227 | Parameters |
|
226 | Parameters | |
228 | ---------- |
|
227 | ---------- | |
229 |
app : |
|
228 | app : ignored | |
230 | Create a running application object or not. Because gtk does't |
|
229 | Ignored, it's only a placeholder to keep the call signature of all | |
231 | have an app class, this does nothing. |
|
230 | gui activation methods consistent, which simplifies the logic of | |
|
231 | supporting magics. | |||
232 |
|
232 | |||
233 | Notes |
|
233 | Notes | |
234 | ----- |
|
234 | ----- | |
@@ -253,21 +253,24 b' class InputHookManager(object):' | |||||
253 | """ |
|
253 | """ | |
254 | self.clear_inputhook() |
|
254 | self.clear_inputhook() | |
255 |
|
255 | |||
256 |
def enable_tk(self, app= |
|
256 | def enable_tk(self, app=None): | |
257 | """Enable event loop integration with Tk. |
|
257 | """Enable event loop integration with Tk. | |
258 |
|
258 | |||
259 | Parameters |
|
259 | Parameters | |
260 | ---------- |
|
260 | ---------- | |
261 | app : bool |
|
261 | app : toplevel :class:`Tkinter.Tk` widget, optional. | |
262 | Create a running application object or not. |
|
262 | Running toplevel widget to use. If not given, we probe Tk for an | |
|
263 | existing one, and create a new one if none is found. | |||
263 |
|
264 | |||
264 | Notes |
|
265 | Notes | |
265 | ----- |
|
266 | ----- | |
266 |
|
|
267 | If you have already created a :class:`Tkinter.Tk` object, the only | |
|
268 | thing done by this method is to register with the | |||
|
269 | :class:`InputHookManager`, since creating that object automatically | |||
267 | sets ``PyOS_InputHook``. |
|
270 | sets ``PyOS_InputHook``. | |
268 | """ |
|
271 | """ | |
269 | self._current_gui = GUI_TK |
|
272 | self._current_gui = GUI_TK | |
270 | if app: |
|
273 | if app is None: | |
271 | import Tkinter |
|
274 | import Tkinter | |
272 | app = Tkinter.Tk() |
|
275 | app = Tkinter.Tk() | |
273 | app.withdraw() |
|
276 | app.withdraw() | |
@@ -302,7 +305,7 b' clear_app_refs = inputhook_manager.clear_app_refs' | |||||
302 |
|
305 | |||
303 |
|
306 | |||
304 | # Convenience function to switch amongst them |
|
307 | # Convenience function to switch amongst them | |
305 | def enable_gui(gui=None): |
|
308 | def enable_gui(gui=None, app=None): | |
306 | """Switch amongst GUI input hooks by name. |
|
309 | """Switch amongst GUI input hooks by name. | |
307 |
|
310 | |||
308 | This is just a utility wrapper around the methods of the InputHookManager |
|
311 | This is just a utility wrapper around the methods of the InputHookManager | |
@@ -314,8 +317,11 b' def enable_gui(gui=None):' | |||||
314 | If None, clears input hook, otherwise it must be one of the recognized |
|
317 | If None, clears input hook, otherwise it must be one of the recognized | |
315 | GUI names (see ``GUI_*`` constants in module). |
|
318 | GUI names (see ``GUI_*`` constants in module). | |
316 |
|
319 | |||
317 | app : optional, bool |
|
320 | app : optional, existing application object. | |
318 | If true, create an app object and return it. |
|
321 | For toolkits that have the concept of a global app, you can supply an | |
|
322 | existing one. If not given, the toolkit will be probed for one, and if | |||
|
323 | none is found, a new one will be created. Note that GTK does not have | |||
|
324 | this concept, and passing an app if `gui`=="GTK" will raise an error. | |||
319 |
|
325 | |||
320 | Returns |
|
326 | Returns | |
321 | ------- |
|
327 | ------- | |
@@ -333,7 +339,7 b' def enable_gui(gui=None):' | |||||
333 | try: |
|
339 | try: | |
334 | gui_hook = guis[gui] |
|
340 | gui_hook = guis[gui] | |
335 | except KeyError: |
|
341 | except KeyError: | |
336 | e="Invalid GUI request %r, valid ones are:%s" % (gui, guis.keys()) |
|
342 | e = "Invalid GUI request %r, valid ones are:%s" % (gui, guis.keys()) | |
337 | raise ValueError(e) |
|
343 | raise ValueError(e) | |
338 | return gui_hook() |
|
344 | return gui_hook(app) | |
339 |
|
345 |
@@ -196,7 +196,7 b" def raw_input_multi(header='', ps1='==> ', ps2='..> ',terminate_str = '.'):" | |||||
196 |
|
196 | |||
197 | return lines[:-1] # don't return the termination command |
|
197 | return lines[:-1] # don't return the termination command | |
198 | except EOFError: |
|
198 | except EOFError: | |
199 |
|
199 | print() | ||
200 | return lines |
|
200 | return lines | |
201 |
|
201 | |||
202 |
|
202 | |||
@@ -232,7 +232,7 b' def ask_yes_no(prompt,default=None):' | |||||
232 | except EOFError: |
|
232 | except EOFError: | |
233 | if default in answers.keys(): |
|
233 | if default in answers.keys(): | |
234 | ans = default |
|
234 | ans = default | |
235 |
|
235 | print() | ||
236 | else: |
|
236 | else: | |
237 | raise |
|
237 | raise | |
238 |
|
238 |
@@ -396,7 +396,7 b' class ZMQInteractiveShell(InteractiveShell):' | |||||
396 |
|
396 | |||
397 | def magic_gui(self, *args, **kwargs): |
|
397 | def magic_gui(self, *args, **kwargs): | |
398 | raise NotImplementedError( |
|
398 | raise NotImplementedError( | |
399 | 'GUI support must be enabled in command line options.') |
|
399 | 'Kernel GUI support is not implemented yet, except for --pylab.') | |
400 |
|
400 | |||
401 | def magic_pylab(self, *args, **kwargs): |
|
401 | def magic_pylab(self, *args, **kwargs): | |
402 | raise NotImplementedError( |
|
402 | raise NotImplementedError( |
@@ -8,7 +8,6 b' In [5]: %gui gtk' | |||||
8 | In [6]: %run gui-gtk.py |
|
8 | In [6]: %run gui-gtk.py | |
9 | """ |
|
9 | """ | |
10 |
|
10 | |||
11 |
|
||||
12 | import pygtk |
|
11 | import pygtk | |
13 | pygtk.require('2.0') |
|
12 | pygtk.require('2.0') | |
14 | import gtk |
|
13 | import gtk | |
@@ -38,6 +37,3 b' try:' | |||||
38 | enable_gtk() |
|
37 | enable_gtk() | |
39 | except ImportError: |
|
38 | except ImportError: | |
40 | gtk.main() |
|
39 | gtk.main() | |
41 |
|
||||
42 |
|
||||
43 |
|
@@ -35,6 +35,7 b" if __name__ == '__main__':" | |||||
35 | sw.show() |
|
35 | sw.show() | |
36 |
|
36 | |||
37 | try: |
|
37 | try: | |
38 | from IPython import enable_qt4; enable_qt4(app) |
|
38 | from IPython.lib.guisupport import start_event_loop_qt4 | |
|
39 | start_event_loop_qt4(app) | |||
39 | except ImportError: |
|
40 | except ImportError: | |
40 | app.exec_() |
|
41 | app.exec_() |
@@ -27,6 +27,6 b' root = Tk()' | |||||
27 | app = MyApp(root) |
|
27 | app = MyApp(root) | |
28 |
|
28 | |||
29 | try: |
|
29 | try: | |
30 | from IPython import enable_tk; enable_tk(root) |
|
30 | from IPython.lib.inputhook import enable_tk; enable_tk(root) | |
31 | except ImportError: |
|
31 | except ImportError: | |
32 | root.mainloop() |
|
32 | root.mainloop() |
@@ -1,4 +1,10 b'' | |||||
1 | """A Simple wx example to test IPython's event loop integration. |
|
1 | #!/usr/bin/env python | |
|
2 | """ | |||
|
3 | WARNING: This example is currently broken, see | |||
|
4 | https://github.com/ipython/ipython/issues/645 for details on our progress on | |||
|
5 | this issue. | |||
|
6 | ||||
|
7 | A Simple wx example to test IPython's event loop integration. | |||
2 |
|
8 | |||
3 | To run this do: |
|
9 | To run this do: | |
4 |
|
10 | |||
@@ -97,13 +103,19 b' class MyApp(wx.App):' | |||||
97 | frame.Show(True) |
|
103 | frame.Show(True) | |
98 | return True |
|
104 | return True | |
99 |
|
105 | |||
100 | app = wx.GetApp() |
|
|||
101 | if app is None: |
|
|||
102 | app = MyApp(redirect=False, clearSigInt=False) |
|
|||
103 |
|
106 | |||
104 | try: |
|
107 | if __name__ == '__main__': | |
105 | from IPython.lib.inputhook import enable_wx |
|
108 | raise NotImplementedError( | |
106 | enable_wx(app) |
|
109 | 'Standalone WX GUI support is currently broken. ' | |
107 | except ImportError: |
|
110 | 'See https://github.com/ipython/ipython/issues/645 for details') | |
108 | app.MainLoop() |
|
111 | ||
|
112 | app = wx.GetApp() | |||
|
113 | if app is None: | |||
|
114 | app = MyApp(redirect=False, clearSigInt=False) | |||
|
115 | ||||
|
116 | try: | |||
|
117 | from IPython.lib.inputhook import enable_wx | |||
|
118 | enable_wx(app) | |||
|
119 | except ImportError: | |||
|
120 | app.MainLoop() | |||
109 |
|
121 |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -17,7 +17,7 b' use the ``ipcluster`` command::' | |||||
17 |
|
17 | |||
18 | $ ipcluster -n 4 |
|
18 | $ ipcluster -n 4 | |
19 |
|
19 | |||
20 |
For more detailed information about starting the controller and engines, see our :ref:`introduction < |
|
20 | For more detailed information about starting the controller and engines, see our :ref:`introduction <parallel_overview>` to using IPython for parallel computing. | |
21 |
|
21 | |||
22 | The magic here is that this single controller and set of engines is running both the MultiEngine and ``Task`` interfaces simultaneously. |
|
22 | The magic here is that this single controller and set of engines is running both the MultiEngine and ``Task`` interfaces simultaneously. | |
23 |
|
23 |
1 | NO CONTENT: file renamed from docs/source/development/frontend-kernel.png to docs/source/development/figs/frontend-kernel.png |
|
NO CONTENT: file renamed from docs/source/development/frontend-kernel.png to docs/source/development/figs/frontend-kernel.png |
1 | NO CONTENT: file renamed from docs/source/development/frontend-kernel.svg to docs/source/development/figs/frontend-kernel.svg |
|
NO CONTENT: file renamed from docs/source/development/frontend-kernel.svg to docs/source/development/figs/frontend-kernel.svg |
@@ -22,7 +22,7 b' within and between hosts.' | |||||
22 |
|
22 | |||
23 | The basic design is explained in the following diagram: |
|
23 | The basic design is explained in the following diagram: | |
24 |
|
24 | |||
25 | .. image:: frontend-kernel.png |
|
25 | .. image:: figs/frontend-kernel.png | |
26 | :width: 450px |
|
26 | :width: 450px | |
27 | :alt: IPython kernel/frontend messaging architecture. |
|
27 | :alt: IPython kernel/frontend messaging architecture. | |
28 | :align: center |
|
28 | :align: center |
@@ -1,30 +1,46 b'' | |||||
1 | .. _qtconsole: |
|
1 | .. _qtconsole: | |
2 |
|
2 | |||
3 | ========================= |
|
3 | ========================= | |
4 | IPython as a QtGUI widget |
|
4 | A Qt Console for IPython | |
5 | ========================= |
|
5 | ========================= | |
6 |
|
6 | |||
7 |
We now have a version of IPython, using the new two-process :ref:`ZeroMQ Kernel |
|
7 | We now have a version of IPython, using the new two-process :ref:`ZeroMQ Kernel | |
8 | running in a PyQt_ GUI. |
|
8 | <ipythonzmq>`, running in a PyQt_ GUI. This is a very lightweight widget that | |
|
9 | largely feels like a terminal, but provides a number of enhancements only | |||
|
10 | possible in a GUI, such as inline figures, proper multiline editing with syntax | |||
|
11 | highlighting, graphical calltips, and much more. | |||
9 |
|
12 | |||
10 | Overview |
|
13 | .. figure:: ../_static/qtconsole.png | |
11 | ======== |
|
14 | :width: 400px | |
|
15 | :alt: IPython Qt console with embedded plots | |||
|
16 | :align: center | |||
|
17 | :target: ../_static/qtconsole.png | |||
12 |
|
18 | |||
13 | The Qt frontend has hand-coded emacs-style bindings for text navigation. This is not yet |
|
19 | The Qt console for IPython, using inline matplotlib plots. | |
14 | configurable. |
|
|||
15 |
|
20 | |||
16 | .. seealso:: |
|
21 | To get acquainted with the Qt console, type `%guiref` to see a quick | |
|
22 | introduction of its main features. | |||
|
23 | ||||
|
24 | The Qt frontend has hand-coded emacs-style bindings for text navigation. This | |||
|
25 | is not yet configurable. | |||
|
26 | ||||
|
27 | .. tip:: | |||
|
28 | ||||
|
29 | Since the Qt console tries hard to behave like a terminal, by default it | |||
|
30 | immediately executes single lines of input that are complete. If you want | |||
|
31 | to force multiline input, hit :key:`Ctrl-Enter` at the end of the first line | |||
|
32 | instead of :key:`Enter`, and it will open a new line for input. At any | |||
|
33 | point in a multiline block, you can force its execution (without having to | |||
|
34 | go to the bottom) with :key:`Shift-Enter`. | |||
17 |
|
35 | |||
18 | :ref:`The original IPython-Qt project description. <ipython_qt>` |
|
|||
19 |
|
||||
20 | ``%loadpy`` |
|
36 | ``%loadpy`` | |
21 | =========== |
|
37 | =========== | |
22 |
|
38 | |||
23 | The new ``%loadpy`` magic takes any python |
|
39 | The new ``%loadpy`` magic takes any python script (must end in '.py'), and | |
24 |
|
|
40 | pastes its contents as your next input, so you can edit it before | |
25 |
|
|
41 | executing. The script may be on your machine, but you can also specify a url, | |
26 |
it will download the script from the web. This is particularly useful for |
|
42 | and it will download the script from the web. This is particularly useful for | |
27 | examples from documentation, such as matplotlib. |
|
43 | playing with examples from documentation, such as matplotlib. | |
28 |
|
44 | |||
29 | .. sourcecode:: ipython |
|
45 | .. sourcecode:: ipython | |
30 |
|
46 | |||
@@ -44,10 +60,10 b' examples from documentation, such as matplotlib.' | |||||
44 | Pylab |
|
60 | Pylab | |
45 | ===== |
|
61 | ===== | |
46 |
|
62 | |||
47 |
One of the most exciting features of the new console is embedded matplotlib |
|
63 | One of the most exciting features of the new console is embedded matplotlib | |
48 |
can use any standard matplotlib GUI backend (Except native MacOSX) |
|
64 | figures. You can use any standard matplotlib GUI backend (Except native MacOSX) | |
49 |
and since there is now a two-process model, there is no |
|
65 | to draw the figures, and since there is now a two-process model, there is no | |
50 | input and the drawing eventloop. |
|
66 | longer a conflict between user input and the drawing eventloop. | |
51 |
|
67 | |||
52 | .. image:: figs/besselj.png |
|
68 | .. image:: figs/besselj.png | |
53 | :width: 519px |
|
69 | :width: 519px | |
@@ -57,11 +73,12 b' input and the drawing eventloop.' | |||||
57 | :func:`display` |
|
73 | :func:`display` | |
58 | *************** |
|
74 | *************** | |
59 |
|
75 | |||
60 |
An additional function, :func:`display`, will be added to the global namespace |
|
76 | An additional function, :func:`display`, will be added to the global namespace | |
61 | specify the ``pylab`` argument. The IPython display system provides a mechanism for |
|
77 | if you specify the ``--pylab`` option at the command line. The IPython display | |
62 | specifying PNG or SVG (and more) representations of objects for GUI frontends. By default, |
|
78 | system provides a mechanism for specifying PNG or SVG (and more) | |
63 | IPython registers convenient PNG and SVG renderers for matplotlib figures, so you can |
|
79 | representations of objects for GUI frontends. By default, IPython registers | |
64 | embed them in your document by calling :func:`display` on one or more of them. This is |
|
80 | convenient PNG and SVG renderers for matplotlib figures, so you can embed them | |
|
81 | in your document by calling :func:`display` on one or more of them. This is | |||
65 | especially useful for saving_ your work. |
|
82 | especially useful for saving_ your work. | |
66 |
|
83 | |||
67 | .. sourcecode:: ipython |
|
84 | .. sourcecode:: ipython | |
@@ -72,15 +89,36 b' especially useful for saving_ your work.' | |||||
72 |
|
89 | |||
73 | In [7]: display(*getfigs()) # embeds all active figures in the qtconsole |
|
90 | In [7]: display(*getfigs()) # embeds all active figures in the qtconsole | |
74 |
|
91 | |||
|
92 | If you have a reference to a matplotlib figure object, you can always display | |||
|
93 | that specific figure: | |||
|
94 | ||||
|
95 | .. sourcecode:: ipython | |||
|
96 | ||||
|
97 | In [1]: f = figure() | |||
|
98 | ||||
|
99 | In [2]: plot(rand(100)) | |||
|
100 | Out[2]: [<matplotlib.lines.Line2D at 0x7fc6ac03dd90>] | |||
|
101 | ||||
|
102 | In [3]: display(f) | |||
|
103 | ||||
|
104 | # Plot is shown here | |||
|
105 | ||||
|
106 | In [4]: title('A title') | |||
|
107 | Out[4]: <matplotlib.text.Text at 0x7fc6ac023450> | |||
|
108 | ||||
|
109 | In [5]: display(f) | |||
|
110 | ||||
|
111 | # Updated plot with title is shown here. | |||
|
112 | ||||
75 | .. _inline: |
|
113 | .. _inline: | |
76 |
|
114 | |||
77 | ``--pylab=inline`` |
|
115 | ``--pylab=inline`` | |
78 | ****************** |
|
116 | ****************** | |
79 |
|
117 | |||
80 |
If you want to have all of your figures embedded in your session, instead of |
|
118 | If you want to have all of your figures embedded in your session, instead of | |
81 |
:func:`display`, you can specify ``--pylab=inline`` when you start the |
|
119 | calling :func:`display`, you can specify ``--pylab=inline`` when you start the | |
82 |
and each time you make a plot, it will show up in your document, as if |
|
120 | console, and each time you make a plot, it will show up in your document, as if | |
83 | called :func:`display(fig)`. |
|
121 | you had called :func:`display(fig)`. | |
84 |
|
122 | |||
85 |
|
123 | |||
86 | .. _saving: |
|
124 | .. _saving: | |
@@ -88,31 +126,32 b' called :func:`display(fig)`.' | |||||
88 | Saving and Printing |
|
126 | Saving and Printing | |
89 | =================== |
|
127 | =================== | |
90 |
|
128 | |||
91 |
IPythonQt has the ability to save your current session, as either HTML or |
|
129 | IPythonQt has the ability to save your current session, as either HTML or | |
92 |
have been using :func:`display` or inline_ pylab, your figures |
|
130 | XHTML. If you have been using :func:`display` or inline_ pylab, your figures | |
93 |
in HTML, or inlined as SVG in XHTML. PNG images have the option to |
|
131 | will be PNG in HTML, or inlined as SVG in XHTML. PNG images have the option to | |
94 |
external folder, as in many browsers' "Webpage, Complete" |
|
132 | be either in an external folder, as in many browsers' "Webpage, Complete" | |
95 | a larger, but more portable file. |
|
133 | option, or inlined as well, for a larger, but more portable file. | |
96 |
|
134 | |||
97 |
The widget also exposes the ability to print directly, via the default print |
|
135 | The widget also exposes the ability to print directly, via the default print | |
98 | context menu. |
|
136 | shortcut or context menu. | |
99 |
|
137 | |||
100 |
|
138 | |||
101 | .. Note:: |
|
139 | .. Note:: | |
102 |
|
140 | |||
103 |
Saving is only available to richtext Qt widgets, which are used by default, |
|
141 | Saving is only available to richtext Qt widgets, which are used by default, | |
104 | if you pass the ``--plain`` flag, saving will not be available to you. |
|
142 | but if you pass the ``--plain`` flag, saving will not be available to you. | |
105 |
|
143 | |||
106 |
|
144 | |||
107 |
See these examples of :download:`png/html<figs/jn.html>` and |
|
145 | See these examples of :download:`png/html<figs/jn.html>` and | |
108 |
<figs/jn.xhtml>` output. Note that syntax highlighting |
|
146 | :download:`svg/xhtml <figs/jn.xhtml>` output. Note that syntax highlighting | |
109 | issue, and is being investigated. |
|
147 | does not survive export. This is a known issue, and is being investigated. | |
110 |
|
148 | |||
111 | Colors and Highlighting |
|
149 | Colors and Highlighting | |
112 | ======================= |
|
150 | ======================= | |
113 |
|
151 | |||
114 |
Terminal IPython has always had some coloring, but never syntax |
|
152 | Terminal IPython has always had some coloring, but never syntax | |
115 |
few simple color choices, specified by the ``colors`` |
|
153 | highlighting. There are a few simple color choices, specified by the ``colors`` | |
|
154 | flag or ``%colors`` magic: | |||
116 |
|
155 | |||
117 | * LightBG for light backgrounds |
|
156 | * LightBG for light backgrounds | |
118 | * Linux for dark backgrounds |
|
157 | * Linux for dark backgrounds | |
@@ -120,26 +159,28 b' few simple color choices, specified by the ``colors`` flag or ``%colors`` magic:' | |||||
120 |
|
159 | |||
121 | The Qt widget has full support for the ``colors`` flag used in the terminal shell. |
|
160 | The Qt widget has full support for the ``colors`` flag used in the terminal shell. | |
122 |
|
161 | |||
123 |
The Qt widget, however, has full syntax highlighting as you type, handled by |
|
162 | The Qt widget, however, has full syntax highlighting as you type, handled by | |
124 |
`pygments`_ library. The ``style`` argument exposes access to any style by |
|
163 | the `pygments`_ library. The ``style`` argument exposes access to any style by | |
125 |
be found by pygments, and there are several already |
|
164 | name that can be found by pygments, and there are several already | |
126 | if unspecified, will be guessed based on the chosen style. Similarly, there are default |
|
165 | installed. The ``colors`` argument, if unspecified, will be guessed based on | |
127 | styles associated with each ``colors`` option. |
|
166 | the chosen style. Similarly, there are default styles associated with each | |
|
167 | ``colors`` option. | |||
128 |
|
168 | |||
129 |
|
169 | |||
130 |
Screenshot of ``ipython qtconsole --colors=linux``, which uses the 'monokai' |
|
170 | Screenshot of ``ipython qtconsole --colors=linux``, which uses the 'monokai' | |
131 | default: |
|
171 | theme by default: | |
132 |
|
172 | |||
133 | .. image:: figs/colors_dark.png |
|
173 | .. image:: figs/colors_dark.png | |
134 | :width: 627px |
|
174 | :width: 627px | |
135 |
|
175 | |||
136 | .. Note:: |
|
176 | .. Note:: | |
137 |
|
177 | |||
138 |
Calling ``ipython qtconsole -h`` will show all the style names that |
|
178 | Calling ``ipython qtconsole -h`` will show all the style names that | |
139 | on your system. |
|
179 | pygments can find on your system. | |
140 |
|
180 | |||
141 |
You can also pass the filename of a custom CSS stylesheet, if you want to do |
|
181 | You can also pass the filename of a custom CSS stylesheet, if you want to do | |
142 |
coloring, via the ``stylesheet`` argument. The default LightBG |
|
182 | your own coloring, via the ``stylesheet`` argument. The default LightBG | |
|
183 | stylesheet: | |||
143 |
|
184 | |||
144 | .. sourcecode:: css |
|
185 | .. sourcecode:: css | |
145 |
|
186 | |||
@@ -155,61 +196,68 b' coloring, via the ``stylesheet`` argument. The default LightBG stylesheet:' | |||||
155 | Fonts |
|
196 | Fonts | |
156 | ===== |
|
197 | ===== | |
157 |
|
198 | |||
158 |
The QtConsole has configurable via the ConsoleWidget. To change these, set the |
|
199 | The QtConsole has configurable via the ConsoleWidget. To change these, set the | |
159 |
or ``font_size`` traits of the ConsoleWidget. For instance, to |
|
200 | ``font_family`` or ``font_size`` traits of the ConsoleWidget. For instance, to | |
|
201 | use 9pt Anonymous Pro:: | |||
160 |
|
202 | |||
161 | $> ipython qtconsole --ConsoleWidget.font_family="Anonymous Pro" --ConsoleWidget.font_size=9 |
|
203 | $> ipython qtconsole --ConsoleWidget.font_family="Anonymous Pro" --ConsoleWidget.font_size=9 | |
162 |
|
204 | |||
163 | Process Management |
|
205 | Process Management | |
164 | ================== |
|
206 | ================== | |
165 |
|
207 | |||
166 |
With the two-process ZMQ model, the frontend does not block input during |
|
208 | With the two-process ZMQ model, the frontend does not block input during | |
167 |
means that actions can be taken by the frontend while the |
|
209 | execution. This means that actions can be taken by the frontend while the | |
168 | after it crashes. The most basic such command is via 'Ctrl-.', which restarts the kernel. |
|
210 | Kernel is executing, or even after it crashes. The most basic such command is | |
169 | This can be done in the middle of a blocking execution. The frontend can also know, via a |
|
211 | via 'Ctrl-.', which restarts the kernel. This can be done in the middle of a | |
170 | heartbeat mechanism, that the kernel has died. This means that the frontend can safely |
|
212 | blocking execution. The frontend can also know, via a heartbeat mechanism, that | |
171 | restart the kernel. |
|
213 | the kernel has died. This means that the frontend can safely restart the | |
|
214 | kernel. | |||
172 |
|
215 | |||
173 | Multiple Consoles |
|
216 | Multiple Consoles | |
174 | ***************** |
|
217 | ***************** | |
175 |
|
218 | |||
176 |
Since the Kernel listens on the network, multiple frontends can connect to it. |
|
219 | Since the Kernel listens on the network, multiple frontends can connect to it. | |
177 |
do not have to all be qt frontends - any IPython frontend can connect and |
|
220 | These do not have to all be qt frontends - any IPython frontend can connect and | |
178 |
When you start ipython qtconsole, there will be an output line, |
|
221 | run code. When you start ipython qtconsole, there will be an output line, | |
|
222 | like:: | |||
179 |
|
223 | |||
180 | To connect another client to this kernel, use: |
|
224 | [IPKernelApp] To connect another client to this kernel, use: | |
181 |
|
|
225 | [IPKernelApp] --existing --shell=60690 --iopub=44045 --stdin=38323 --hb=41797 | |
182 |
|
226 | |||
183 |
Other frontends can connect to your kernel, and share in the execution. This is |
|
227 | Other frontends can connect to your kernel, and share in the execution. This is | |
184 |
collaboration. The `-e` flag is for 'external'. Starting other |
|
228 | great for collaboration. The `-e` flag is for 'external'. Starting other | |
185 |
will not try to start their own, but rather connect to |
|
229 | consoles with that flag will not try to start their own, but rather connect to | |
186 | have to specify each port individually, but for now this copy-paste method is best. |
|
230 | yours. Ultimately, you will not have to specify each port individually, but for | |
|
231 | now this copy-paste method is best. | |||
187 |
|
232 | |||
188 |
By default (for security reasons), the kernel only listens on localhost, so you |
|
233 | By default (for security reasons), the kernel only listens on localhost, so you | |
189 |
connect multiple frontends to the kernel from your local machine. You |
|
234 | can only connect multiple frontends to the kernel from your local machine. You | |
190 |
listen on an external interface by specifying the ``ip`` |
|
235 | can specify to listen on an external interface by specifying the ``ip`` | |
|
236 | argument:: | |||
191 |
|
237 | |||
192 | $> ipython qtconsole --ip=192.168.1.123 |
|
238 | $> ipython qtconsole --ip=192.168.1.123 | |
193 |
|
239 | |||
194 |
If you specify the ip as 0.0.0.0, that refers to all interfaces, so any |
|
240 | If you specify the ip as 0.0.0.0, that refers to all interfaces, so any | |
195 | see yours can connect to the kernel. |
|
241 | computer that can see yours can connect to the kernel. | |
196 |
|
242 | |||
197 | .. warning:: |
|
243 | .. warning:: | |
198 |
|
244 | |||
199 |
Since the ZMQ code currently has no security, listening on an |
|
245 | Since the ZMQ code currently has no security, listening on an | |
200 |
is dangerous. You are giving any computer that can see |
|
246 | external-facing IP is dangerous. You are giving any computer that can see | |
201 | to issue arbitrary shell commands as you on your machine. Be very careful with this. |
|
247 | you on the network the ability to issue arbitrary shell commands as you on | |
|
248 | your machine. Be very careful with this. | |||
202 |
|
249 | |||
203 |
|
250 | |||
204 | Stopping Kernels and Consoles |
|
251 | Stopping Kernels and Consoles | |
205 | ***************************** |
|
252 | ***************************** | |
206 |
|
253 | |||
207 |
Since there can be many consoles per kernel, the shutdown mechanism and dialog |
|
254 | Since there can be many consoles per kernel, the shutdown mechanism and dialog | |
208 |
probably more complicated than you are used to. Since you don't always want |
|
255 | are probably more complicated than you are used to. Since you don't always want | |
209 |
kernel when you close a window, you are given the option to just |
|
256 | to shutdown a kernel when you close a window, you are given the option to just | |
210 |
or also close the Kernel and *all other windows*. Note |
|
257 | close the console window or also close the Kernel and *all other windows*. Note | |
211 | *local* windows, as remote Consoles are not allowed to shutdown the kernel, and shutdowns |
|
258 | that this only refers to all other *local* windows, as remote Consoles are not | |
212 | do not close Remote consoles (to allow for saving, etc.). |
|
259 | allowed to shutdown the kernel, and shutdowns do not close Remote consoles (to | |
|
260 | allow for saving, etc.). | |||
213 |
|
261 | |||
214 | Rules: |
|
262 | Rules: | |
215 |
|
263 | |||
@@ -222,12 +270,13 b' Rules:' | |||||
222 | Qt and the QtConsole |
|
270 | Qt and the QtConsole | |
223 | ==================== |
|
271 | ==================== | |
224 |
|
272 | |||
225 |
An important part of working with the QtConsole when you are writing your own |
|
273 | An important part of working with the QtConsole when you are writing your own | |
226 |
to remember that user code (in the kernel) is *not* in the same |
|
274 | Qt code is to remember that user code (in the kernel) is *not* in the same | |
227 |
This means that there is not necessarily any Qt code |
|
275 | process as the frontend. This means that there is not necessarily any Qt code | |
228 | normal circumstances there isn't. If, however, you specify ``pylab=qt`` at the |
|
276 | running in the kernel, and under most normal circumstances there isn't. If, | |
229 | command-line, then there *will* be a :class:`QCoreApplication` instance running in the |
|
277 | however, you specify ``pylab=qt`` at the command-line, then there *will* be a | |
230 | kernel process along with user-code. To get a reference to this application, do: |
|
278 | :class:`QCoreApplication` instance running in the kernel process along with | |
|
279 | user-code. To get a reference to this application, do: | |||
231 |
|
280 | |||
232 | .. sourcecode:: python |
|
281 | .. sourcecode:: python | |
233 |
|
282 | |||
@@ -235,9 +284,9 b' kernel process along with user-code. To get a reference to this application, do:' | |||||
235 | app = QtCore.QCoreApplication.instance() |
|
284 | app = QtCore.QCoreApplication.instance() | |
236 | # app will be None if there is no such instance |
|
285 | # app will be None if there is no such instance | |
237 |
|
286 | |||
238 |
A common problem listed in the PyQt4 Gotchas_ is the fact that Python's garbage |
|
287 | A common problem listed in the PyQt4 Gotchas_ is the fact that Python's garbage | |
239 |
will destroy Qt objects (Windows, etc.) once there is no longer a |
|
288 | collection will destroy Qt objects (Windows, etc.) once there is no longer a | |
240 | them, so you have to hold on to them. For instance, in: |
|
289 | Python reference to them, so you have to hold on to them. For instance, in: | |
241 |
|
290 | |||
242 | .. sourcecode:: python |
|
291 | .. sourcecode:: python | |
243 |
|
292 | |||
@@ -248,11 +297,11 b' them, so you have to hold on to them. For instance, in:' | |||||
248 | win = QtGui.QMainWindow() |
|
297 | win = QtGui.QMainWindow() | |
249 | return win |
|
298 | return win | |
250 |
|
299 | |||
251 |
:func:`make_window` will never draw a window, because garbage collection will |
|
300 | :func:`make_window` will never draw a window, because garbage collection will | |
252 |
before it is drawn, whereas :func:`make_and_return_window` lets the |
|
301 | destroy it before it is drawn, whereas :func:`make_and_return_window` lets the | |
253 |
window object should be destroyed. If, as a developer, |
|
302 | caller decide when the window object should be destroyed. If, as a developer, | |
254 | objects to last as long as the process, you can attach them to the QApplication instance |
|
303 | you know that you always want your objects to last as long as the process, you | |
255 | itself: |
|
304 | can attach them to the QApplication instance itself: | |
256 |
|
305 | |||
257 | .. sourcecode:: python |
|
306 | .. sourcecode:: python | |
258 |
|
307 | |||
@@ -272,11 +321,11 b' garbage collected until the application itself is destroyed.' | |||||
272 | Regressions |
|
321 | Regressions | |
273 | =========== |
|
322 | =========== | |
274 |
|
323 | |||
275 |
There are some features, where the qt console lags behind the Terminal |
|
324 | There are some features, where the qt console lags behind the Terminal | |
276 | to have these fixed by 0.11 release. |
|
325 | frontend. We hope to have these fixed by 0.11 release. | |
277 |
|
326 | |||
278 |
|
|
327 | * !cmd input: Due to our use of pexpect, we cannot pass input to subprocesses | |
279 |
|
|
328 | launched using the '!' escape. (this will not be fixed). | |
280 |
|
329 | |||
281 | .. [PyQt] PyQt4 http://www.riverbankcomputing.co.uk/software/pyqt/download |
|
330 | .. [PyQt] PyQt4 http://www.riverbankcomputing.co.uk/software/pyqt/download | |
282 | .. [pygments] Pygments http://pygments.org/ |
|
331 | .. [pygments] Pygments http://pygments.org/ |
@@ -325,25 +325,23 b' All options with a [no] prepended can be specified in negated form' | |||||
325 | Interactive use |
|
325 | Interactive use | |
326 | =============== |
|
326 | =============== | |
327 |
|
327 | |||
328 | IPython is meant to work as a drop-in |
|
328 | IPython is meant to work as a drop-in replacement for the standard interactive | |
329 | replacement for the standard interactive interpreter. As such, any code |
|
329 | interpreter. As such, any code which is valid python should execute normally | |
330 | which is valid python should execute normally under IPython (cases where |
|
330 | under IPython (cases where this is not true should be reported as bugs). It | |
331 | this is not true should be reported as bugs). It does, however, offer |
|
331 | does, however, offer many features which are not available at a standard python | |
332 | many features which are not available at a standard python prompt. What |
|
332 | prompt. What follows is a list of these. | |
333 | follows is a list of these. |
|
|||
334 |
|
333 | |||
335 |
|
334 | |||
336 | Caution for Windows users |
|
335 | Caution for Windows users | |
337 | ------------------------- |
|
336 | ------------------------- | |
338 |
|
337 | |||
339 | Windows, unfortunately, uses the '\\' character as a path |
|
338 | Windows, unfortunately, uses the '\\' character as a path separator. This is a | |
340 |
|
|
339 | terrible choice, because '\\' also represents the escape character in most | |
341 | escape character in most modern programming languages, including |
|
340 | modern programming languages, including Python. For this reason, using '/' | |
342 | Python. For this reason, using '/' character is recommended if you |
|
341 | character is recommended if you have problems with ``\``. However, in Windows | |
343 | have problems with ``\``. However, in Windows commands '/' flags |
|
342 | commands '/' flags options, so you can not use it for the root directory. This | |
344 | options, so you can not use it for the root directory. This means that |
|
343 | means that paths beginning at the root must be typed in a contrived manner | |
345 | paths beginning at the root must be typed in a contrived manner like: |
|
344 | like: ``%copy \opt/foo/bar.txt \tmp`` | |
346 | ``%copy \opt/foo/bar.txt \tmp`` |
|
|||
347 |
|
345 | |||
348 | .. _magic: |
|
346 | .. _magic: | |
349 |
|
347 | |||
@@ -419,11 +417,11 b' following example defines a new magic command, %impall:' | |||||
419 |
|
417 | |||
420 | ip.expose_magic('impall', doimp) |
|
418 | ip.expose_magic('impall', doimp) | |
421 |
|
419 | |||
422 | Type %magic for more information, including a list of all available |
|
420 | Type `%magic` for more information, including a list of all available magic | |
423 |
|
|
421 | functions at any time and their docstrings. You can also type | |
424 |
%magic_function_name? (see |
|
422 | %magic_function_name? (see :ref:`below <dynamic_object_info` for information on | |
425 |
|
|
423 | the '?' system) to get information about any particular magic function you are | |
426 | magic function you are interested in. |
|
424 | interested in. | |
427 |
|
425 | |||
428 | The API documentation for the :mod:`IPython.core.magic` module contains the full |
|
426 | The API documentation for the :mod:`IPython.core.magic` module contains the full | |
429 | docstrings of all currently available magic commands. |
|
427 | docstrings of all currently available magic commands. | |
@@ -444,20 +442,20 b' PYTHONDOCS for this feature to work correctly.' | |||||
444 | Dynamic object information |
|
442 | Dynamic object information | |
445 | -------------------------- |
|
443 | -------------------------- | |
446 |
|
444 | |||
447 | Typing ?word or word? prints detailed information about an object. If |
|
445 | Typing ``?word`` or ``word?`` prints detailed information about an object. If | |
448 | certain strings in the object are too long (docstrings, code, etc.) they |
|
446 | certain strings in the object are too long (docstrings, code, etc.) they get | |
449 |
|
|
447 | snipped in the center for brevity. This system gives access variable types and | |
450 |
|
|
448 | values, full source code for any object (if available), function prototypes and | |
451 |
|
|
449 | other useful information. | |
452 |
|
450 | |||
453 | Typing ??word or word?? gives access to the full information without |
|
451 | Typing ``??word`` or ``word??`` gives access to the full information without | |
454 | snipping long strings. Long strings are sent to the screen through the |
|
452 | snipping long strings. Long strings are sent to the screen through the | |
455 | less pager if longer than the screen and printed otherwise. On systems |
|
453 | less pager if longer than the screen and printed otherwise. On systems | |
456 | lacking the less command, IPython uses a very basic internal pager. |
|
454 | lacking the less command, IPython uses a very basic internal pager. | |
457 |
|
455 | |||
458 | The following magic functions are particularly useful for gathering |
|
456 | The following magic functions are particularly useful for gathering | |
459 | information about your working environment. You can get more details by |
|
457 | information about your working environment. You can get more details by | |
460 | typing %magic or querying them individually (use %function_name? with or |
|
458 | typing ``%magic`` or querying them individually (use %function_name? with or | |
461 | without the %), this is just a summary: |
|
459 | without the %), this is just a summary: | |
462 |
|
460 | |||
463 | * **%pdoc <object>**: Print (or run through a pager if too long) the |
|
461 | * **%pdoc <object>**: Print (or run through a pager if too long) the | |
@@ -476,21 +474,19 b' without the %), this is just a summary:' | |||||
476 | identifiers and %whos prints a table with some basic details about |
|
474 | identifiers and %whos prints a table with some basic details about | |
477 | each identifier. |
|
475 | each identifier. | |
478 |
|
476 | |||
479 |
Note that the dynamic object information functions (?/??, |
|
477 | Note that the dynamic object information functions (?/??, ``%pdoc``, | |
480 |
%pdef, %psource) give you access to documentation even on |
|
478 | ``%pfile``, ``%pdef``, ``%psource``) give you access to documentation even on | |
481 |
are not really defined as separate identifiers. Try for example |
|
479 | things which are not really defined as separate identifiers. Try for example | |
482 | {}.get? or after doing import os, type os.path.abspath??. |
|
480 | typing {}.get? or after doing import os, type ``os.path.abspath??``. | |
483 |
|
||||
484 |
|
481 | |||
485 | .. _readline: |
|
482 | .. _readline: | |
486 |
|
483 | |||
487 | Readline-based features |
|
484 | Readline-based features | |
488 | ----------------------- |
|
485 | ----------------------- | |
489 |
|
486 | |||
490 | These features require the GNU readline library, so they won't work if |
|
487 | These features require the GNU readline library, so they won't work if your | |
491 |
|
|
488 | Python installation lacks readline support. We will first describe the default | |
492 |
|
|
489 | behavior IPython uses, and then how to change it to suit your preferences. | |
493 | your preferences. |
|
|||
494 |
|
490 | |||
495 |
|
491 | |||
496 | Command line completion |
|
492 | Command line completion | |
@@ -534,10 +530,10 b' Autoindent' | |||||
534 | IPython can recognize lines ending in ':' and indent the next line, |
|
530 | IPython can recognize lines ending in ':' and indent the next line, | |
535 | while also un-indenting automatically after 'raise' or 'return'. |
|
531 | while also un-indenting automatically after 'raise' or 'return'. | |
536 |
|
532 | |||
537 |
This feature uses the readline library, so it will honor your |
|
533 | This feature uses the readline library, so it will honor your | |
538 |
configuration (or whatever file your INPUTRC variable points |
|
534 | :file:`~/.inputrc` configuration (or whatever file your INPUTRC variable points | |
539 |
the following lines to your .inputrc file can make |
|
535 | to). Adding the following lines to your :file:`.inputrc` file can make | |
540 | more convenient (M-i indents, M-u unindents):: |
|
536 | indenting/unindenting more convenient (M-i indents, M-u unindents):: | |
541 |
|
537 | |||
542 | $if Python |
|
538 | $if Python | |
543 | "\M-i": " " |
|
539 | "\M-i": " " | |
@@ -548,17 +544,19 b' Note that there are 4 spaces between the quote marks after "M-i" above.' | |||||
548 |
|
544 | |||
549 | .. warning:: |
|
545 | .. warning:: | |
550 |
|
546 | |||
551 |
Setting the above indents will cause problems with unicode text entry in |
|
547 | Setting the above indents will cause problems with unicode text entry in | |
|
548 | the terminal. | |||
552 |
|
549 | |||
553 | .. warning:: |
|
550 | .. warning:: | |
554 |
|
551 | |||
555 | Autoindent is ON by default, but it can cause problems with |
|
552 | Autoindent is ON by default, but it can cause problems with the pasting of | |
556 |
|
|
553 | multi-line indented code (the pasted code gets re-indented on each line). A | |
557 | re-indented on each line). A magic function %autoindent allows you to |
|
554 | magic function %autoindent allows you to toggle it on/off at runtime. You | |
558 | toggle it on/off at runtime. You can also disable it permanently on in |
|
555 | can also disable it permanently on in your :file:`ipython_config.py` file | |
559 |
|
|
556 | (set TerminalInteractiveShell.autoindent=False). | |
560 |
|
557 | |||
561 |
If you want to paste multiple lines, it is recommended that you use |
|
558 | If you want to paste multiple lines, it is recommended that you use | |
|
559 | ``%paste``. | |||
562 |
|
560 | |||
563 |
|
561 | |||
564 | Customizing readline behavior |
|
562 | Customizing readline behavior | |
@@ -604,7 +602,7 b' Session logging and restoring' | |||||
604 | ----------------------------- |
|
602 | ----------------------------- | |
605 |
|
603 | |||
606 | You can log all input from a session either by starting IPython with the |
|
604 | You can log all input from a session either by starting IPython with the | |
607 |
command line switch |
|
605 | command line switch ``--logfile=foo.py`` (see :ref:`here <command_line_options>`) | |
608 | or by activating the logging at any moment with the magic function %logstart. |
|
606 | or by activating the logging at any moment with the magic function %logstart. | |
609 |
|
607 | |||
610 | Log files can later be reloaded by running them as scripts and IPython |
|
608 | Log files can later be reloaded by running them as scripts and IPython | |
@@ -617,10 +615,10 b' any code you wrote while experimenting. Log files are regular text files' | |||||
617 | which you can later open in your favorite text editor to extract code or |
|
615 | which you can later open in your favorite text editor to extract code or | |
618 | to 'clean them up' before using them to replay a session. |
|
616 | to 'clean them up' before using them to replay a session. | |
619 |
|
617 | |||
620 | The %logstart function for activating logging in mid-session is used as |
|
618 | The `%logstart` function for activating logging in mid-session is used as | |
621 | follows: |
|
619 | follows:: | |
622 |
|
620 | |||
623 | %logstart [log_name [log_mode]] |
|
621 | %logstart [log_name [log_mode]] | |
624 |
|
622 | |||
625 | If no name is given, it defaults to a file named 'ipython_log.py' in your |
|
623 | If no name is given, it defaults to a file named 'ipython_log.py' in your | |
626 | current working directory, in 'rotate' mode (see below). |
|
624 | current working directory, in 'rotate' mode (see below). | |
@@ -648,7 +646,7 b' System shell access' | |||||
648 |
|
646 | |||
649 | Any input line beginning with a ! character is passed verbatim (minus |
|
647 | Any input line beginning with a ! character is passed verbatim (minus | |
650 | the !, of course) to the underlying operating system. For example, |
|
648 | the !, of course) to the underlying operating system. For example, | |
651 | typing !ls will run 'ls' in the current directory. |
|
649 | typing ``!ls`` will run 'ls' in the current directory. | |
652 |
|
650 | |||
653 | Manual capture of command output |
|
651 | Manual capture of command output | |
654 | -------------------------------- |
|
652 | -------------------------------- | |
@@ -702,9 +700,9 b' The %alias magic function and the alias option in the ipythonrc' | |||||
702 | configuration file allow you to define magic functions which are in fact |
|
700 | configuration file allow you to define magic functions which are in fact | |
703 | system shell commands. These aliases can have parameters. |
|
701 | system shell commands. These aliases can have parameters. | |
704 |
|
702 | |||
705 |
|
|
703 | ``%alias alias_name cmd`` defines 'alias_name' as an alias for 'cmd' | |
706 |
|
704 | |||
707 |
Then, typing |
|
705 | Then, typing ``%alias_name params`` will execute the system command 'cmd | |
708 | params' (from your underlying operating system). |
|
706 | params' (from your underlying operating system). | |
709 |
|
707 | |||
710 | You can also define aliases with parameters using %s specifiers (one per |
|
708 | You can also define aliases with parameters using %s specifiers (one per | |
@@ -722,9 +720,8 b' replaced by a positional parameter to the call to %parts::' | |||||
722 | If called with no parameters, %alias prints the table of currently |
|
720 | If called with no parameters, %alias prints the table of currently | |
723 | defined aliases. |
|
721 | defined aliases. | |
724 |
|
722 | |||
725 |
The %rehash |
|
723 | The %rehashx magic allows you to load your entire $PATH as | |
726 |
ipython aliases. See |
|
724 | ipython aliases. See its docstring for further details. | |
727 | <#sec:magic> for further details). |
|
|||
728 |
|
725 | |||
729 |
|
726 | |||
730 | .. _dreload: |
|
727 | .. _dreload: | |
@@ -765,15 +762,14 b' addition to the %rep magic command that brings a history entry' | |||||
765 | up for editing on the next command line. |
|
762 | up for editing on the next command line. | |
766 |
|
763 | |||
767 | The following GLOBAL variables always exist (so don't overwrite them!): |
|
764 | The following GLOBAL variables always exist (so don't overwrite them!): | |
768 | _i: stores previous input. _ii: next previous. _iii: next-next previous. |
|
765 | ||
769 | _ih : a list of all input _ih[n] is the input from line n and this list |
|
766 | * _i, _ii, _iii: store previous, next previous and next-next previous inputs. | |
770 | is aliased to the global variable In. If you overwrite In with a |
|
767 | * In, _ih : a list of all inputs; _ih[n] is the input from line n. If you | |
771 |
variable of your own, you can remake the assignment to the |
|
768 | overwrite In with a variable of your own, you can remake the assignment to the | |
772 |
with a simple |
|
769 | internal list with a simple ``In=_ih``. | |
773 |
|
770 | |||
774 | Additionally, global variables named _i<n> are dynamically created (<n> |
|
771 | Additionally, global variables named _i<n> are dynamically created (<n> | |
775 |
being the prompt counter), s |
|
772 | being the prompt counter), so ``_i<n> == _ih[<n>] == In[<n>]``. | |
776 | _i<n> == _ih[<n>] == In[<n>]. |
|
|||
777 |
|
773 | |||
778 | For example, what you typed at prompt 14 is available as _i14, _ih[14] |
|
774 | For example, what you typed at prompt 14 is available as _i14, _ih[14] | |
779 | and In[14]. |
|
775 | and In[14]. | |
@@ -781,55 +777,23 b' and In[14].' | |||||
781 | This allows you to easily cut and paste multi line interactive prompts |
|
777 | This allows you to easily cut and paste multi line interactive prompts | |
782 | by printing them out: they print like a clean string, without prompt |
|
778 | by printing them out: they print like a clean string, without prompt | |
783 | characters. You can also manipulate them like regular variables (they |
|
779 | characters. You can also manipulate them like regular variables (they | |
784 |
are strings), modify or exec them (typing |
|
780 | are strings), modify or exec them (typing ``exec _i9`` will re-execute the | |
785 | contents of input prompt 9, 'exec In[9:14]+In[18]' will re-execute lines |
|
781 | contents of input prompt 9. | |
786 | 9 through 13 and line 18). |
|
|||
787 |
|
782 | |||
788 | You can also re-execute multiple lines of input easily by using the |
|
783 | You can also re-execute multiple lines of input easily by using the | |
789 | magic %macro function (which automates the process and allows |
|
784 | magic %macro function (which automates the process and allows | |
790 | re-execution without having to type 'exec' every time). The macro system |
|
785 | re-execution without having to type 'exec' every time). The macro system | |
791 | also allows you to re-execute previous lines which include magic |
|
786 | also allows you to re-execute previous lines which include magic | |
792 |
function calls (which require special processing). Type %macro? |
|
787 | function calls (which require special processing). Type %macro? for more details | |
793 | sec. 6.2 <#sec:magic> for more details on the macro system. |
|
788 | on the macro system. | |
794 |
|
789 | |||
795 | A history function %hist allows you to see any part of your input |
|
790 | A history function %hist allows you to see any part of your input | |
796 | history by printing a range of the _i variables. |
|
791 | history by printing a range of the _i variables. | |
797 |
|
792 | |||
798 | You can also search ('grep') through your history by typing |
|
793 | You can also search ('grep') through your history by typing | |
799 | '%hist -g somestring'. This also searches through the so called *shadow history*, |
|
794 | ``%hist -g somestring``. This is handy for searching for URLs, IP addresses, | |
800 | which remembers all the commands (apart from multiline code blocks) |
|
795 | etc. You can bring history entries listed by '%hist -g' up for editing | |
801 | you have ever entered. Handy for searching for svn/bzr URL's, IP adrresses |
|
796 | with the %recall command, or run them immediately with %rerun. | |
802 | etc. You can bring shadow history entries listed by '%hist -g' up for editing |
|
|||
803 | (or re-execution by just pressing ENTER) with %rep command. Shadow history |
|
|||
804 | entries are not available as _iNUMBER variables, and they are identified by |
|
|||
805 | the '0' prefix in %hist -g output. That is, history entry 12 is a normal |
|
|||
806 | history entry, but 0231 is a shadow history entry. |
|
|||
807 |
|
||||
808 | Shadow history was added because the readline history is inherently very |
|
|||
809 | unsafe - if you have multiple IPython sessions open, the last session |
|
|||
810 | to close will overwrite the history of previountly closed session. Likewise, |
|
|||
811 | if a crash occurs, history is never saved, whereas shadow history entries |
|
|||
812 | are added after entering every command (so a command executed |
|
|||
813 | in another IPython session is immediately available in other IPython |
|
|||
814 | sessions that are open). |
|
|||
815 |
|
||||
816 | To conserve space, a command can exist in shadow history only once - it doesn't |
|
|||
817 | make sense to store a common line like "cd .." a thousand times. The idea is |
|
|||
818 | mainly to provide a reliable place where valuable, hard-to-remember commands can |
|
|||
819 | always be retrieved, as opposed to providing an exact sequence of commands |
|
|||
820 | you have entered in actual order. |
|
|||
821 |
|
||||
822 | Because shadow history has all the commands you have ever executed, |
|
|||
823 | time taken by %hist -g will increase oven time. If it ever starts to take |
|
|||
824 | too long (or it ends up containing sensitive information like passwords), |
|
|||
825 | clear the shadow history by `%clear shadow_nuke`. |
|
|||
826 |
|
||||
827 | Time taken to add entries to shadow history should be negligible, but |
|
|||
828 | in any case, if you start noticing performance degradation after using |
|
|||
829 | IPython for a long time (or running a script that floods the shadow history!), |
|
|||
830 | you can 'compress' the shadow history by executing |
|
|||
831 | `%clear shadow_compress`. In practice, this should never be necessary |
|
|||
832 | in normal use. |
|
|||
833 |
|
797 | |||
834 | .. _output_caching: |
|
798 | .. _output_caching: | |
835 |
|
799 | |||
@@ -874,7 +838,7 b' Directory history' | |||||
874 |
|
838 | |||
875 | Your history of visited directories is kept in the global list _dh, and |
|
839 | Your history of visited directories is kept in the global list _dh, and | |
876 | the magic %cd command can be used to go to any entry in that list. The |
|
840 | the magic %cd command can be used to go to any entry in that list. The | |
877 | %dhist command allows you to view this history. Do ``cd -<TAB`` to |
|
841 | %dhist command allows you to view this history. Do ``cd -<TAB>`` to | |
878 | conveniently view the directory history. |
|
842 | conveniently view the directory history. | |
879 |
|
843 | |||
880 |
|
844 | |||
@@ -1106,68 +1070,69 b" supplied, which we will briefly describe now. These can be used 'as is'" | |||||
1106 | (and both provide very useful functionality), or you can use them as a |
|
1070 | (and both provide very useful functionality), or you can use them as a | |
1107 | starting point for writing your own extensions. |
|
1071 | starting point for writing your own extensions. | |
1108 |
|
1072 | |||
|
1073 | .. _pasting_with_prompts: | |||
1109 |
|
1074 | |||
1110 |
Pasting of code starting with |
|
1075 | Pasting of code starting with Python or IPython prompts | |
1111 | ---------------------------------------------- |
|
1076 | ------------------------------------------------------- | |
1112 |
|
1077 | |||
1113 | In the python tutorial it is common to find code examples which have |
|
1078 | IPython is smart enough to filter out input prompts, be they plain Python ones | |
1114 | been taken from real python sessions. The problem with those is that all |
|
1079 | (``>>>`` and ``...``) or IPython ones (``In [N]:`` and `` ...:``). You can | |
1115 | the lines begin with either '>>> ' or '... ', which makes it impossible |
|
1080 | therefore copy and paste from existing interactive sessions without worry. | |
1116 | to paste them all at once. One must instead do a line by line manual |
|
|||
1117 | copying, carefully removing the leading extraneous characters. |
|
|||
1118 |
|
1081 | |||
1119 | This extension identifies those starting characters and removes them |
|
1082 | The following is a 'screenshot' of how things work, copying an example from the | |
1120 | from the input automatically, so that one can paste multi-line examples |
|
1083 | standard Python tutorial:: | |
1121 | directly into IPython, saving a lot of time. Please look at the file |
|
|||
1122 | InterpreterPasteInput.py in the IPython/extensions directory for details |
|
|||
1123 | on how this is done. |
|
|||
1124 |
|
1084 | |||
1125 | IPython comes with a special profile enabling this feature, called |
|
1085 | In [1]: >>> # Fibonacci series: | |
1126 | tutorial. Simply start IPython via 'ipython -p tutorial' and the feature |
|
|||
1127 | will be available. In a normal IPython session you can activate the |
|
|||
1128 | feature by importing the corresponding module with: |
|
|||
1129 | In [1]: import IPython.extensions.InterpreterPasteInput |
|
|||
1130 |
|
1086 | |||
1131 | The following is a 'screenshot' of how things work when this extension |
|
1087 | In [2]: ... # the sum of two elements defines the next | |
1132 | is on, copying an example from the standard tutorial:: |
|
|||
1133 |
|
1088 | |||
1134 | IPython profile: tutorial |
|
1089 | In [3]: ... a, b = 0, 1 | |
1135 |
|
1090 | |||
1136 | *** Pasting of code with ">>>" or "..." has been enabled. |
|
1091 | In [4]: >>> while b < 10: | |
|
1092 | ...: ... print b | |||
|
1093 | ...: ... a, b = b, a+b | |||
|
1094 | ...: | |||
|
1095 | 1 | |||
|
1096 | 1 | |||
|
1097 | 2 | |||
|
1098 | 3 | |||
|
1099 | 5 | |||
|
1100 | 8 | |||
1137 |
|
1101 | |||
1138 | In [1]: >>> def fib2(n): # return Fibonacci series up to n |
|
1102 | And pasting from IPython sessions works equally well:: | |
1139 | ...: ... """Return a list containing the Fibonacci series up to |
|
|||
1140 | n.""" |
|
|||
1141 | ...: ... result = [] |
|
|||
1142 | ...: ... a, b = 0, 1 |
|
|||
1143 | ...: ... while b < n: |
|
|||
1144 | ...: ... result.append(b) # see below |
|
|||
1145 | ...: ... a, b = b, a+b |
|
|||
1146 | ...: ... return result |
|
|||
1147 | ...: |
|
|||
1148 |
|
1103 | |||
1149 | In [2]: fib2(10) |
|
1104 | In [1]: In [5]: def f(x): | |
1150 | Out[2]: [1, 1, 2, 3, 5, 8] |
|
1105 | ...: ...: "A simple function" | |
|
1106 | ...: ...: return x**2 | |||
|
1107 | ...: ...: | |||
1151 |
|
1108 | |||
1152 | Note that as currently written, this extension does not recognize |
|
1109 | In [2]: f(3) | |
1153 | IPython's prompts for pasting. Those are more complicated, since the |
|
1110 | Out[2]: 9 | |
1154 | user can change them very easily, they involve numbers and can vary in |
|
|||
1155 | length. One could however extract all the relevant information from the |
|
|||
1156 | IPython instance and build an appropriate regular expression. This is |
|
|||
1157 | left as an exercise for the reader. |
|
|||
1158 |
|
1111 | |||
1159 | .. _gui_support: |
|
1112 | .. _gui_support: | |
1160 |
|
1113 | |||
1161 |
GUI event loop support |
|
1114 | GUI event loop support | |
1162 |
====================== |
|
1115 | ====================== | |
1163 |
|
1116 | |||
1164 | .. versionadded:: 0.11 |
|
1117 | .. versionadded:: 0.11 | |
1165 | The ``%gui`` magic and :mod:`IPython.lib.inputhook`. |
|
1118 | The ``%gui`` magic and :mod:`IPython.lib.inputhook`. | |
1166 |
|
1119 | |||
|
1120 | .. warning:: | |||
|
1121 | ||||
|
1122 | All GUI support with the ``%gui`` magic, described in this section, applies | |||
|
1123 | only to the plain terminal IPython, *not* to the Qt console. The Qt console | |||
|
1124 | currently only supports GUI interaction via the ``--pylab`` flag, as | |||
|
1125 | explained :ref:`in the matplotlib section <matplotlib_support>`. | |||
|
1126 | ||||
|
1127 | We intend to correct this limitation as soon as possible, you can track our | |||
|
1128 | progress at issue #643_. | |||
|
1129 | ||||
|
1130 | .. _643: https://github.com/ipython/ipython/issues/643 | |||
|
1131 | ||||
1167 | IPython has excellent support for working interactively with Graphical User |
|
1132 | IPython has excellent support for working interactively with Graphical User | |
1168 | Interface (GUI) toolkits, such as wxPython, PyQt4, PyGTK and Tk. This is |
|
1133 | Interface (GUI) toolkits, such as wxPython, PyQt4, PyGTK and Tk. This is | |
1169 | implemented using Python's builtin ``PyOSInputHook`` hook. This implementation |
|
1134 | implemented using Python's builtin ``PyOSInputHook`` hook. This implementation | |
1170 |
is extremely robust compared to our previous thread |
|
1135 | is extremely robust compared to our previous thread-based version. The | |
1171 | advantages of this are: |
|
1136 | advantages of this are: | |
1172 |
|
1137 | |||
1173 | * GUIs can be enabled and disabled dynamically at runtime. |
|
1138 | * GUIs can be enabled and disabled dynamically at runtime. | |
@@ -1179,46 +1144,46 b' advantages of this are:' | |||||
1179 | For users, enabling GUI event loop integration is simple. You simple use the |
|
1144 | For users, enabling GUI event loop integration is simple. You simple use the | |
1180 | ``%gui`` magic as follows:: |
|
1145 | ``%gui`` magic as follows:: | |
1181 |
|
1146 | |||
1182 |
%gui [ |
|
1147 | %gui [GUINAME] | |
1183 |
|
1148 | |||
1184 | With no arguments, ``%gui`` removes all GUI support. Valid ``GUINAME`` |
|
1149 | With no arguments, ``%gui`` removes all GUI support. Valid ``GUINAME`` | |
1185 |
arguments are ``wx``, ``qt4``, ``gtk`` and ``tk``. |
|
1150 | arguments are ``wx``, ``qt4``, ``gtk`` and ``tk``. | |
1186 | create and return a running application object for the selected GUI toolkit. |
|
|||
1187 |
|
1151 | |||
1188 | Thus, to use wxPython interactively and create a running :class:`wx.App` |
|
1152 | Thus, to use wxPython interactively and create a running :class:`wx.App` | |
1189 | object, do:: |
|
1153 | object, do:: | |
1190 |
|
1154 | |||
1191 |
%gui |
|
1155 | %gui wx | |
1192 |
|
1156 | |||
1193 | For information on IPython's Matplotlib integration (and the ``pylab`` mode) |
|
1157 | For information on IPython's Matplotlib integration (and the ``pylab`` mode) | |
1194 | see :ref:`this section <matplotlib_support>`. |
|
1158 | see :ref:`this section <matplotlib_support>`. | |
1195 |
|
1159 | |||
1196 | For developers that want to use IPython's GUI event loop integration in |
|
1160 | For developers that want to use IPython's GUI event loop integration in the | |
1197 |
|
|
1161 | form of a library, these capabilities are exposed in library form in the | |
1198 | in the :mod:`IPython.lib.inputhook`. Interested developers should see the |
|
1162 | :mod:`IPython.lib.inputhook` and :mod:`IPython.lib.guisupport` modules. | |
1199 | module docstrings for more information, but there are a few points that |
|
1163 | Interested developers should see the module docstrings for more information, | |
1200 | should be mentioned here. |
|
1164 | but there are a few points that should be mentioned here. | |
1201 |
|
1165 | |||
1202 | First, the ``PyOSInputHook`` approach only works in command line settings |
|
1166 | First, the ``PyOSInputHook`` approach only works in command line settings | |
1203 | where readline is activated. |
|
1167 | where readline is activated. As indicated in the warning above, we plan on | |
|
1168 | improving the integration of GUI event loops with the standalone kernel used by | |||
|
1169 | the Qt console and other frontends (issue 643_). | |||
1204 |
|
1170 | |||
1205 | Second, when using the ``PyOSInputHook`` approach, a GUI application should |
|
1171 | Second, when using the ``PyOSInputHook`` approach, a GUI application should | |
1206 | *not* start its event loop. Instead all of this is handled by the |
|
1172 | *not* start its event loop. Instead all of this is handled by the | |
1207 | ``PyOSInputHook``. This means that applications that are meant to be used both |
|
1173 | ``PyOSInputHook``. This means that applications that are meant to be used both | |
1208 | in IPython and as standalone apps need to have special code to detects how the |
|
1174 | in IPython and as standalone apps need to have special code to detects how the | |
1209 | application is being run. We highly recommend using IPython's |
|
1175 | application is being run. We highly recommend using IPython's support for this. | |
1210 | :func:`enable_foo` functions for this. Here is a simple example that shows the |
|
1176 | Since the details vary slightly between toolkits, we point you to the various | |
1211 | recommended code that should be at the bottom of a wxPython using GUI |
|
1177 | examples in our source directory :file:`docs/examples/lib` that demonstrate | |
1212 | application:: |
|
1178 | these capabilities. | |
1213 |
|
1179 | |||
1214 | try: |
|
1180 | .. warning:: | |
1215 | from IPython.lib.inputhook import enable_wx |
|
1181 | ||
1216 | enable_wx(app) |
|
1182 | The WX version of this is currently broken. While ``--pylab=wx`` works | |
1217 | except ImportError: |
|
1183 | fine, standalone WX apps do not. See | |
1218 | app.MainLoop() |
|
1184 | https://github.com/ipython/ipython/issues/645 for details of our progress on | |
|
1185 | this issue. | |||
1219 |
|
1186 | |||
1220 | This pattern should be used instead of the simple ``app.MainLoop()`` code |
|
|||
1221 | that a standalone wxPython application would have. |
|
|||
1222 |
|
1187 | |||
1223 | Third, unlike previous versions of IPython, we no longer "hijack" (replace |
|
1188 | Third, unlike previous versions of IPython, we no longer "hijack" (replace | |
1224 | them with no-ops) the event loops. This is done to allow applications that |
|
1189 | them with no-ops) the event loops. This is done to allow applications that | |
@@ -1233,7 +1198,7 b' PyQt and PySide' | |||||
1233 |
|
1198 | |||
1234 | .. attempt at explanation of the complete mess that is Qt support |
|
1199 | .. attempt at explanation of the complete mess that is Qt support | |
1235 |
|
1200 | |||
1236 | When you use ``gui=qt`` or ``pylab=qt``, IPython can work with either |
|
1201 | When you use ``--gui=qt`` or ``--pylab=qt``, IPython can work with either | |
1237 | PyQt4 or PySide. There are three options for configuration here, because |
|
1202 | PyQt4 or PySide. There are three options for configuration here, because | |
1238 | PyQt4 has two APIs for QString and QVariant - v1, which is the default on |
|
1203 | PyQt4 has two APIs for QString and QVariant - v1, which is the default on | |
1239 | Python 2, and the more natural v2, which is the only API supported by PySide. |
|
1204 | Python 2, and the more natural v2, which is the only API supported by PySide. | |
@@ -1251,21 +1216,20 b' PyQt4 to use its v2 API. So if ``QT_API=pyside`` PySide will be used,' | |||||
1251 | and if ``QT_API=pyqt`` then PyQt4 will be used *with the v2 API* for |
|
1216 | and if ``QT_API=pyqt`` then PyQt4 will be used *with the v2 API* for | |
1252 | QString and QVariant, so ETS codes like MayaVi will also work with IPython. |
|
1217 | QString and QVariant, so ETS codes like MayaVi will also work with IPython. | |
1253 |
|
1218 | |||
1254 | If you launch IPython in pylab mode with ``ipython pylab=qt``, then IPython |
|
1219 | If you launch IPython in pylab mode with ``ipython --pylab=qt``, then IPython | |
1255 | will ask matplotlib which Qt library to use (only if QT_API is *not set*), |
|
1220 | will ask matplotlib which Qt library to use (only if QT_API is *not set*), via | |
1256 | via the 'backend.qt4' rcParam. |
|
1221 | the 'backend.qt4' rcParam. If matplotlib is version 1.0.1 or older, then | |
1257 | If matplotlib is version 1.0.1 or older, then IPython will always use PyQt4 |
|
1222 | IPython will always use PyQt4 without setting the v2 APIs, since neither v2 | |
1258 | without setting the v2 APIs, since neither v2 PyQt nor PySide work. |
|
1223 | PyQt nor PySide work. | |
1259 |
|
1224 | |||
1260 | .. warning:: |
|
1225 | .. warning:: | |
1261 |
|
1226 | |||
1262 |
Note that this means for ETS 4 to work with PyQt4, ``QT_API`` *must* be set |
|
1227 | Note that this means for ETS 4 to work with PyQt4, ``QT_API`` *must* be set | |
1263 |
work with IPython's qt integration, because otherwise PyQt4 will be |
|
1228 | to work with IPython's qt integration, because otherwise PyQt4 will be | |
1264 | an incompatible mode. |
|
1229 | loaded in an incompatible mode. | |
1265 |
|
1230 | |||
1266 | It also means that you must *not* have ``QT_API`` set if you want to |
|
1231 | It also means that you must *not* have ``QT_API`` set if you want to | |
1267 | use ``gui=qt`` with code that requires PyQt4 API v1. |
|
1232 | use ``--gui=qt`` with code that requires PyQt4 API v1. | |
1268 |
|
||||
1269 |
|
1233 | |||
1270 |
|
1234 | |||
1271 | .. _matplotlib_support: |
|
1235 | .. _matplotlib_support: | |
@@ -1273,27 +1237,17 b' without setting the v2 APIs, since neither v2 PyQt nor PySide work.' | |||||
1273 | Plotting with matplotlib |
|
1237 | Plotting with matplotlib | |
1274 | ======================== |
|
1238 | ======================== | |
1275 |
|
1239 | |||
|
1240 | `Matplotlib`_ provides high quality 2D and 3D plotting for Python. Matplotlib | |||
|
1241 | can produce plots on screen using a variety of GUI toolkits, including Tk, | |||
|
1242 | PyGTK, PyQt4 and wxPython. It also provides a number of commands useful for | |||
|
1243 | scientific computing, all with a syntax compatible with that of the popular | |||
|
1244 | Matlab program. | |||
1276 |
|
1245 | |||
1277 | `Matplotlib`_ provides high quality 2D and |
|
1246 | To start IPython with matplotlib support, use the ``--pylab`` switch. If no | |
1278 | 3D plotting for Python. Matplotlib can produce plots on screen using a variety |
|
1247 | arguments are given, IPython will automatically detect your choice of | |
1279 | of GUI toolkits, including Tk, PyGTK, PyQt4 and wxPython. It also provides a |
|
1248 | matplotlib backend. You can also request a specific backend with | |
1280 | number of commands useful for scientific computing, all with a syntax |
|
1249 | ``--pylab=backend``, where ``backend`` must be one of: 'tk', 'qt', 'wx', 'gtk', | |
1281 | compatible with that of the popular Matlab program. |
|
1250 | 'osx'. | |
1282 |
|
||||
1283 | Many IPython users have come to rely on IPython's ``-pylab`` mode which |
|
|||
1284 | automates the integration of Matplotlib with IPython. We are still in the |
|
|||
1285 | process of working with the Matplotlib developers to finalize the new pylab |
|
|||
1286 | API, but for now you can use Matplotlib interactively using the following |
|
|||
1287 | commands:: |
|
|||
1288 |
|
||||
1289 | %gui -a wx |
|
|||
1290 | import matplotlib |
|
|||
1291 | matplotlib.use('wxagg') |
|
|||
1292 | from matplotlib import pylab |
|
|||
1293 | pylab.interactive(True) |
|
|||
1294 |
|
||||
1295 | All of this will soon be automated as Matplotlib begins to include |
|
|||
1296 | new logic that uses our new GUI support. |
|
|||
1297 |
|
1251 | |||
1298 | .. _Matplotlib: http://matplotlib.sourceforge.net |
|
1252 | .. _Matplotlib: http://matplotlib.sourceforge.net | |
1299 |
|
1253 | |||
@@ -1320,7 +1274,6 b' sections for execution as a demo:' | |||||
1320 | .. literalinclude:: ../../examples/lib/example-demo.py |
|
1274 | .. literalinclude:: ../../examples/lib/example-demo.py | |
1321 | :language: python |
|
1275 | :language: python | |
1322 |
|
1276 | |||
1323 |
|
||||
1324 | In order to run a file as a demo, you must first make a Demo object out |
|
1277 | In order to run a file as a demo, you must first make a Demo object out | |
1325 | of it. If the file is named myscript.py, the following code will make a |
|
1278 | of it. If the file is named myscript.py, the following code will make a | |
1326 | demo:: |
|
1279 | demo:: | |
@@ -1353,5 +1306,5 b' Supporting something like this would basically require tracking the' | |||||
1353 | internal execution state of the Python interpreter, so only top-level |
|
1306 | internal execution state of the Python interpreter, so only top-level | |
1354 | divisions are allowed. If you want to be able to open an IPython |
|
1307 | divisions are allowed. If you want to be able to open an IPython | |
1355 | instance at an arbitrary point in a program, you can use IPython's |
|
1308 | instance at an arbitrary point in a program, you can use IPython's | |
1356 |
embedding facilities, |
|
1309 | embedding facilities, see :func:`IPython.embed` for details. | |
1357 |
|
1310 |
@@ -1,4 +1,4 b'' | |||||
1 | .. _ip1par: |
|
1 | .. _parallel_overview: | |
2 |
|
2 | |||
3 | ============================ |
|
3 | ============================ | |
4 | Overview and getting started |
|
4 | Overview and getting started | |
@@ -47,6 +47,16 b' the ``I`` in IPython. The following are some example usage cases for IPython:' | |||||
47 |
|
47 | |||
48 | * Run a set of tasks on a set of CPUs using dynamic load balancing. |
|
48 | * Run a set of tasks on a set of CPUs using dynamic load balancing. | |
49 |
|
49 | |||
|
50 | .. tip:: | |||
|
51 | ||||
|
52 | At the SciPy 2011 conference in Austin, Min Ragan-Kelley presented a | |||
|
53 | complete 4-hour tutorial on the use of these features, and all the materials | |||
|
54 | for the tutorial are now `available online`__. That tutorial provides an | |||
|
55 | excellent, hands-on oriented complement to the reference documentation | |||
|
56 | presented here. | |||
|
57 | ||||
|
58 | .. __: http://minrk.github.com/scipy-tutorial-2011 | |||
|
59 | ||||
50 | Architecture overview |
|
60 | Architecture overview | |
51 | ===================== |
|
61 | ===================== | |
52 |
|
62 |
@@ -22,7 +22,7 b' the :command:`ipcluster` command::' | |||||
22 | $ ipcluster start --n=4 |
|
22 | $ ipcluster start --n=4 | |
23 |
|
23 | |||
24 | For more detailed information about starting the controller and engines, see |
|
24 | For more detailed information about starting the controller and engines, see | |
25 |
our :ref:`introduction < |
|
25 | our :ref:`introduction <parallel_overview>` to using IPython for parallel computing. | |
26 |
|
26 | |||
27 | Creating a ``Client`` instance |
|
27 | Creating a ``Client`` instance | |
28 | ============================== |
|
28 | ============================== |
@@ -27,7 +27,7 b' the :command:`ipcluster` command::' | |||||
27 | $ ipcluster start --n=4 |
|
27 | $ ipcluster start --n=4 | |
28 |
|
28 | |||
29 | For more detailed information about starting the controller and engines, see |
|
29 | For more detailed information about starting the controller and engines, see | |
30 |
our :ref:`introduction < |
|
30 | our :ref:`introduction <parallel_overview>` to using IPython for parallel computing. | |
31 |
|
31 | |||
32 | Creating a ``Client`` instance |
|
32 | Creating a ``Client`` instance | |
33 | ============================== |
|
33 | ============================== |
This diff has been collapsed as it changes many lines, (613 lines changed) Show them Hide them | |||||
@@ -1,98 +1,266 b'' | |||||
1 |
============= |
|
1 | ============= | |
2 | 0.11 Series |
|
2 | 0.11 Series | |
3 |
============= |
|
3 | ============= | |
4 |
|
4 | |||
5 | Release 0.11 |
|
5 | Release 0.11 | |
6 | ============ |
|
6 | ============ | |
7 |
|
7 | |||
8 |
IPython 0.11 is a *major* overhaul of IPython, two years in the making. Most |
|
8 | IPython 0.11 is a *major* overhaul of IPython, two years in the making. Most | |
9 |
the code base has been rewritten or at least reorganized, breaking backward |
|
9 | of the code base has been rewritten or at least reorganized, breaking backward | |
10 |
with several APIs in previous versions. It is the first major |
|
10 | compatibility with several APIs in previous versions. It is the first major | |
11 |
probably the most significant change to IPython since |
|
11 | release in two years, and probably the most significant change to IPython since | |
12 | As a result of the significant changes, we do plan to have a relatively quick |
|
12 | its inception. We plan to have a relatively quick succession of releases, as | |
13 | succession of releases, as people discover new bugs and regressions. |
|
13 | people discover new bugs and regressions. Once we iron out any significant | |
|
14 | bugs in this process and settle down the new APIs, this series will become | |||
|
15 | IPython 1.0. We encourage feedback now on the core APIs, which we hope to | |||
|
16 | maintain stable during the 1.0 series. | |||
|
17 | ||||
|
18 | Since the internal APIs have changed so much, projects using IPython as a | |||
|
19 | library (as opposed to end-users of the application) are the most likely to | |||
|
20 | encounter regressions or changes that break their existing use patterns. We | |||
|
21 | will make every effort to provide updated versions of the APIs to facilitate | |||
|
22 | the transition, and we encourage you to contact us on the `development mailing | |||
|
23 | list`__ with questions and feedback. | |||
|
24 | ||||
|
25 | .. __: http://mail.scipy.org/mailman/listinfo/ipython-dev | |||
|
26 | ||||
|
27 | Chris Fonnesbeck recently wrote an `excellent post`__ that highlights some of | |||
|
28 | our major new features, with examples and screenshots. We encourage you to | |||
|
29 | read it as it provides an illustrated, high-level overview complementing the | |||
|
30 | detailed feature breakdown in this document. | |||
|
31 | ||||
|
32 | .. __: http://stronginference.com/weblog/2011/7/15/innovations-in-ipython.html | |||
|
33 | ||||
|
34 | A quick summary of the major changes (see below for details): | |||
|
35 | ||||
|
36 | * **Standalone Qt console**: a new rich console has been added to IPython, | |||
|
37 | started with `ipython qtconsole`. In this application we have tried to | |||
|
38 | retain the feel of a terminal for fast and efficient workflows, while adding | |||
|
39 | many features that a plain text terminal simply can not support, such as | |||
|
40 | inline figures, full multiline editing with syntax highlighting, tooltips for | |||
|
41 | function calls and much more. This development was sponsored by `Enthought | |||
|
42 | Inc.`__. See :ref:`below <qtconsole_011>` for details. | |||
|
43 | ||||
|
44 | .. __: http://enthought.com | |||
|
45 | ||||
|
46 | * **High-level parallel computing with ZeroMQ**. Using the same architecture | |||
|
47 | that our Qt console is based on, we have completely rewritten our high-level | |||
|
48 | parallel computing machinery that in prior versions used the Twisted | |||
|
49 | networking framework. While this change will require users to update their | |||
|
50 | codes, the improvements in performance, memory control and internal | |||
|
51 | consistency across our codebase convinced us it was a price worth paying. We | |||
|
52 | have tried to explain how to best proceed with this update, and will be happy | |||
|
53 | to answer questions that may arise. A full tutorial describing these | |||
|
54 | features `was presented at SciPy'11`__. | |||
|
55 | ||||
|
56 | .. __: http://minrk.github.com/scipy-tutorial-2011 | |||
|
57 | ||||
|
58 | * **New model for GUI/plotting support in the terminal**. Now instead of the | |||
|
59 | various `-Xthread` flags we had before, GUI support is provided without the | |||
|
60 | use of any threads, by directly integrating GUI event loops with Python's | |||
|
61 | `PyOS_InputHook` API. A new command-line flag `--gui` controls GUI support, | |||
|
62 | and it can also be enabled after IPython startup via the new `%gui` magic. | |||
|
63 | This requires some changes if you want to execute GUI-using scripts inside | |||
|
64 | IPython, see :ref:`the GUI support section <gui_support>` for more details. | |||
|
65 | ||||
|
66 | * **A two-process architecture.** The Qt console is the first example of using | |||
|
67 | a new model that splits IPython between a kernel process where code is | |||
|
68 | executed and a client that handles user interaction. We plan on also | |||
|
69 | providing terminal and web-browser based clients using this infrastructure in | |||
|
70 | future releases. This model allows multiple clients to interact with an | |||
|
71 | IPython process through a well-documented protocol using the ZeroMQ | |||
|
72 | networking library. | |||
|
73 | ||||
|
74 | * **Refactoring.** the entire codebase has been refactored, in order to make it | |||
|
75 | more modular and easier to contribute to. IPython has traditionally been a | |||
|
76 | hard project to participate because the old codebase was very monolithic. We | |||
|
77 | hope this (ongoing) restructuring will make it easier for new developers to | |||
|
78 | join us. | |||
|
79 | ||||
|
80 | * **Vim integration**. Vim can be configured to seamlessly control an IPython | |||
|
81 | kernel, see the files in :file:`docs/examples/vim` for the full details. | |||
|
82 | This work was done by Paul Ivanov, who prepared a nice `video | |||
|
83 | demonstration`__ of the features it provides. | |||
|
84 | ||||
|
85 | .. __: http://pirsquared.org/blog/2011/07/28/vim-ipython/ | |||
|
86 | ||||
|
87 | * **Integration into Microsoft Visual Studio**. Thanks to the work of the | |||
|
88 | Microsoft `Python Tools for Visual Studio`__ team, this version of IPython | |||
|
89 | has been integrated into Microsoft Visual Studio's Python tools open source | |||
|
90 | plug-in. `Details below`_ | |||
|
91 | ||||
|
92 | .. __: http://pytools.codeplex.com | |||
|
93 | .. _details below: ms_visual_studio_011_ | |||
|
94 | ||||
|
95 | * **Improved unicode support**. We closed many bugs related to unicode input. | |||
|
96 | ||||
|
97 | * **Python 3**. IPython now runs on Python 3.x. See :ref:`python3_011` for | |||
|
98 | details. | |||
|
99 | ||||
|
100 | * **New profile model**. Profiles are now directories that contain all relevant | |||
|
101 | infromation for that session, and thus better isolate IPython use-cases. | |||
|
102 | ||||
|
103 | * **SQLite storage for history**. All history is now stored in a SQLite | |||
|
104 | database, providing support for multiple simultaneous sessions that won't | |||
|
105 | clobber each other as well as the ability to perform queries on all stored | |||
|
106 | data. | |||
|
107 | ||||
|
108 | * **New configuration system**. All parts of IPython are now configured via a | |||
|
109 | mechanism inspired by the Enthought Traits library. Any configurable element | |||
|
110 | can have its attributes set either via files that now use real Python syntax | |||
|
111 | or from the command-line. | |||
|
112 | ||||
|
113 | * **Pasting of code with prompts**. IPython now intelligently strips out input | |||
|
114 | prompts , be they plain Python ones (``>>>`` and ``...``) or IPython ones | |||
|
115 | (``In [N]:`` and `` ...:``). More details :ref:`here <pasting_with_prompts>`. | |||
|
116 | ||||
|
117 | ||||
|
118 | Authors and support | |||
|
119 | ------------------- | |||
|
120 | ||||
|
121 | Over 60 separate authors have contributed to this release, see :ref:`below | |||
|
122 | <credits_011>` for a full list. In particular, we want to highlight the | |||
|
123 | extremely active participation of two new core team members: Evan Patterson | |||
|
124 | implemented the Qt console, and Thomas Kluyver started with our Python 3 port | |||
|
125 | and by now has made major contributions to just about every area of IPython. | |||
|
126 | ||||
|
127 | We are also grateful for the support we have received during this development | |||
|
128 | cycle from several institutions: | |||
|
129 | ||||
|
130 | - `Enthought Inc`__ funded the development of our new Qt console, an effort that | |||
|
131 | required developing major pieces of underlying infrastructure, which now | |||
|
132 | power not only the Qt console but also our new parallel machinery. We'd like | |||
|
133 | to thank Eric Jones and Travis Oliphant for their support, as well as Ilan | |||
|
134 | Schnell for his tireless work integrating and testing IPython in the | |||
|
135 | `Enthought Python Distribution`_. | |||
|
136 | ||||
|
137 | .. __: http://enthought.com | |||
|
138 | .. _Enthought Python Distribution: http://www.enthought.com/products/epd.php | |||
|
139 | ||||
|
140 | - Nipy/NIH: funding via the `NiPy project`__ (NIH grant 5R01MH081909-02) helped | |||
|
141 | us jumpstart the development of this series by restructuring the entire | |||
|
142 | codebase two years ago in a way that would make modular development and | |||
|
143 | testing more approachable. Without this initial groundwork, all the new | |||
|
144 | features we have added would have been impossible to develop. | |||
|
145 | ||||
|
146 | .. __: http://nipy.org | |||
|
147 | ||||
|
148 | - Sage/NSF: funding via the grant `Sage: Unifying Mathematical Software for | |||
|
149 | Scientists, Engineers, and Mathematicians`__ (NSF grant DMS-1015114) | |||
|
150 | supported a meeting in spring 2011 of several of the core IPython developers | |||
|
151 | where major progress was made integrating the last key pieces leading to this | |||
|
152 | release. | |||
|
153 | ||||
|
154 | .. __: http://modular.math.washington.edu/grants/compmath09 | |||
|
155 | ||||
|
156 | - Microsoft's team working on `Python Tools for Visual Studio`__ developed the | |||
|
157 | integraton of IPython into the Python plugin for Visual Studio 2010. | |||
|
158 | ||||
|
159 | .. __: http://pytools.codeplex.com | |||
|
160 | ||||
|
161 | - Google Summer of Code: in 2010, we had two students developing prototypes of | |||
|
162 | the new machinery that is now maturing in this release: `Omar Zapata`_ and | |||
|
163 | `Gerardo Gutiérrez`_. | |||
14 |
|
164 | |||
|
165 | .. _Omar Zapata: http://ipythonzmq.blogspot.com/2010/08/ipython-zmq-status.html | |||
|
166 | .. _Gerardo Gutiérrez: http://ipythonqt.blogspot.com/2010/04/ipython-qt-interface-gsoc-2010-proposal.html> | |||
15 |
|
167 | |||
16 | Authors |
|
|||
17 | ------- |
|
|||
18 |
|
168 | |||
19 | Many users and developers contributed code, features, bug reports and ideas to |
|
169 | Development summary | |
20 | this release. Please do not hesitate in contacting us if we've failed to |
|
170 | ------------------- | |
21 | acknowledge your contribution here. In particular, for this release we have |
|
|||
22 | contribution from the following people, a mix of new and regular names (in |
|
|||
23 | alphabetical order by first name): |
|
|||
24 |
|
171 | |||
|
172 | In April 2010, after `one breakage too many with bzr`__, we decided to move our | |||
|
173 | entire development process to Git and Github.com. This has proven to be one of | |||
|
174 | the best decisions in the project's history, as the combination of git and | |||
|
175 | github have made us far, far more productive than we could be with our previous | |||
|
176 | tools. We first converted our bzr repo to a git one without losing history, | |||
|
177 | and a few weeks later ported all open Launchpad bugs to github issues with | |||
|
178 | their comments mostly intact (modulo some formatting changes). This ensured a | |||
|
179 | smooth transition where no development history or submitted bugs were lost. | |||
25 |
|
180 | |||
26 | * Andy Wilson <wilson.andrew.j+github-at-gmail.com> |
|
181 | .. __: http://mail.scipy.org/pipermail/ipython-dev/2010-April/005944.html | |
27 | * Aenugu Sai Kiran Reddy <saikrn08-at-gmail.com> |
|
|||
28 | * Antonio Cuni <antocuni> |
|
|||
29 | * Barry Wark <barrywark-at-gmail.com> |
|
|||
30 | * Beetoju Anuradha <anu.beethoju-at-gmail.com> |
|
|||
31 | * Brad Reisfeld |
|
|||
32 | * Brian Granger <ellisonbg-at-gmail.com> |
|
|||
33 | * Cody Precord |
|
|||
34 | * Darren Dale <dsdale24-at-gmail.com> |
|
|||
35 | * Dav Clark <davclark-at-berkeley.edu> |
|
|||
36 | * David Warde-Farley <wardefar-at-iro.umontreal.ca> |
|
|||
37 | * Eric Firing <efiring-at-hawaii.edu> |
|
|||
38 | * Erik Tollerud <erik.tollerud-at-gmail.com> |
|
|||
39 | * Evan Patterson <ejpatters-at-gmail.com> |
|
|||
40 | * Fernando Perez <Fernando.Perez-at-berkeley.edu> |
|
|||
41 | * Gael Varoquaux <gael.varoquaux-at-normalesup.org> |
|
|||
42 | * Gerardo <muzgash-at-Muzpelheim> |
|
|||
43 | * Jason Grout <jason.grout-at-drake.edu> |
|
|||
44 | * Jens Hedegaard Nielsen <jenshnielsen-at-gmail.com> |
|
|||
45 | * Justin Riley <justin.t.riley-at-gmail.com> |
|
|||
46 | * Jörgen Stenarson <jorgen.stenarson-at-bostream.nu> |
|
|||
47 | * Kiorky |
|
|||
48 | * Laurent Dufrechou <laurent.dufrechou-at-gmail.com> |
|
|||
49 | * Luis Pedro Coelho <luis-at-luispedro.org> |
|
|||
50 | * Mani chandra <mchandra-at-iitk.ac.in> |
|
|||
51 | * Mark E. Smith |
|
|||
52 | * Mark Voorhies <mark.voorhies-at-ucsf.edu> |
|
|||
53 | * Martin Spacek <git-at-mspacek.mm.st> |
|
|||
54 | * Michael Droettboom <mdroe-at-stsci.edu> |
|
|||
55 | * Min RK <benjaminrk-at-gmail.com> |
|
|||
56 | * Nick Tarleton <nick-at-quixey.com> |
|
|||
57 | * Nicolas Rougier <Nicolas.rougier-at-inria.fr> |
|
|||
58 | * Omar Andres Zapata Mesa <andresete.chaos-at-gmail.com> |
|
|||
59 | * Paul Ivanov <pivanov314-at-gmail.com> |
|
|||
60 | * Pauli Virtanen <pauli.virtanen-at-iki.fi> |
|
|||
61 | * Prabhu Ramachandran |
|
|||
62 | * Ramana <sramana9-at-gmail.com> |
|
|||
63 | * Robert Kern <robert.kern-at-gmail.com> |
|
|||
64 | * Sathesh Chandra <satheshchandra88-at-gmail.com> |
|
|||
65 | * Satrajit Ghosh <satra-at-mit.edu> |
|
|||
66 | * Sebastian Busch |
|
|||
67 | * Stefan van der Walt <bzr-at-mentat.za.net> |
|
|||
68 | * Stephan Peijnik <debian-at-sp.or.at> |
|
|||
69 | * Steven Bethard |
|
|||
70 | * Thomas Kluyver <takowl-at-gmail.com> |
|
|||
71 | * Thomas Spura <tomspur-at-fedoraproject.org> |
|
|||
72 | * Tom Fetherston <tfetherston-at-aol.com> |
|
|||
73 | * Tom MacWright |
|
|||
74 | * Ville M. Vainio <vivainio-at-gmail.com> |
|
|||
75 | * Vishal Vatsa <vishal.vatsa-at-gmail.com> |
|
|||
76 | * Vishnu S G <sgvishnu777-at-gmail.com> |
|
|||
77 | * Walter Doerwald <walter-at-livinglogic.de> |
|
|||
78 | * dan.milstein |
|
|||
79 | * muzuiget <muzuiget-at-gmail.com> |
|
|||
80 | * tzanko |
|
|||
81 | * vankayala sowjanya <hai.sowjanya-at-gmail.com> |
|
|||
82 |
|
182 | |||
83 | .. note:: |
|
183 | These simple statistics show how much work has been done on the new release, by | |
|
184 | comparing the current code to the last point it had in common with the 0.10 | |||
|
185 | series. A huge diff and over 2000 commits make up this development:: | |||
84 |
|
186 | |||
85 | This list was generated with the output of |
|
187 | git diff $(git merge-base 0.10.2 HEAD) | wc -l | |
86 | ``git log dev-0.11 HEAD --format='* %aN <%aE>' | sed 's/@/\-at\-/' | sed 's/<>//' | sort -u`` |
|
188 | 287676 | |
87 | after some cleanup. If you should be on this list, please add yourself. |
|
189 | ||
|
190 | git log $(git merge-base 0.10.2 HEAD) --oneline | wc -l | |||
|
191 | 2046 | |||
|
192 | ||||
|
193 | Since our move to github, 510 issues were closed, 225 of which were pull | |||
|
194 | requests and 285 regular issues (see :ref:`below <issues_list_011>` for a full | |||
|
195 | list). Github's pull requests are a fantastic mechanism for reviewing code and | |||
|
196 | building a shared ownership of the project, and we are making enthusiastic use | |||
|
197 | of it. | |||
|
198 | ||||
|
199 | .. Note:: | |||
|
200 | ||||
|
201 | This undercounts the number of issues closed in this development cycle, | |||
|
202 | since we only moved to github for issue tracking in May 2010, but we have no | |||
|
203 | way of collecting statistics on the number of issues closed in the old | |||
|
204 | Launchpad bug tracker prior to that. | |||
|
205 | ||||
|
206 | ||||
|
207 | .. _qtconsole_011: | |||
|
208 | ||||
|
209 | Qt Console | |||
|
210 | ---------- | |||
|
211 | ||||
|
212 | IPython now ships with a Qt application that feels very much like a terminal, | |||
|
213 | but is in fact a rich GUI that runs an IPython client but supports inline | |||
|
214 | figures, saving sessions to PDF and HTML, multiline editing with syntax | |||
|
215 | highlighting, graphical calltips and much more: | |||
|
216 | ||||
|
217 | .. figure:: ../_static/qtconsole.png | |||
|
218 | :width: 400px | |||
|
219 | :alt: IPython Qt console with embedded plots | |||
|
220 | :align: center | |||
|
221 | :target: ../_static/qtconsole.png | |||
|
222 | ||||
|
223 | The Qt console for IPython, using inline matplotlib plots. | |||
|
224 | ||||
|
225 | We hope that many projects will embed this widget, which we've kept | |||
|
226 | deliberately very lightweight, into their own environments. In the future we | |||
|
227 | may also offer a slightly more featureful application (with menus and other GUI | |||
|
228 | elements), but we remain committed to always shipping this easy to embed | |||
|
229 | widget. | |||
|
230 | ||||
|
231 | See the :ref:`Qt console section <qtconsole>` of the docs for a detailed | |||
|
232 | description of the console's features and use. | |||
|
233 | ||||
|
234 | ||||
|
235 | High-level parallel computing with ZeroMQ | |||
|
236 | ----------------------------------------- | |||
|
237 | ||||
|
238 | We have completely rewritten the Twisted-based code for high-level parallel | |||
|
239 | computing to work atop our new ZeroMQ architecture. While we realize this will | |||
|
240 | break compatibility for a number of users, we hope to make the transition as | |||
|
241 | easy as possible with our docs, and we are convinced the change is worth it. | |||
|
242 | ZeroMQ provides us with much tighter control over memory, higher performance, | |||
|
243 | and its communications are impervious to the Python Global Interpreter Lock | |||
|
244 | because they take place in a system-level C++ thread. The impact of the GIL in | |||
|
245 | our previous code was something we could simply not work around, given that | |||
|
246 | Twisted is itself a Python library. So while Twisted is a very capable | |||
|
247 | framework, we think ZeroMQ fits our needs much better and we hope you will find | |||
|
248 | the change to be a significant improvement in the long run. | |||
|
249 | ||||
|
250 | Our manual contains :ref:`a full description of how to use IPython for parallel | |||
|
251 | computing <parallel_overview>`, and the `tutorial`__ presented by Min | |||
|
252 | Ragan-Kelley at the SciPy 2011 conference provides a hands-on complement to the | |||
|
253 | reference docs. | |||
|
254 | ||||
|
255 | .. __: http://minrk.github.com/scipy-tutorial-2011 | |||
88 |
|
256 | |||
89 |
|
257 | |||
90 | Refactoring |
|
258 | Refactoring | |
91 | ----------- |
|
259 | ----------- | |
92 |
|
260 | |||
93 |
As of th |
|
261 | As of this release, a signifiant portion of IPython has been refactored. This | |
94 |
|
|
262 | refactoring is founded on a number of new abstractions. The main new classes | |
95 |
|
|
263 | that implement these abstractions are: | |
96 |
|
264 | |||
97 | * :class:`IPython.utils.traitlets.HasTraits`. |
|
265 | * :class:`IPython.utils.traitlets.HasTraits`. | |
98 | * :class:`IPython.config.configurable.Configurable`. |
|
266 | * :class:`IPython.config.configurable.Configurable`. | |
@@ -114,8 +282,8 b" a leading '-', nor a space separating key from value. Flags exist, to set" | |||||
114 | multiple values or boolean flags, and these are always prefixed with '--', and |
|
282 | multiple values or boolean flags, and these are always prefixed with '--', and | |
115 | never take arguments. |
|
283 | never take arguments. | |
116 |
|
284 | |||
117 | ZMQ architecture |
|
285 | ZeroMQ architecture | |
118 | ---------------- |
|
286 | ------------------- | |
119 |
|
287 | |||
120 | There is a new GUI framework for IPython, based on a client-server model in |
|
288 | There is a new GUI framework for IPython, based on a client-server model in | |
121 | which multiple clients can communicate with one IPython kernel, using the |
|
289 | which multiple clients can communicate with one IPython kernel, using the | |
@@ -127,6 +295,8 b' The parallel computing framework has also been rewritten using ZMQ. The' | |||||
127 | protocol is described :ref:`here <parallel_messages>`, and the code is in the |
|
295 | protocol is described :ref:`here <parallel_messages>`, and the code is in the | |
128 | new :mod:`IPython.parallel` module. |
|
296 | new :mod:`IPython.parallel` module. | |
129 |
|
297 | |||
|
298 | .. _python3_011: | |||
|
299 | ||||
130 | Python 3 support |
|
300 | Python 3 support | |
131 | ---------------- |
|
301 | ---------------- | |
132 |
|
302 | |||
@@ -134,20 +304,51 b' A Python 3 version of IPython has been prepared. For the time being, this is' | |||||
134 | maintained separately and updated from the main codebase. Its code can be found |
|
304 | maintained separately and updated from the main codebase. Its code can be found | |
135 | `here <https://github.com/ipython/ipython-py3k>`_. The parallel computing |
|
305 | `here <https://github.com/ipython/ipython-py3k>`_. The parallel computing | |
136 | components are not perfect on Python3, but most functionality appears to be |
|
306 | components are not perfect on Python3, but most functionality appears to be | |
137 | working. |
|
307 | working. As this work is evolving quickly, the best place to find updated | |
|
308 | information about it is our `Python 3 wiki page`__. | |||
|
309 | ||||
|
310 | .. __: http://wiki.ipython.org/index.php?title=Python_3 | |||
|
311 | ||||
138 |
|
312 | |||
139 | Unicode |
|
313 | Unicode | |
140 | ------- |
|
314 | ------- | |
141 |
|
315 | |||
142 |
Entering non-ascii characters in unicode literals (``u"€ø"``) now works |
|
316 | Entering non-ascii characters in unicode literals (``u"€ø"``) now works | |
143 |
on all platforms. However, entering these in byte/string literals |
|
317 | properly on all platforms. However, entering these in byte/string literals | |
144 |
will not work as expected on Windows (or any platform where the |
|
318 | (``"€ø"``) will not work as expected on Windows (or any platform where the | |
145 |
is not UTF-8, as it typically is for Linux & Mac OS X). You |
|
319 | terminal encoding is not UTF-8, as it typically is for Linux & Mac OS X). You | |
146 |
(``"\xe9\x82"``) to get bytes above 128, or use |
|
320 | can use escape sequences (``"\xe9\x82"``) to get bytes above 128, or use | |
147 |
them. This is a limitation of Python 2 which we |
|
321 | unicode literals and encode them. This is a limitation of Python 2 which we | |
|
322 | cannot easily work around. | |||
148 |
|
323 | |||
149 | New features |
|
324 | .. _ms_visual_studio_011: | |
150 | ------------ |
|
325 | ||
|
326 | Integration with Microsoft Visual Studio | |||
|
327 | ---------------------------------------- | |||
|
328 | ||||
|
329 | IPython can be used as the interactive shell in the `Python plugin for | |||
|
330 | Microsoft Visual Studio`__, as seen here: | |||
|
331 | ||||
|
332 | .. figure:: ../_static/ms_visual_studio.png | |||
|
333 | :width: 500px | |||
|
334 | :alt: IPython console embedded in Microsoft Visual Studio. | |||
|
335 | :align: center | |||
|
336 | :target: ../_static/ms_visual_studio.png | |||
|
337 | ||||
|
338 | IPython console embedded in Microsoft Visual Studio. | |||
|
339 | ||||
|
340 | The Microsoft team developing this currently has a release candidate out using | |||
|
341 | IPython 0.11. We will continue to collaborate with them to ensure that as they | |||
|
342 | approach their final release date, the integration with IPython remains smooth. | |||
|
343 | We'd like to thank Dino Viehland and Shahrokh Mortazavi for the work they have | |||
|
344 | done towards this feature, as well as Wenming Ye for his support of our WinHPC | |||
|
345 | capabilities. | |||
|
346 | ||||
|
347 | .. __: http://pytools.codeplex.com | |||
|
348 | ||||
|
349 | ||||
|
350 | Additional new features | |||
|
351 | ----------------------- | |||
151 |
|
352 | |||
152 | * Added ``Bytes`` traitlet, removing ``Str``. All 'string' traitlets should |
|
353 | * Added ``Bytes`` traitlet, removing ``Str``. All 'string' traitlets should | |
153 | either be ``Unicode`` if a real string, or ``Bytes`` if a C-string. This |
|
354 | either be ``Unicode`` if a real string, or ``Bytes`` if a C-string. This | |
@@ -185,10 +386,10 b' New features' | |||||
185 | configuration system :ref:`documentation <config_index>` for more details. |
|
386 | configuration system :ref:`documentation <config_index>` for more details. | |
186 |
|
387 | |||
187 | * The :class:`~IPython.core.interactiveshell.InteractiveShell` class is now a |
|
388 | * The :class:`~IPython.core.interactiveshell.InteractiveShell` class is now a | |
188 |
:class:`~IPython.config.configurable.Configurable` subclass and has traitlets |
|
389 | :class:`~IPython.config.configurable.Configurable` subclass and has traitlets | |
189 |
determine the defaults and runtime environment. The ``__init__`` method |
|
390 | that determine the defaults and runtime environment. The ``__init__`` method | |
190 |
also been refactored so this class can be instantiated and run without |
|
391 | has also been refactored so this class can be instantiated and run without | |
191 | old :mod:`ipmaker` module. |
|
392 | the old :mod:`ipmaker` module. | |
192 |
|
393 | |||
193 | * The methods of :class:`~IPython.core.interactiveshell.InteractiveShell` have |
|
394 | * The methods of :class:`~IPython.core.interactiveshell.InteractiveShell` have | |
194 | been organized into sections to make it easier to turn more sections |
|
395 | been organized into sections to make it easier to turn more sections | |
@@ -208,18 +409,15 b' New features' | |||||
208 | strings like ``foo.bar.Bar`` to the actual class. |
|
409 | strings like ``foo.bar.Bar`` to the actual class. | |
209 |
|
410 | |||
210 | * Completely refactored the :mod:`IPython.core.prefilter` module into |
|
411 | * Completely refactored the :mod:`IPython.core.prefilter` module into | |
211 |
:class:`~IPython.config.configurable.Configurable` subclasses. Added a new |
|
412 | :class:`~IPython.config.configurable.Configurable` subclasses. Added a new | |
212 |
into the prefilter system, called "transformations" that all new |
|
413 | layer into the prefilter system, called "transformations" that all new | |
213 |
logic should use (rather than the older "checker/handler" |
|
414 | prefilter logic should use (rather than the older "checker/handler" | |
|
415 | approach). | |||
214 |
|
416 | |||
215 | * Aliases are now components (:mod:`IPython.core.alias`). |
|
417 | * Aliases are now components (:mod:`IPython.core.alias`). | |
216 |
|
418 | |||
217 | * We are now using an internally shipped version of |
|
|||
218 | :mod:`~IPython.external.argparse` to parse command line options for |
|
|||
219 | :command:`ipython`. |
|
|||
220 |
|
||||
221 | * New top level :func:`~IPython.frontend.terminal.embed.embed` function that can |
|
419 | * New top level :func:`~IPython.frontend.terminal.embed.embed` function that can | |
222 |
be called to embed IPython at any place in user's code. On |
|
420 | be called to embed IPython at any place in user's code. On the first call it | |
223 | will create an :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed` |
|
421 | will create an :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed` | |
224 | instance and call it. In later calls, it just calls the previously created |
|
422 | instance and call it. In later calls, it just calls the previously created | |
225 | :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed`. |
|
423 | :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed`. | |
@@ -263,13 +461,14 b' New features' | |||||
263 |
|
461 | |||
264 | * :mod:`IPython.utils.ipstruct` has been refactored to be a subclass of |
|
462 | * :mod:`IPython.utils.ipstruct` has been refactored to be a subclass of | |
265 | dict. It also now has full docstrings and doctests. |
|
463 | dict. It also now has full docstrings and doctests. | |
266 | * Created a Trait's like implementation in :mod:`IPython.utils.traitlets`. |
|
464 | ||
267 | This is a pure Python, lightweight version of a library that is similar to |
|
465 | * Created a Traits like implementation in :mod:`IPython.utils.traitlets`. This | |
268 | :mod:`enthought.traits`. We are using this for validation, defaults and |
|
466 | is a pure Python, lightweight version of a library that is similar to | |
269 | notification in our new component system. Although it is not API compatible |
|
467 | Enthought's Traits project, but has no dependencies on Enthought's code. We | |
270 | with :mod:`enthought.traits`, we plan on moving in this direction so that |
|
468 | are using this for validation, defaults and notification in our new component | |
271 | eventually our implementation could be replaced by a (yet to exist) pure |
|
469 | system. Although it is not 100% API compatible with Enthought's Traits, we | |
272 | Python version of :mod:`enthought.traits`. |
|
470 | plan on moving in this direction so that eventually our implementation could | |
|
471 | be replaced by a (yet to exist) pure Python version of Enthought Traits. | |||
273 |
|
472 | |||
274 | * Added a new module :mod:`IPython.lib.inputhook` to manage the integration |
|
473 | * Added a new module :mod:`IPython.lib.inputhook` to manage the integration | |
275 | with GUI event loops using `PyOS_InputHook`. See the docstrings in this |
|
474 | with GUI event loops using `PyOS_InputHook`. See the docstrings in this | |
@@ -362,10 +561,9 b' Backwards incompatible changes' | |||||
362 | * :mod:`Extensions` has been moved to :mod:`extensions` and all existing |
|
561 | * :mod:`Extensions` has been moved to :mod:`extensions` and all existing | |
363 | extensions have been moved to either :mod:`IPython.quarantine` or |
|
562 | extensions have been moved to either :mod:`IPython.quarantine` or | |
364 | :mod:`IPython.deathrow`. :mod:`IPython.quarantine` contains modules that we |
|
563 | :mod:`IPython.deathrow`. :mod:`IPython.quarantine` contains modules that we | |
365 | plan on keeping but that need to be updated. :mod:`IPython.deathrow` |
|
564 | plan on keeping but that need to be updated. :mod:`IPython.deathrow` contains | |
366 |
|
|
565 | modules that are either dead or that should be maintained as third party | |
367 |
|
|
566 | libraries. More details about this can be found :ref:`here <module_reorg>`. | |
368 | <module_reorg>`. |
|
|||
369 |
|
567 | |||
370 | * Previous IPython GUIs in :mod:`IPython.frontend` and :mod:`IPython.gui` are |
|
568 | * Previous IPython GUIs in :mod:`IPython.frontend` and :mod:`IPython.gui` are | |
371 | likely broken, and have been removed to :mod:`IPython.deathrow` because of the |
|
569 | likely broken, and have been removed to :mod:`IPython.deathrow` because of the | |
@@ -375,17 +573,184 b' Backwards incompatible changes' | |||||
375 | Known Regressions |
|
573 | Known Regressions | |
376 | ----------------- |
|
574 | ----------------- | |
377 |
|
575 | |||
378 |
We do our best to improve IPython, but there are some known regressions in 0.11 |
|
576 | We do our best to improve IPython, but there are some known regressions in 0.11 | |
379 | to 0.10.2. |
|
577 | relative to 0.10.2. First of all, there are features that have yet to be | |
|
578 | ported to the new APIs, and in order to ensure that all of the installed code | |||
|
579 | runs for our users, we have moved them to two separate directories in the | |||
|
580 | source distribution, `quarantine` and `deathrow`. Finally, we have some other | |||
|
581 | miscellaneous regressions that we hope to fix as soon as possible. We now | |||
|
582 | describe all of these in more detail. | |||
|
583 | ||||
|
584 | Quarantine | |||
|
585 | ~~~~~~~~~~ | |||
|
586 | ||||
|
587 | These are tools and extensions that we consider relatively easy to update to | |||
|
588 | the new classes and APIs, but that we simply haven't had time for. Any user | |||
|
589 | who is interested in one of these is encouraged to help us by porting it and | |||
|
590 | submitting a pull request on our `development site`_. | |||
|
591 | ||||
|
592 | .. _development site:: http://github.com/ipython/ipython | |||
|
593 | ||||
|
594 | Currently, the quarantine directory contains:: | |||
|
595 | ||||
|
596 | clearcmd.py ipy_fsops.py ipy_signals.py | |||
|
597 | envpersist.py ipy_gnuglobal.py ipy_synchronize_with.py | |||
|
598 | ext_rescapture.py ipy_greedycompleter.py ipy_system_conf.py | |||
|
599 | InterpreterExec.py ipy_jot.py ipy_which.py | |||
|
600 | ipy_app_completers.py ipy_lookfor.py ipy_winpdb.py | |||
|
601 | ipy_autoreload.py ipy_profile_doctest.py ipy_workdir.py | |||
|
602 | ipy_completers.py ipy_pydb.py jobctrl.py | |||
|
603 | ipy_editors.py ipy_rehashdir.py ledit.py | |||
|
604 | ipy_exportdb.py ipy_render.py pspersistence.py | |||
|
605 | ipy_extutil.py ipy_server.py win32clip.py | |||
|
606 | ||||
|
607 | Deathrow | |||
|
608 | ~~~~~~~~ | |||
|
609 | ||||
|
610 | These packages may be harder to update or make most sense as third-party | |||
|
611 | libraries. Some of them are completely obsolete and have been already replaced | |||
|
612 | by better functionality (we simply haven't had the time to carefully weed them | |||
|
613 | out so they are kept here for now). Others simply require fixes to code that | |||
|
614 | the current core team may not be familiar with. If a tool you were used to is | |||
|
615 | included here, we encourage you to contact the dev list and we can discuss | |||
|
616 | whether it makes sense to keep it in IPython (if it can be maintained). | |||
|
617 | ||||
|
618 | Currently, the deathrow directory contains:: | |||
|
619 | ||||
|
620 | astyle.py ipy_defaults.py ipy_vimserver.py | |||
|
621 | dtutils.py ipy_kitcfg.py numeric_formats.py | |||
|
622 | Gnuplot2.py ipy_legacy.py numutils.py | |||
|
623 | GnuplotInteractive.py ipy_p4.py outputtrap.py | |||
|
624 | GnuplotRuntime.py ipy_profile_none.py PhysicalQInput.py | |||
|
625 | ibrowse.py ipy_profile_numpy.py PhysicalQInteractive.py | |||
|
626 | igrid.py ipy_profile_scipy.py quitter.py* | |||
|
627 | ipipe.py ipy_profile_sh.py scitedirector.py | |||
|
628 | iplib.py ipy_profile_zope.py Shell.py | |||
|
629 | ipy_constants.py ipy_traits_completer.py twshell.py | |||
|
630 | ||||
|
631 | ||||
|
632 | Other regressions | |||
|
633 | ~~~~~~~~~~~~~~~~~ | |||
|
634 | ||||
|
635 | * The machinery that adds functionality to the 'sh' profile for using IPython | |||
|
636 | as your system shell has not been updated to use the new APIs. As a result, | |||
|
637 | only the aesthetic (prompt) changes are still implemented. We intend to fix | |||
|
638 | this by 0.12. Tracked as issue 547_. | |||
|
639 | ||||
|
640 | .. _547: https://github.com/ipython/ipython/issues/547 | |||
|
641 | ||||
|
642 | * The installation of scripts on Windows was broken without setuptools, so we | |||
|
643 | now depend on setuptools on Windows. We hope to fix setuptools-less | |||
|
644 | installation, and then remove the setuptools dependency. Issue 539_. | |||
|
645 | ||||
|
646 | .. _539: https://github.com/ipython/ipython/issues/539 | |||
|
647 | ||||
|
648 | * The directory history `_dh` is not saved between sessions. Issue 634_. | |||
|
649 | ||||
|
650 | .. _634: https://github.com/ipython/ipython/issues/634 | |||
|
651 | ||||
|
652 | ||||
|
653 | Removed Features | |||
|
654 | ---------------- | |||
|
655 | ||||
|
656 | As part of the updating of IPython, we have removed a few features for the | |||
|
657 | purpsoes of cleaning up the codebase and interfaces. These removals are | |||
|
658 | permanent, but for any item listed below, equivalent functionality is | |||
|
659 | available. | |||
|
660 | ||||
|
661 | * The magics Exit and Quit have been dropped as ways to exit IPython. Instead, | |||
|
662 | the lowercase forms of both work either as a bare name (``exit``) or a | |||
|
663 | function call (``exit()``). You can assign these to other names using | |||
|
664 | exec_lines in the config file. | |||
|
665 | ||||
|
666 | ||||
|
667 | .. _credits_011:: | |||
|
668 | ||||
|
669 | Credits | |||
|
670 | ------- | |||
|
671 | ||||
|
672 | Many users and developers contributed code, features, bug reports and ideas to | |||
|
673 | this release. Please do not hesitate in contacting us if we've failed to | |||
|
674 | acknowledge your contribution here. In particular, for this release we have | |||
|
675 | contribution from the following people, a mix of new and regular names (in | |||
|
676 | alphabetical order by first name): | |||
|
677 | ||||
|
678 | * Aenugu Sai Kiran Reddy <saikrn08-at-gmail.com> | |||
|
679 | * andy wilson <wilson.andrew.j+github-at-gmail.com> | |||
|
680 | * Antonio Cuni <antocuni> | |||
|
681 | * Barry Wark <barrywark-at-gmail.com> | |||
|
682 | * Beetoju Anuradha <anu.beethoju-at-gmail.com> | |||
|
683 | * Benjamin Ragan-Kelley <minrk-at-Mercury.local> | |||
|
684 | * Brad Reisfeld | |||
|
685 | * Brian E. Granger <ellisonbg-at-gmail.com> | |||
|
686 | * Christoph Gohlke <cgohlke-at-uci.edu> | |||
|
687 | * Cody Precord | |||
|
688 | * dan.milstein | |||
|
689 | * Darren Dale <dsdale24-at-gmail.com> | |||
|
690 | * Dav Clark <davclark-at-berkeley.edu> | |||
|
691 | * David Warde-Farley <wardefar-at-iro.umontreal.ca> | |||
|
692 | * epatters <ejpatters-at-gmail.com> | |||
|
693 | * epatters <epatters-at-caltech.edu> | |||
|
694 | * epatters <epatters-at-enthought.com> | |||
|
695 | * Eric Firing <efiring-at-hawaii.edu> | |||
|
696 | * Erik Tollerud <erik.tollerud-at-gmail.com> | |||
|
697 | * Evan Patterson <epatters-at-enthought.com> | |||
|
698 | * Fernando Perez <Fernando.Perez-at-berkeley.edu> | |||
|
699 | * Gael Varoquaux <gael.varoquaux-at-normalesup.org> | |||
|
700 | * Gerardo <muzgash-at-Muzpelheim> | |||
|
701 | * Jason Grout <jason.grout-at-drake.edu> | |||
|
702 | * John Hunter <jdh2358-at-gmail.com> | |||
|
703 | * Jens Hedegaard Nielsen <jenshnielsen-at-gmail.com> | |||
|
704 | * Johann Cohen-Tanugi <johann.cohentanugi-at-gmail.com> | |||
|
705 | * Jörgen Stenarson <jorgen.stenarson-at-bostream.nu> | |||
|
706 | * Justin Riley <justin.t.riley-at-gmail.com> | |||
|
707 | * Kiorky | |||
|
708 | * Laurent Dufrechou <laurent.dufrechou-at-gmail.com> | |||
|
709 | * Luis Pedro Coelho <lpc-at-cmu.edu> | |||
|
710 | * Mani chandra <mchandra-at-iitk.ac.in> | |||
|
711 | * Mark E. Smith | |||
|
712 | * Mark Voorhies <mark.voorhies-at-ucsf.edu> | |||
|
713 | * Martin Spacek <git-at-mspacek.mm.st> | |||
|
714 | * Michael Droettboom <mdroe-at-stsci.edu> | |||
|
715 | * MinRK <benjaminrk-at-gmail.com> | |||
|
716 | * muzuiget <muzuiget-at-gmail.com> | |||
|
717 | * Nick Tarleton <nick-at-quixey.com> | |||
|
718 | * Nicolas Rougier <Nicolas.rougier-at-inria.fr> | |||
|
719 | * Omar Andres Zapata Mesa <andresete.chaos-at-gmail.com> | |||
|
720 | * Paul Ivanov <pivanov314-at-gmail.com> | |||
|
721 | * Pauli Virtanen <pauli.virtanen-at-iki.fi> | |||
|
722 | * Prabhu Ramachandran | |||
|
723 | * Ramana <sramana9-at-gmail.com> | |||
|
724 | * Robert Kern <robert.kern-at-gmail.com> | |||
|
725 | * Sathesh Chandra <satheshchandra88-at-gmail.com> | |||
|
726 | * Satrajit Ghosh <satra-at-mit.edu> | |||
|
727 | * Sebastian Busch | |||
|
728 | * Skipper Seabold <jsseabold-at-gmail.com> | |||
|
729 | * Stefan van der Walt <bzr-at-mentat.za.net> | |||
|
730 | * Stephan Peijnik <debian-at-sp.or.at> | |||
|
731 | * Steven Bethard | |||
|
732 | * Thomas Kluyver <takowl-at-gmail.com> | |||
|
733 | * Thomas Spura <tomspur-at-fedoraproject.org> | |||
|
734 | * Tom Fetherston <tfetherston-at-aol.com> | |||
|
735 | * Tom MacWright | |||
|
736 | * tzanko | |||
|
737 | * vankayala sowjanya <hai.sowjanya-at-gmail.com> | |||
|
738 | * Vivian De Smedt <vds2212-at-VIVIAN> | |||
|
739 | * Ville M. Vainio <vivainio-at-gmail.com> | |||
|
740 | * Vishal Vatsa <vishal.vatsa-at-gmail.com> | |||
|
741 | * Vishnu S G <sgvishnu777-at-gmail.com> | |||
|
742 | * Walter Doerwald <walter-at-livinglogic.de> | |||
|
743 | ||||
|
744 | .. note:: | |||
|
745 | ||||
|
746 | This list was generated with the output of | |||
|
747 | ``git log dev-0.11 HEAD --format='* %aN <%aE>' | sed 's/@/\-at\-/' | sed 's/<>//' | sort -u`` | |||
|
748 | after some cleanup. If you should be on this list, please add yourself. | |||
|
749 | ||||
380 |
|
750 | |||
381 | * The machinery that adds functionality to the 'sh' profile for using IPython as your |
|
751 | .. _issues_list_011: | |
382 | system shell has not been updated to use the new APIs. As a result, only the aesthetic |
|
|||
383 | (prompt) changes are still implemented. We intend to fix this by 0.12. |
|
|||
384 |
|
752 | |||
385 | * The installation of scripts on Windows was broken without setuptools, so we now |
|
753 | Closed issues | |
386 | depend on setuptools on Windows. We hope to fix setuptools-less installation, |
|
754 | ============= | |
387 | and then remove the setuptools dependency. |
|
|||
388 |
|
755 | |||
389 | * Capitalised Exit and Quit have been dropped ways to exit IPython. The lowercase forms |
|
756 | .. include:: github-stats-011.txt | |
390 | of both work either as a bare name (``exit``) or a function call (``exit()``). |
|
|||
391 | You can assign these to other names using exec_lines in the config file. |
|
@@ -3,38 +3,38 b'' | |||||
3 |
|
3 | |||
4 | This directive allows pasting of entire interactive IPython sessions, prompts |
|
4 | This directive allows pasting of entire interactive IPython sessions, prompts | |
5 | and all, and their code will actually get re-executed at doc build time, with |
|
5 | and all, and their code will actually get re-executed at doc build time, with | |
6 | all prompts renumbered sequentially. |
|
6 | all prompts renumbered sequentially. It also allows you to input code as a pure | |
|
7 | python input by giving the argument python to the directive. The output looks | |||
|
8 | like an interactive ipython section. | |||
7 |
|
9 | |||
8 | To enable this directive, simply list it in your Sphinx ``conf.py`` file |
|
10 | To enable this directive, simply list it in your Sphinx ``conf.py`` file | |
9 | (making sure the directory where you placed it is visible to sphinx, as is |
|
11 | (making sure the directory where you placed it is visible to sphinx, as is | |
10 | needed for all Sphinx directives). |
|
12 | needed for all Sphinx directives). | |
11 |
|
13 | |||
12 | By default this directive assumes that your prompts are unchanged IPython ones, |
|
14 | By default this directive assumes that your prompts are unchanged IPython ones, | |
13 |
but this can be customized. |
|
15 | but this can be customized. The configurable options that can be placed in | |
14 | config file will configure this directive for the following input/output |
|
16 | conf.py are | |
15 | prompts ``Yade [1]:`` and ``-> [1]:``:: |
|
17 | ||
16 |
|
18 | ipython_savefig_dir: | ||
17 | import ipython_directive as id |
|
19 | The directory in which to save the figures. This is relative to the | |
18 | id.rgxin =re.compile(r'(?:In |Yade )\[(\d+)\]:\s?(.*)\s*') |
|
20 | Sphinx source directory. The default is `html_static_path`. | |
19 | id.rgxout=re.compile(r'(?:Out| -> )\[(\d+)\]:\s?(.*)\s*') |
|
21 | ipython_rgxin: | |
20 | id.fmtin ='Yade [%d]:' |
|
22 | The compiled regular expression to denote the start of IPython input | |
21 | id.fmtout=' -> [%d]:' |
|
23 | lines. The default is re.compile('In \[(\d+)\]:\s?(.*)\s*'). You | |
22 |
|
24 | shouldn't need to change this. | ||
23 | from IPython import Config |
|
25 | ipython_rgxout: | |
24 | id.CONFIG = Config( |
|
26 | The compiled regular expression to denote the start of IPython output | |
25 | prompt_in1="Yade [\#]:", |
|
27 | lines. The default is re.compile('Out\[(\d+)\]:\s?(.*)\s*'). You | |
26 | prompt_in2=" .\D..", |
|
28 | shouldn't need to change this. | |
27 | prompt_out=" -> [\#]:" |
|
29 | ipython_promptin: | |
28 | ) |
|
30 | The string to represent the IPython input prompt in the generated ReST. | |
29 | id.reconfig_shell() |
|
31 | The default is 'In [%d]:'. This expects that the line numbers are used | |
30 |
|
32 | in the prompt. | ||
31 | import ipython_console_highlighting as ich |
|
33 | ipython_promptout: | |
32 | ich.IPythonConsoleLexer.input_prompt= |
|
34 | ||
33 | re.compile("(Yade \[[0-9]+\]: )|( \.\.\.+:)") |
|
35 | The string to represent the IPython prompt in the generated ReST. The | |
34 | ich.IPythonConsoleLexer.output_prompt= |
|
36 | default is 'Out [%d]:'. This expects that the line numbers are used | |
35 | re.compile("(( -> )|(Out)\[[0-9]+\]: )|( \.\.\.+:)") |
|
37 | in the prompt. | |
36 | ich.IPythonConsoleLexer.continue_prompt=re.compile(" \.\.\.+:") |
|
|||
37 |
|
||||
38 |
|
38 | |||
39 | ToDo |
|
39 | ToDo | |
40 | ---- |
|
40 | ---- | |
@@ -42,8 +42,6 b' ToDo' | |||||
42 | - Turn the ad-hoc test() function into a real test suite. |
|
42 | - Turn the ad-hoc test() function into a real test suite. | |
43 | - Break up ipython-specific functionality from matplotlib stuff into better |
|
43 | - Break up ipython-specific functionality from matplotlib stuff into better | |
44 | separated code. |
|
44 | separated code. | |
45 | - Make sure %bookmarks used internally are removed on exit. |
|
|||
46 |
|
||||
47 |
|
45 | |||
48 | Authors |
|
46 | Authors | |
49 | ------- |
|
47 | ------- | |
@@ -51,6 +49,7 b' Authors' | |||||
51 | - John D Hunter: orignal author. |
|
49 | - John D Hunter: orignal author. | |
52 | - Fernando Perez: refactoring, documentation, cleanups, port to 0.11. |
|
50 | - Fernando Perez: refactoring, documentation, cleanups, port to 0.11. | |
53 | - VáclavŠmilauer <eudoxos-AT-arcig.cz>: Prompt generalizations. |
|
51 | - VáclavŠmilauer <eudoxos-AT-arcig.cz>: Prompt generalizations. | |
|
52 | - Skipper Seabold, refactoring, cleanups, pure python addition | |||
54 | """ |
|
53 | """ | |
55 |
|
54 | |||
56 | #----------------------------------------------------------------------------- |
|
55 | #----------------------------------------------------------------------------- | |
@@ -62,6 +61,7 b' import cStringIO' | |||||
62 | import os |
|
61 | import os | |
63 | import re |
|
62 | import re | |
64 | import sys |
|
63 | import sys | |
|
64 | import tempfile | |||
65 |
|
65 | |||
66 | # To keep compatibility with various python versions |
|
66 | # To keep compatibility with various python versions | |
67 | try: |
|
67 | try: | |
@@ -73,34 +73,26 b' except ImportError:' | |||||
73 | import matplotlib |
|
73 | import matplotlib | |
74 | import sphinx |
|
74 | import sphinx | |
75 | from docutils.parsers.rst import directives |
|
75 | from docutils.parsers.rst import directives | |
|
76 | from docutils import nodes | |||
|
77 | from sphinx.util.compat import Directive | |||
76 |
|
78 | |||
77 | matplotlib.use('Agg') |
|
79 | matplotlib.use('Agg') | |
78 |
|
80 | |||
79 | # Our own |
|
81 | # Our own | |
80 | from IPython import Config, InteractiveShell |
|
82 | from IPython import Config, InteractiveShell | |
81 |
from IPython. |
|
83 | from IPython.core.profiledir import ProfileDir | |
|
84 | from IPython.utils import io | |||
82 |
|
85 | |||
83 | #----------------------------------------------------------------------------- |
|
86 | #----------------------------------------------------------------------------- | |
84 | # Globals |
|
87 | # Globals | |
85 | #----------------------------------------------------------------------------- |
|
88 | #----------------------------------------------------------------------------- | |
86 |
|
89 | # for tokenizing blocks | ||
87 | sphinx_version = sphinx.__version__.split(".") |
|
|||
88 | # The split is necessary for sphinx beta versions where the string is |
|
|||
89 | # '6b1' |
|
|||
90 | sphinx_version = tuple([int(re.split('[a-z]', x)[0]) |
|
|||
91 | for x in sphinx_version[:2]]) |
|
|||
92 |
|
||||
93 | COMMENT, INPUT, OUTPUT = range(3) |
|
90 | COMMENT, INPUT, OUTPUT = range(3) | |
94 | CONFIG = Config() |
|
|||
95 | rgxin = re.compile('In \[(\d+)\]:\s?(.*)\s*') |
|
|||
96 | rgxout = re.compile('Out\[(\d+)\]:\s?(.*)\s*') |
|
|||
97 | fmtin = 'In [%d]:' |
|
|||
98 | fmtout = 'Out[%d]:' |
|
|||
99 |
|
91 | |||
100 | #----------------------------------------------------------------------------- |
|
92 | #----------------------------------------------------------------------------- | |
101 | # Functions and class declarations |
|
93 | # Functions and class declarations | |
102 | #----------------------------------------------------------------------------- |
|
94 | #----------------------------------------------------------------------------- | |
103 | def block_parser(part): |
|
95 | def block_parser(part, rgxin, rgxout, fmtin, fmtout): | |
104 | """ |
|
96 | """ | |
105 | part is a string of ipython text, comprised of at most one |
|
97 | part is a string of ipython text, comprised of at most one | |
106 | input, one ouput, comments, and blank lines. The block parser |
|
98 | input, one ouput, comments, and blank lines. The block parser | |
@@ -194,20 +186,13 b' def block_parser(part):' | |||||
194 |
|
186 | |||
195 | return block |
|
187 | return block | |
196 |
|
188 | |||
197 |
|
||||
198 | class EmbeddedSphinxShell(object): |
|
189 | class EmbeddedSphinxShell(object): | |
199 | """An embedded IPython instance to run inside Sphinx""" |
|
190 | """An embedded IPython instance to run inside Sphinx""" | |
200 |
|
191 | |||
201 | def __init__(self): |
|
192 | def __init__(self): | |
202 |
|
193 | |||
203 | self.cout = cStringIO.StringIO() |
|
194 | self.cout = cStringIO.StringIO() | |
204 | Term.cout = self.cout |
|
|||
205 | Term.cerr = self.cout |
|
|||
206 |
|
195 | |||
207 | # For debugging, so we can see normal output, use this: |
|
|||
208 | # from IPython.utils.io import Tee |
|
|||
209 | #Term.cout = Tee(self.cout, channel='stdout') # dbg |
|
|||
210 | #Term.cerr = Tee(self.cout, channel='stderr') # dbg |
|
|||
211 |
|
196 | |||
212 | # Create config object for IPython |
|
197 | # Create config object for IPython | |
213 | config = Config() |
|
198 | config = Config() | |
@@ -219,14 +204,28 b' class EmbeddedSphinxShell(object):' | |||||
219 | config.InteractiveShell.autoindent = False |
|
204 | config.InteractiveShell.autoindent = False | |
220 | config.InteractiveShell.colors = 'NoColor' |
|
205 | config.InteractiveShell.colors = 'NoColor' | |
221 |
|
206 | |||
|
207 | # create a profile so instance history isn't saved | |||
|
208 | tmp_profile_dir = tempfile.mkdtemp(prefix='profile_') | |||
|
209 | profname = 'auto_profile_sphinx_build' | |||
|
210 | pdir = os.path.join(tmp_profile_dir,profname) | |||
|
211 | profile = ProfileDir.create_profile_dir(pdir) | |||
|
212 | ||||
222 | # Create and initialize ipython, but don't start its mainloop |
|
213 | # Create and initialize ipython, but don't start its mainloop | |
223 | IP = InteractiveShell.instance(config=config) |
|
214 | IP = InteractiveShell.instance(config=config, profile_dir=profile) | |
|
215 | # io.stdout redirect must be done *after* instantiating InteractiveShell | |||
|
216 | io.stdout = self.cout | |||
|
217 | io.stderr = self.cout | |||
|
218 | ||||
|
219 | # For debugging, so we can see normal output, use this: | |||
|
220 | #from IPython.utils.io import Tee | |||
|
221 | #io.stdout = Tee(self.cout, channel='stdout') # dbg | |||
|
222 | #io.stderr = Tee(self.cout, channel='stderr') # dbg | |||
224 |
|
223 | |||
225 | # Store a few parts of IPython we'll need. |
|
224 | # Store a few parts of IPython we'll need. | |
226 | self.IP = IP |
|
225 | self.IP = IP | |
227 | self.user_ns = self.IP.user_ns |
|
226 | self.user_ns = self.IP.user_ns | |
228 | self.user_global_ns = self.IP.user_global_ns |
|
227 | self.user_global_ns = self.IP.user_global_ns | |
229 |
|
228 | |||
230 | self.input = '' |
|
229 | self.input = '' | |
231 | self.output = '' |
|
230 | self.output = '' | |
232 |
|
231 | |||
@@ -238,27 +237,61 b' class EmbeddedSphinxShell(object):' | |||||
238 | # pyplot as plt so we can make a call to the plt.gcf().savefig |
|
237 | # pyplot as plt so we can make a call to the plt.gcf().savefig | |
239 | self._pyplot_imported = False |
|
238 | self._pyplot_imported = False | |
240 |
|
239 | |||
241 | # we need bookmark the current dir first so we can save |
|
240 | def clear_cout(self): | |
242 | # relative to it |
|
|||
243 | self.process_input_line('bookmark ipy_basedir') |
|
|||
244 | self.cout.seek(0) |
|
241 | self.cout.seek(0) | |
245 | self.cout.truncate(0) |
|
242 | self.cout.truncate(0) | |
246 |
|
243 | |||
247 | def process_input_line(self, line): |
|
244 | def process_input_line(self, line, store_history=True): | |
248 | """process the input, capturing stdout""" |
|
245 | """process the input, capturing stdout""" | |
249 | #print "input='%s'"%self.input |
|
246 | #print "input='%s'"%self.input | |
250 | stdout = sys.stdout |
|
247 | stdout = sys.stdout | |
|
248 | splitter = self.IP.input_splitter | |||
251 | try: |
|
249 | try: | |
252 | sys.stdout = self.cout |
|
250 | sys.stdout = self.cout | |
253 |
s |
|
251 | splitter.push(line) | |
|
252 | more = splitter.push_accepts_more() | |||
|
253 | if not more: | |||
|
254 | source_raw = splitter.source_raw_reset()[1] | |||
|
255 | self.IP.run_cell(source_raw, store_history=store_history) | |||
254 | finally: |
|
256 | finally: | |
255 | sys.stdout = stdout |
|
257 | sys.stdout = stdout | |
256 |
|
258 | |||
|
259 | def process_image(self, decorator): | |||
|
260 | """ | |||
|
261 | # build out an image directive like | |||
|
262 | # .. image:: somefile.png | |||
|
263 | # :width 4in | |||
|
264 | # | |||
|
265 | # from an input like | |||
|
266 | # savefig somefile.png width=4in | |||
|
267 | """ | |||
|
268 | savefig_dir = self.savefig_dir | |||
|
269 | source_dir = self.source_dir | |||
|
270 | saveargs = decorator.split(' ') | |||
|
271 | filename = saveargs[1] | |||
|
272 | # insert relative path to image file in source | |||
|
273 | outfile = os.path.relpath(os.path.join(savefig_dir,filename), | |||
|
274 | source_dir) | |||
|
275 | ||||
|
276 | imagerows = ['.. image:: %s'%outfile] | |||
|
277 | ||||
|
278 | for kwarg in saveargs[2:]: | |||
|
279 | arg, val = kwarg.split('=') | |||
|
280 | arg = arg.strip() | |||
|
281 | val = val.strip() | |||
|
282 | imagerows.append(' :%s: %s'%(arg, val)) | |||
|
283 | ||||
|
284 | image_file = os.path.basename(outfile) # only return file name | |||
|
285 | image_directive = '\n'.join(imagerows) | |||
|
286 | return image_file, image_directive | |||
|
287 | ||||
|
288 | ||||
257 | # Callbacks for each type of token |
|
289 | # Callbacks for each type of token | |
258 | def process_input(self, data, input_prompt, lineno): |
|
290 | def process_input(self, data, input_prompt, lineno): | |
259 | """Process data block for INPUT token.""" |
|
291 | """Process data block for INPUT token.""" | |
260 | decorator, input, rest = data |
|
292 | decorator, input, rest = data | |
261 | image_file = None |
|
293 | image_file = None | |
|
294 | image_directive = None | |||
262 | #print 'INPUT:', data # dbg |
|
295 | #print 'INPUT:', data # dbg | |
263 | is_verbatim = decorator=='@verbatim' or self.is_verbatim |
|
296 | is_verbatim = decorator=='@verbatim' or self.is_verbatim | |
264 | is_doctest = decorator=='@doctest' or self.is_doctest |
|
297 | is_doctest = decorator=='@doctest' or self.is_doctest | |
@@ -272,48 +305,31 b' class EmbeddedSphinxShell(object):' | |||||
272 | Nc = len(continuation) |
|
305 | Nc = len(continuation) | |
273 |
|
306 | |||
274 | if is_savefig: |
|
307 | if is_savefig: | |
275 | saveargs = decorator.split(' ') |
|
308 | image_file, image_directive = self.process_image(decorator) | |
276 | filename = saveargs[1] |
|
|||
277 | outfile = os.path.join('_static/%s'%filename) |
|
|||
278 | # build out an image directive like |
|
|||
279 | # .. image:: somefile.png |
|
|||
280 | # :width 4in |
|
|||
281 | # |
|
|||
282 | # from an input like |
|
|||
283 | # savefig somefile.png width=4in |
|
|||
284 | imagerows = ['.. image:: %s'%outfile] |
|
|||
285 |
|
||||
286 | for kwarg in saveargs[2:]: |
|
|||
287 | arg, val = kwarg.split('=') |
|
|||
288 | arg = arg.strip() |
|
|||
289 | val = val.strip() |
|
|||
290 | imagerows.append(' :%s: %s'%(arg, val)) |
|
|||
291 |
|
||||
292 | image_file = outfile |
|
|||
293 | image_directive = '\n'.join(imagerows) |
|
|||
294 |
|
||||
295 | # TODO: can we get "rest" from ipython |
|
|||
296 | #self.process_input_line('\n'.join(input_lines)) |
|
|||
297 |
|
309 | |||
298 | ret = [] |
|
310 | ret = [] | |
299 | is_semicolon = False |
|
311 | is_semicolon = False | |
|
312 | store_history = True | |||
300 |
|
313 | |||
301 | for i, line in enumerate(input_lines): |
|
314 | for i, line in enumerate(input_lines): | |
302 | if line.endswith(';'): |
|
315 | if line.endswith(';'): | |
303 | is_semicolon = True |
|
316 | is_semicolon = True | |
|
317 | if is_semicolon or is_suppress: | |||
|
318 | store_history = False | |||
304 |
|
319 | |||
305 | if i==0: |
|
320 | if i==0: | |
306 | # process the first input line |
|
321 | # process the first input line | |
307 | if is_verbatim: |
|
322 | if is_verbatim: | |
308 | self.process_input_line('') |
|
323 | self.process_input_line('') | |
|
324 | self.IP.execution_count += 1 # increment it anyway | |||
309 | else: |
|
325 | else: | |
310 | # only submit the line in non-verbatim mode |
|
326 | # only submit the line in non-verbatim mode | |
311 | self.process_input_line(line) |
|
327 | self.process_input_line(line, store_history=store_history) | |
312 | formatted_line = '%s %s'%(input_prompt, line) |
|
328 | formatted_line = '%s %s'%(input_prompt, line) | |
313 | else: |
|
329 | else: | |
314 | # process a continuation line |
|
330 | # process a continuation line | |
315 | if not is_verbatim: |
|
331 | if not is_verbatim: | |
316 | self.process_input_line(line) |
|
332 | self.process_input_line(line, store_history=store_history) | |
317 |
|
333 | |||
318 | formatted_line = '%s %s'%(continuation, line) |
|
334 | formatted_line = '%s %s'%(continuation, line) | |
319 |
|
335 | |||
@@ -334,7 +350,8 b' class EmbeddedSphinxShell(object):' | |||||
334 | ret.append(output) |
|
350 | ret.append(output) | |
335 |
|
351 | |||
336 | self.cout.truncate(0) |
|
352 | self.cout.truncate(0) | |
337 | return ret, input_lines, output, is_doctest, image_file |
|
353 | return (ret, input_lines, output, is_doctest, image_file, | |
|
354 | image_directive) | |||
338 | #print 'OUTPUT', output # dbg |
|
355 | #print 'OUTPUT', output # dbg | |
339 |
|
356 | |||
340 | def process_output(self, data, output_prompt, |
|
357 | def process_output(self, data, output_prompt, | |
@@ -345,16 +362,19 b' class EmbeddedSphinxShell(object):' | |||||
345 | found = output |
|
362 | found = output | |
346 | if found is not None: |
|
363 | if found is not None: | |
347 | found = found.strip() |
|
364 | found = found.strip() | |
348 |
|
365 | |||
349 | # XXX - fperez: in 0.11, 'output' never comes with the prompt |
|
366 | # XXX - fperez: in 0.11, 'output' never comes with the prompt | |
350 | # in it, just the actual output text. So I think all this code |
|
367 | # in it, just the actual output text. So I think all this code | |
351 | # can be nuked... |
|
368 | # can be nuked... | |
352 | ## ind = found.find(output_prompt) |
|
369 | ||
353 | ## if ind<0: |
|
370 | # the above comment does not appear to be accurate... (minrk) | |
354 | ## e='output prompt="%s" does not match out line=%s' % \ |
|
371 | ||
355 |
|
|
372 | ind = found.find(output_prompt) | |
356 | ## raise RuntimeError(e) |
|
373 | if ind<0: | |
357 | ## found = found[len(output_prompt):].strip() |
|
374 | e='output prompt="%s" does not match out line=%s' % \ | |
|
375 | (output_prompt, found) | |||
|
376 | raise RuntimeError(e) | |||
|
377 | found = found[len(output_prompt):].strip() | |||
358 |
|
378 | |||
359 | if found!=submitted: |
|
379 | if found!=submitted: | |
360 | e = ('doctest failure for input_lines="%s" with ' |
|
380 | e = ('doctest failure for input_lines="%s" with ' | |
@@ -364,36 +384,45 b' class EmbeddedSphinxShell(object):' | |||||
364 | #print 'doctest PASSED for input_lines="%s" with found_output="%s" and submitted output="%s"'%(input_lines, found, submitted) |
|
384 | #print 'doctest PASSED for input_lines="%s" with found_output="%s" and submitted output="%s"'%(input_lines, found, submitted) | |
365 |
|
385 | |||
366 | def process_comment(self, data): |
|
386 | def process_comment(self, data): | |
367 | """Process data block for COMMENT token.""" |
|
387 | """Process data fPblock for COMMENT token.""" | |
368 | if not self.is_suppress: |
|
388 | if not self.is_suppress: | |
369 | return [data] |
|
389 | return [data] | |
370 |
|
390 | |||
|
391 | def save_image(self, image_file): | |||
|
392 | """ | |||
|
393 | Saves the image file to disk. | |||
|
394 | """ | |||
|
395 | self.ensure_pyplot() | |||
|
396 | command = 'plt.gcf().savefig("%s")'%image_file | |||
|
397 | #print 'SAVEFIG', command # dbg | |||
|
398 | self.process_input_line('bookmark ipy_thisdir', store_history=False) | |||
|
399 | self.process_input_line('cd -b ipy_savedir', store_history=False) | |||
|
400 | self.process_input_line(command, store_history=False) | |||
|
401 | self.process_input_line('cd -b ipy_thisdir', store_history=False) | |||
|
402 | self.process_input_line('bookmark -d ipy_thisdir', store_history=False) | |||
|
403 | self.clear_cout() | |||
|
404 | ||||
|
405 | ||||
371 | def process_block(self, block): |
|
406 | def process_block(self, block): | |
372 | """ |
|
407 | """ | |
373 | process block from the block_parser and return a list of processed lines |
|
408 | process block from the block_parser and return a list of processed lines | |
374 | """ |
|
409 | """ | |
375 |
|
||||
376 | ret = [] |
|
410 | ret = [] | |
377 | output = None |
|
411 | output = None | |
378 | input_lines = None |
|
412 | input_lines = None | |
|
413 | lineno = self.IP.execution_count | |||
379 |
|
414 | |||
380 | m = rgxin.match(str(self.IP.outputcache.prompt1).strip()) |
|
415 | input_prompt = self.promptin%lineno | |
381 | lineno = int(m.group(1)) |
|
416 | output_prompt = self.promptout%lineno | |
382 |
|
||||
383 | input_prompt = fmtin%lineno |
|
|||
384 | output_prompt = fmtout%lineno |
|
|||
385 | image_file = None |
|
417 | image_file = None | |
386 | image_directive = None |
|
418 | image_directive = None | |
387 | # XXX - This needs a second refactor. There's too much state being |
|
419 | ||
388 | # held globally, which makes for a very awkward interface and large, |
|
|||
389 | # hard to test functions. I've already broken this up at least into |
|
|||
390 | # three separate processors to isolate the logic better, but this only |
|
|||
391 | # serves to highlight the coupling. Next we need to clean it up... |
|
|||
392 | for token, data in block: |
|
420 | for token, data in block: | |
393 | if token==COMMENT: |
|
421 | if token==COMMENT: | |
394 | out_data = self.process_comment(data) |
|
422 | out_data = self.process_comment(data) | |
395 | elif token==INPUT: |
|
423 | elif token==INPUT: | |
396 |
out_data, input_lines, output, is_doctest, image_file |
|
424 | (out_data, input_lines, output, is_doctest, image_file, | |
|
425 | image_directive) = \ | |||
397 | self.process_input(data, input_prompt, lineno) |
|
426 | self.process_input(data, input_prompt, lineno) | |
398 | elif token==OUTPUT: |
|
427 | elif token==OUTPUT: | |
399 | out_data = \ |
|
428 | out_data = \ | |
@@ -403,88 +432,235 b' class EmbeddedSphinxShell(object):' | |||||
403 | if out_data: |
|
432 | if out_data: | |
404 | ret.extend(out_data) |
|
433 | ret.extend(out_data) | |
405 |
|
434 | |||
|
435 | # save the image files | |||
406 | if image_file is not None: |
|
436 | if image_file is not None: | |
407 |
self. |
|
437 | self.save_image(image_file) | |
408 | command = 'plt.gcf().savefig("%s")'%image_file |
|
438 | ||
409 | print 'SAVEFIG', command # dbg |
|
|||
410 | self.process_input_line('bookmark ipy_thisdir') |
|
|||
411 | self.process_input_line('cd -b ipy_basedir') |
|
|||
412 | self.process_input_line(command) |
|
|||
413 | self.process_input_line('cd -b ipy_thisdir') |
|
|||
414 | self.cout.seek(0) |
|
|||
415 | self.cout.truncate(0) |
|
|||
416 | return ret, image_directive |
|
439 | return ret, image_directive | |
417 |
|
440 | |||
418 | def ensure_pyplot(self): |
|
441 | def ensure_pyplot(self): | |
419 | if self._pyplot_imported: |
|
442 | if self._pyplot_imported: | |
420 | return |
|
443 | return | |
421 |
self.process_input_line('import matplotlib.pyplot as plt' |
|
444 | self.process_input_line('import matplotlib.pyplot as plt', | |
|
445 | store_history=False) | |||
422 |
|
446 | |||
423 | # A global instance used below. XXX: not sure why this can't be created inside |
|
447 | def process_pure_python(self, content): | |
424 | # ipython_directive itself. |
|
448 | """ | |
425 | shell = EmbeddedSphinxShell() |
|
449 | content is a list of strings. it is unedited directive conent | |
|
450 | ||||
|
451 | This runs it line by line in the InteractiveShell, prepends | |||
|
452 | prompts as needed capturing stderr and stdout, then returns | |||
|
453 | the content as a list as if it were ipython code | |||
|
454 | """ | |||
|
455 | output = [] | |||
|
456 | savefig = False # keep up with this to clear figure | |||
|
457 | multiline = False # to handle line continuation | |||
|
458 | fmtin = self.promptin | |||
|
459 | ||||
|
460 | for lineno, line in enumerate(content): | |||
|
461 | ||||
|
462 | line_stripped = line.strip() | |||
|
463 | ||||
|
464 | if not len(line): | |||
|
465 | output.append(line) # preserve empty lines in output | |||
|
466 | continue | |||
|
467 | ||||
|
468 | # handle decorators | |||
|
469 | if line_stripped.startswith('@'): | |||
|
470 | output.extend([line]) | |||
|
471 | if 'savefig' in line: | |||
|
472 | savefig = True # and need to clear figure | |||
|
473 | continue | |||
|
474 | ||||
|
475 | # handle comments | |||
|
476 | if line_stripped.startswith('#'): | |||
|
477 | output.extend([line]) | |||
|
478 | continue | |||
|
479 | ||||
|
480 | # deal with multilines | |||
|
481 | if not multiline: # not currently on a multiline | |||
|
482 | ||||
|
483 | if line_stripped.endswith('\\'): # now we are | |||
|
484 | multiline = True | |||
|
485 | cont_len = len(str(lineno)) + 2 | |||
|
486 | line_to_process = line.strip('\\') | |||
|
487 | output.extend([u"%s %s" % (fmtin%lineno,line)]) | |||
|
488 | continue | |||
|
489 | else: # no we're still not | |||
|
490 | line_to_process = line.strip('\\') | |||
|
491 | else: # we are currently on a multiline | |||
|
492 | line_to_process += line.strip('\\') | |||
|
493 | if line_stripped.endswith('\\'): # and we still are | |||
|
494 | continuation = '.' * cont_len | |||
|
495 | output.extend([(u' %s: '+line_stripped) % continuation]) | |||
|
496 | continue | |||
|
497 | # else go ahead and run this multiline then carry on | |||
|
498 | ||||
|
499 | # get output of line | |||
|
500 | self.process_input_line(unicode(line_to_process.strip()), | |||
|
501 | store_history=False) | |||
|
502 | out_line = self.cout.getvalue() | |||
|
503 | self.clear_cout() | |||
|
504 | ||||
|
505 | # clear current figure if plotted | |||
|
506 | if savefig: | |||
|
507 | self.ensure_pyplot() | |||
|
508 | self.process_input_line('plt.clf()', store_history=False) | |||
|
509 | self.clear_cout() | |||
|
510 | savefig = False | |||
|
511 | ||||
|
512 | # line numbers don't actually matter, they're replaced later | |||
|
513 | if not multiline: | |||
|
514 | in_line = u"%s %s" % (fmtin%lineno,line) | |||
|
515 | ||||
|
516 | output.extend([in_line]) | |||
|
517 | else: | |||
|
518 | output.extend([(u' %s: '+line_stripped) % continuation]) | |||
|
519 | multiline = False | |||
|
520 | if len(out_line): | |||
|
521 | output.extend([out_line]) | |||
|
522 | output.extend([u'']) | |||
|
523 | ||||
|
524 | return output | |||
|
525 | ||||
|
526 | class IpythonDirective(Directive): | |||
|
527 | ||||
|
528 | has_content = True | |||
|
529 | required_arguments = 0 | |||
|
530 | optional_arguments = 4 # python, suppress, verbatim, doctest | |||
|
531 | final_argumuent_whitespace = True | |||
|
532 | option_spec = { 'python': directives.unchanged, | |||
|
533 | 'suppress' : directives.flag, | |||
|
534 | 'verbatim' : directives.flag, | |||
|
535 | 'doctest' : directives.flag, | |||
|
536 | } | |||
426 |
|
537 | |||
427 | def reconfig_shell(): |
|
|||
428 | """Called after setting module-level variables to re-instantiate |
|
|||
429 | with the set values (since shell is instantiated first at import-time |
|
|||
430 | when module variables have default values)""" |
|
|||
431 | global shell |
|
|||
432 | shell = EmbeddedSphinxShell() |
|
538 | shell = EmbeddedSphinxShell() | |
433 |
|
539 | |||
|
540 | def get_config_options(self): | |||
|
541 | # contains sphinx configuration variables | |||
|
542 | config = self.state.document.settings.env.config | |||
|
543 | ||||
|
544 | # get config variables to set figure output directory | |||
|
545 | confdir = self.state.document.settings.env.app.confdir | |||
|
546 | savefig_dir = config.ipython_savefig_dir | |||
|
547 | source_dir = os.path.dirname(self.state.document.current_source) | |||
|
548 | if savefig_dir is None: | |||
|
549 | savefig_dir = config.html_static_path | |||
|
550 | if isinstance(savefig_dir, list): | |||
|
551 | savefig_dir = savefig_dir[0] # safe to assume only one path? | |||
|
552 | savefig_dir = os.path.join(confdir, savefig_dir) | |||
|
553 | ||||
|
554 | # get regex and prompt stuff | |||
|
555 | rgxin = config.ipython_rgxin | |||
|
556 | rgxout = config.ipython_rgxout | |||
|
557 | promptin = config.ipython_promptin | |||
|
558 | promptout = config.ipython_promptout | |||
|
559 | ||||
|
560 | return savefig_dir, source_dir, rgxin, rgxout, promptin, promptout | |||
|
561 | ||||
|
562 | def setup(self): | |||
|
563 | # get config values | |||
|
564 | (savefig_dir, source_dir, rgxin, | |||
|
565 | rgxout, promptin, promptout) = self.get_config_options() | |||
|
566 | ||||
|
567 | # and attach to shell so we don't have to pass them around | |||
|
568 | self.shell.rgxin = rgxin | |||
|
569 | self.shell.rgxout = rgxout | |||
|
570 | self.shell.promptin = promptin | |||
|
571 | self.shell.promptout = promptout | |||
|
572 | self.shell.savefig_dir = savefig_dir | |||
|
573 | self.shell.source_dir = source_dir | |||
434 |
|
574 | |||
435 | def ipython_directive(name, arguments, options, content, lineno, |
|
575 | # setup bookmark for saving figures directory | |
436 | content_offset, block_text, state, state_machine, |
|
|||
437 | ): |
|
|||
438 |
|
576 | |||
439 | debug = ipython_directive.DEBUG |
|
577 | self.shell.process_input_line('bookmark ipy_savedir %s'%savefig_dir, | |
440 | shell.is_suppress = options.has_key('suppress') |
|
578 | store_history=False) | |
441 | shell.is_doctest = options.has_key('doctest') |
|
579 | self.shell.clear_cout() | |
442 | shell.is_verbatim = options.has_key('verbatim') |
|
|||
443 |
|
580 | |||
444 | #print 'ipy', shell.is_suppress, options |
|
581 | return rgxin, rgxout, promptin, promptout | |
445 | parts = '\n'.join(content).split('\n\n') |
|
|||
446 | lines = ['.. sourcecode:: ipython', ''] |
|
|||
447 |
|
582 | |||
448 | figures = [] |
|
|||
449 | for part in parts: |
|
|||
450 | block = block_parser(part) |
|
|||
451 |
|
583 | |||
452 | if len(block): |
|
584 | def teardown(self): | |
453 | rows, figure = shell.process_block(block) |
|
585 | # delete last bookmark | |
454 | for row in rows: |
|
586 | self.shell.process_input_line('bookmark -d ipy_savedir', | |
455 | lines.extend([' %s'%line for line in row.split('\n')]) |
|
587 | store_history=False) | |
|
588 | self.shell.clear_cout() | |||
456 |
|
589 | |||
457 | if figure is not None: |
|
590 | def run(self): | |
458 | figures.append(figure) |
|
591 | debug = False | |
459 |
|
592 | |||
460 | for figure in figures: |
|
593 | #TODO, any reason block_parser can't be a method of embeddable shell | |
461 | lines.append('') |
|
594 | # then we wouldn't have to carry these around | |
462 | lines.extend(figure.split('\n')) |
|
595 | rgxin, rgxout, promptin, promptout = self.setup() | |
463 | lines.append('') |
|
|||
464 |
|
596 | |||
465 | #print lines |
|
597 | options = self.options | |
466 | if len(lines)>2: |
|
598 | self.shell.is_suppress = 'suppress' in options | |
467 | if debug: |
|
599 | self.shell.is_doctest = 'doctest' in options | |
468 | print '\n'.join(lines) |
|
600 | self.shell.is_verbatim = 'verbatim' in options | |
469 | else: |
|
|||
470 | #print 'INSERTING %d lines'%len(lines) |
|
|||
471 | state_machine.insert_input( |
|
|||
472 | lines, state_machine.input_lines.source(0)) |
|
|||
473 |
|
601 | |||
474 | return [] |
|
|||
475 |
|
602 | |||
476 | ipython_directive.DEBUG = False |
|
603 | # handle pure python code | |
477 | ipython_directive.DEBUG = True # dbg |
|
604 | if 'python' in self.arguments: | |
|
605 | content = self.content | |||
|
606 | self.content = self.shell.process_pure_python(content) | |||
|
607 | ||||
|
608 | parts = '\n'.join(self.content).split('\n\n') | |||
|
609 | ||||
|
610 | lines = ['.. code-block:: ipython',''] | |||
|
611 | figures = [] | |||
|
612 | ||||
|
613 | for part in parts: | |||
|
614 | ||||
|
615 | block = block_parser(part, rgxin, rgxout, promptin, promptout) | |||
|
616 | ||||
|
617 | if len(block): | |||
|
618 | rows, figure = self.shell.process_block(block) | |||
|
619 | for row in rows: | |||
|
620 | lines.extend([' %s'%line for line in row.split('\n')]) | |||
|
621 | ||||
|
622 | if figure is not None: | |||
|
623 | figures.append(figure) | |||
|
624 | ||||
|
625 | #text = '\n'.join(lines) | |||
|
626 | #figs = '\n'.join(figures) | |||
|
627 | ||||
|
628 | for figure in figures: | |||
|
629 | lines.append('') | |||
|
630 | lines.extend(figure.split('\n')) | |||
|
631 | lines.append('') | |||
|
632 | ||||
|
633 | #print lines | |||
|
634 | if len(lines)>2: | |||
|
635 | if debug: | |||
|
636 | print '\n'.join(lines) | |||
|
637 | else: #NOTE: this raises some errors, what's it for? | |||
|
638 | #print 'INSERTING %d lines'%len(lines) | |||
|
639 | self.state_machine.insert_input( | |||
|
640 | lines, self.state_machine.input_lines.source(0)) | |||
|
641 | ||||
|
642 | text = '\n'.join(lines) | |||
|
643 | txtnode = nodes.literal_block(text, text) | |||
|
644 | txtnode['language'] = 'ipython' | |||
|
645 | #imgnode = nodes.image(figs) | |||
|
646 | ||||
|
647 | # cleanup | |||
|
648 | self.teardown() | |||
|
649 | ||||
|
650 | return []#, imgnode] | |||
478 |
|
651 | |||
479 | # Enable as a proper Sphinx directive |
|
652 | # Enable as a proper Sphinx directive | |
480 | def setup(app): |
|
653 | def setup(app): | |
481 | setup.app = app |
|
654 | setup.app = app | |
482 | options = {'suppress': directives.flag, |
|
|||
483 | 'doctest': directives.flag, |
|
|||
484 | 'verbatim': directives.flag, |
|
|||
485 | } |
|
|||
486 |
|
655 | |||
487 |
app.add_directive('ipython', |
|
656 | app.add_directive('ipython', IpythonDirective) | |
|
657 | app.add_config_value('ipython_savefig_dir', None, True) | |||
|
658 | app.add_config_value('ipython_rgxin', | |||
|
659 | re.compile('In \[(\d+)\]:\s?(.*)\s*'), True) | |||
|
660 | app.add_config_value('ipython_rgxout', | |||
|
661 | re.compile('Out\[(\d+)\]:\s?(.*)\s*'), True) | |||
|
662 | app.add_config_value('ipython_promptin', 'In [%d]:', True) | |||
|
663 | app.add_config_value('ipython_promptout', 'Out[%d]:', True) | |||
488 |
|
664 | |||
489 |
|
665 | |||
490 | # Simple smoke test, needs to be converted to a proper automatic test. |
|
666 | # Simple smoke test, needs to be converted to a proper automatic test. | |
@@ -507,7 +683,7 b" In [3]: im = imread('stinkbug.png')" | |||||
507 | @savefig mystinkbug.png width=4in |
|
683 | @savefig mystinkbug.png width=4in | |
508 | In [4]: imshow(im) |
|
684 | In [4]: imshow(im) | |
509 | Out[4]: <matplotlib.image.AxesImage object at 0x39ea850> |
|
685 | Out[4]: <matplotlib.image.AxesImage object at 0x39ea850> | |
510 |
|
686 | |||
511 | """, |
|
687 | """, | |
512 | r""" |
|
688 | r""" | |
513 |
|
689 | |||
@@ -542,7 +718,7 b' In [133]: import numpy.random' | |||||
542 | In [134]: numpy.random.seed(2358) |
|
718 | In [134]: numpy.random.seed(2358) | |
543 |
|
719 | |||
544 | @doctest |
|
720 | @doctest | |
545 | In [135]: np.random.rand(10,2) |
|
721 | In [135]: numpy.random.rand(10,2) | |
546 | Out[135]: |
|
722 | Out[135]: | |
547 | array([[ 0.64524308, 0.59943846], |
|
723 | array([[ 0.64524308, 0.59943846], | |
548 | [ 0.47102322, 0.8715456 ], |
|
724 | [ 0.47102322, 0.8715456 ], | |
@@ -615,6 +791,8 b' In [153]: grid(True)' | |||||
615 |
|
791 | |||
616 | """, |
|
792 | """, | |
617 | ] |
|
793 | ] | |
|
794 | # skip local-file depending first example: | |||
|
795 | examples = examples[1:] | |||
618 |
|
796 | |||
619 | #ipython_directive.DEBUG = True # dbg |
|
797 | #ipython_directive.DEBUG = True # dbg | |
620 | #options = dict(suppress=True) # dbg |
|
798 | #options = dict(suppress=True) # dbg |
@@ -7,7 +7,7 b' Under Windows, the command sdist is not supported, since IPython' | |||||
7 | requires utilities which are not available under Windows.""" |
|
7 | requires utilities which are not available under Windows.""" | |
8 |
|
8 | |||
9 | #----------------------------------------------------------------------------- |
|
9 | #----------------------------------------------------------------------------- | |
10 |
# Copyright (c) 2008-201 |
|
10 | # Copyright (c) 2008-2011, IPython Development Team. | |
11 | # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> |
|
11 | # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> | |
12 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> |
|
12 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> | |
13 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> |
|
13 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> |
@@ -206,6 +206,9 b' def find_data_files():' | |||||
206 |
|
206 | |||
207 | # Simple file lists can be made by hand |
|
207 | # Simple file lists can be made by hand | |
208 | manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz'))) |
|
208 | manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz'))) | |
|
209 | if not manpages: | |||
|
210 | # When running from a source tree, the manpages aren't gzipped | |||
|
211 | manpages = filter(isfile, glob(pjoin('docs','man','*.1'))) | |||
209 | igridhelpfiles = filter(isfile, |
|
212 | igridhelpfiles = filter(isfile, | |
210 | glob(pjoin('IPython','extensions','igrid_help.*'))) |
|
213 | glob(pjoin('IPython','extensions','igrid_help.*'))) | |
211 |
|
214 |
@@ -1,17 +1,47 b'' | |||||
|
1 | #!/usr/bin/env python | |||
|
2 | """Simple tools to query github.com and gather stats about issues. | |||
|
3 | """ | |||
|
4 | #----------------------------------------------------------------------------- | |||
|
5 | # Imports | |||
|
6 | #----------------------------------------------------------------------------- | |||
|
7 | ||||
|
8 | from __future__ import print_function | |||
|
9 | ||||
1 | import json |
|
10 | import json | |
2 | from datetime import datetime, timedelta |
|
|||
3 | import sys |
|
11 | import sys | |
|
12 | ||||
|
13 | from datetime import datetime, timedelta | |||
4 | from urllib import urlopen |
|
14 | from urllib import urlopen | |
5 |
|
15 | |||
|
16 | #----------------------------------------------------------------------------- | |||
|
17 | # Functions | |||
|
18 | #----------------------------------------------------------------------------- | |||
|
19 | ||||
6 | def get_issues(project="ipython/ipython/", state="open"): |
|
20 | def get_issues(project="ipython/ipython/", state="open"): | |
7 | """Get a list of the issues from the Github API.""" |
|
21 | """Get a list of the issues from the Github API.""" | |
8 |
f = urlopen("http://github.com/api/v2/json/issues/list/%s%s" % (project, |
|
22 | f = urlopen("http://github.com/api/v2/json/issues/list/%s%s" % (project, | |
|
23 | state)) | |||
9 | return json.load(f)['issues'] |
|
24 | return json.load(f)['issues'] | |
10 |
|
25 | |||
|
26 | ||||
11 | def _parse_datetime(s): |
|
27 | def _parse_datetime(s): | |
12 | """Parse dates in the format returned by the Github API.""" |
|
28 | """Parse dates in the format returned by the Github API.""" | |
13 | return datetime.strptime(s.rpartition(" ")[0], "%Y/%m/%d %H:%M:%S") |
|
29 | return datetime.strptime(s.rpartition(" ")[0], "%Y/%m/%d %H:%M:%S") | |
14 |
|
30 | |||
|
31 | ||||
|
32 | def issues2dict(issues): | |||
|
33 | """Convert a list of issues to a dict, keyed by issue number.""" | |||
|
34 | idict = {} | |||
|
35 | for i in issues: | |||
|
36 | idict[i['number']] = i | |||
|
37 | return idict | |||
|
38 | ||||
|
39 | ||||
|
40 | def is_pull_request(issue): | |||
|
41 | """Return True if the given issue is a pull request.""" | |||
|
42 | return 'pull_request_url' in issue | |||
|
43 | ||||
|
44 | ||||
15 | def issues_closed_since(period=timedelta(days=365), project="ipython/ipython/"): |
|
45 | def issues_closed_since(period=timedelta(days=365), project="ipython/ipython/"): | |
16 | """Get all issues closed since a particular point in time. period |
|
46 | """Get all issues closed since a particular point in time. period | |
17 | can either be a datetime object, or a timedelta object. In the |
|
47 | can either be a datetime object, or a timedelta object. In the | |
@@ -21,11 +51,59 b' latter case, it is used as a time before the present."""' | |||||
21 | period = datetime.now() - period |
|
51 | period = datetime.now() - period | |
22 | return [i for i in allclosed if _parse_datetime(i['closed_at']) > period] |
|
52 | return [i for i in allclosed if _parse_datetime(i['closed_at']) > period] | |
23 |
|
53 | |||
|
54 | ||||
|
55 | def sorted_by_field(issues, field='closed_at', reverse=False): | |||
|
56 | """Return a list of issues sorted by closing date date.""" | |||
|
57 | return sorted(issues, key = lambda i:i[field], reverse=reverse) | |||
|
58 | ||||
|
59 | ||||
|
60 | def report(issues, show_urls=False): | |||
|
61 | """Summary report about a list of issues, printing number and title. | |||
|
62 | """ | |||
|
63 | # titles may have unicode in them, so we must encode everything below | |||
|
64 | if show_urls: | |||
|
65 | for i in issues: | |||
|
66 | print('* `%d <%s>`_: %s' % (i['number'], | |||
|
67 | i['html_url'].encode('utf-8'), | |||
|
68 | i['title'].encode('utf-8'))) | |||
|
69 | else: | |||
|
70 | for i in issues: | |||
|
71 | print('* %d: %s' % (i['number'], i['title'].encode('utf-8'))) | |||
|
72 | ||||
|
73 | #----------------------------------------------------------------------------- | |||
|
74 | # Main script | |||
|
75 | #----------------------------------------------------------------------------- | |||
|
76 | ||||
24 | if __name__ == "__main__": |
|
77 | if __name__ == "__main__": | |
25 | # Demo |
|
78 | # Whether to add reST urls for all issues in printout. | |
|
79 | show_urls = True | |||
|
80 | ||||
|
81 | # By default, search one month back | |||
26 | if len(sys.argv) > 1: |
|
82 | if len(sys.argv) > 1: | |
27 | days = int(sys.argv[1]) |
|
83 | days = int(sys.argv[1]) | |
28 | else: |
|
84 | else: | |
29 |
days = 3 |
|
85 | days = 30 | |
30 | n = len(issues_closed_since(timedelta(days=days))) |
|
86 | ||
31 | print "%d issues closed in the last %d days." % (n, days) |
|
87 | # turn off to play interactively without redownloading, use %run -i | |
|
88 | if 1: | |||
|
89 | issues = issues_closed_since(timedelta(days=days)) | |||
|
90 | ||||
|
91 | # For regular reports, it's nice to show them in reverse chronological order | |||
|
92 | issues = sorted_by_field(issues, reverse=True) | |||
|
93 | ||||
|
94 | # Break up into pull requests and regular issues | |||
|
95 | pulls = filter(is_pull_request, issues) | |||
|
96 | regular = filter(lambda i: not is_pull_request(i), issues) | |||
|
97 | n_issues, n_pulls, n_regular = map(len, (issues, pulls, regular)) | |||
|
98 | ||||
|
99 | # Print summary report we can directly include into release notes. | |||
|
100 | print("Github stats for the last %d days." % days) | |||
|
101 | print("We closed a total of %d issues, %d pull requests and %d regular \n" | |||
|
102 | "issues; this is the full list (generated with the script \n" | |||
|
103 | "`tools/github_stats.py`):" % (n_issues, n_pulls, n_regular)) | |||
|
104 | print() | |||
|
105 | print('Pull requests (%d):\n' % n_pulls) | |||
|
106 | report(pulls, show_urls) | |||
|
107 | print() | |||
|
108 | print('Regular issues (%d):\n' % n_regular) | |||
|
109 | report(regular, show_urls) |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now