This document is intended to demonstrate circumstances in which:
import sys
import time
%pylab inline
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline]. For more information, type 'help(pylab)'.
Text output that appears within 500ms has the excecuted cell remaining at a fixed position.
print "foo"
foo
Plot output should behave similarly, but does not. The following cell has a semicolon, which suppresses printing the scalar result of the plot call (as text). Three distinct things happen in quick succession:
Desired behavior:
As the output is generated in less than 500ms, the output should be replaced without causing any scrolling of the document above or below.
plot(rand(100));
The following case has no semicolon, so generates both text output (scalar result of plot()) and a figure. The behavior of the previous cell occurs, but in addition the scalar text output appears immediately and causes no scrolling.
Desired behavior:
As above, both text and plot output should be replaced without causing any scrolling or jumping of the document (because it is generated quickly <500ms)
plot(rand(100))
[<matplotlib.lines.Line2D at 0x326e250>]
When image output takes longer than 500ms:
Desired behavior:
plot(rand(200000));
When long output appears quickly, scroll to put the next cell in view, leaving as much output visible as possible.
Currently the successive cell is not entriely on screen. (the CodeMirror box is on screen, but the frame around the input cell is partially off screen)
Desired behavior: place output in a scrolled output box, so that both the preceeding excecuted cell, and following input cell are on the screen at the same time.
for x in range(100):
print x
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
When long output takes longer than 500ms, so it is cleared first, the following happens:
Desired behavior:
time.sleep(5)
for x in range(100):
print x
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
Click on the above output cell.
Behavior: document scrolls to the corresponding input cell.
Desired behavior:
print "foo"
foo
Terminal mode: press ctrl-enter on the following cell.
Behavior: entire cell is selected as if the user typed ctrl-A
Desired behavior: Don't select output on ctrl-enter. It requires the user to click or play with the arrow keys to continue working.
print "bar"
print "baz"
bar baz
Double click on the plot in the following cell.
Desired behavior: plot should be maximized to the width of the browser such that the entire plot is still on screen.
There's no reason to make the user grab the tiny resize handle, when 99% of the time the user just wants to make it bigger.
plot(rand(100));
Long executing cells: imagine you execute something that will take several minutes, and in the meantime may have scrolled to a different position in the document. Go back and execute cell #7 for example, then scroll back down here. On output, the document scrolls to the middle of the output.
Desired behavior: the focused input cell should not move on output.
Perhaps a more obvious indicator of completion is desirable, if there is no scrolling.
print "dummy cell"
dummy cell
Adding cells:
Type (ctrl-m a) and (ctrl-m b) to add a cell above or below the current one.
Desired behavior: the input cursor should remain fixed (i.e. where the user is looking)