##// END OF EJS Templates
s/prompt_number/execution_count in nbformat 4
MinRK -
Show More
@@ -60,7 +60,7 b' class APITest(NotebookTestBase):'
60 60 cc1.outputs.append(new_output(output_type="stream", data=u'12'))
61 61 cc1.outputs.append(new_output(output_type="execute_result",
62 62 mime_bundle={'image/png' : png_green_pixel},
63 prompt_number=1,
63 execution_count=1,
64 64 ))
65 65 nb.cells.append(cc1)
66 66
@@ -471,7 +471,7 b' define(['
471 471 this.code_mirror.clearHistory();
472 472 this.auto_highlight();
473 473 }
474 this.set_input_prompt(data.prompt_number);
474 this.set_input_prompt(data.execution_count);
475 475 this.output_area.trusted = data.metadata.trusted || false;
476 476 this.output_area.fromJSON(data.outputs);
477 477 if (data.metadata.collapsed !== undefined) {
@@ -490,9 +490,9 b' define(['
490 490 data.source = this.get_text();
491 491 // is finite protect against undefined and '*' value
492 492 if (isFinite(this.input_prompt_number)) {
493 data.prompt_number = this.input_prompt_number;
493 data.execution_count = this.input_prompt_number;
494 494 } else {
495 data.prompt_number = null;
495 data.execution_count = null;
496 496 }
497 497 var outputs = this.output_area.toJSON();
498 498 data.outputs = outputs;
@@ -220,7 +220,7 b' define(['
220 220 json = content.data;
221 221 json.output_type = msg_type;
222 222 json.metadata = content.metadata;
223 json.prompt_number = content.execution_count;
223 json.execution_count = content.execution_count;
224 224 } else if (msg_type === "error") {
225 225 json.ename = content.ename;
226 226 json.evalue = content.evalue;
@@ -414,7 +414,7 b' define(['
414 414
415 415
416 416 OutputArea.prototype.append_execute_result = function (json) {
417 var n = json.prompt_number || ' ';
417 var n = json.execution_count || ' ';
418 418 var toinsert = this.create_output_area();
419 419 if (this.prompt_area) {
420 420 toinsert.find('div.prompt').addClass('output_prompt').text('Out[' + n + ']:');
@@ -13,7 +13,7 b' casper.notebook_test(function () {'
13 13 this.evaluate(function () {
14 14 var cell = IPython.notebook.get_cell(0);
15 15 var json = cell.toJSON();
16 json.prompt_number = "<script> alert('hello from input prompts !')</script>";
16 json.execution_count = "<script> alert('hello from input prompts !')</script>";
17 17 cell.fromJSON(json);
18 18 });
19 19
@@ -17,6 +17,7 b''
17 17 },
18 18 {
19 19 "cell_type": "code",
20 "execution_count": 1,
20 21 "metadata": {
21 22 "collapsed": false
22 23 },
@@ -28,18 +29,17 b''
28 29 "text": "\nWelcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline].\nFor more information, type 'help(pylab)'.\n"
29 30 }
30 31 ],
31 "prompt_number": 1,
32 32 "source": [
33 33 "%pylab inline"
34 34 ]
35 35 },
36 36 {
37 37 "cell_type": "code",
38 "execution_count": 2,
38 39 "metadata": {
39 40 "collapsed": false
40 41 },
41 42 "outputs": [],
42 "prompt_number": 2,
43 43 "source": [
44 44 "import numpy as np"
45 45 ]
@@ -53,62 +53,62 b''
53 53 },
54 54 {
55 55 "cell_type": "code",
56 "execution_count": 6,
56 57 "metadata": {
57 58 "collapsed": false
58 59 },
59 60 "outputs": [],
60 "prompt_number": 6,
61 61 "source": [
62 62 "a = np.random.uniform(size=(100,100))"
63 63 ]
64 64 },
65 65 {
66 66 "cell_type": "code",
67 "execution_count": 7,
67 68 "metadata": {
68 69 "collapsed": false
69 70 },
70 71 "outputs": [
71 72 {
73 "execution_count": 7,
72 74 "metadata": {},
73 75 "output_type": "execute_result",
74 "prompt_number": 7,
75 76 "text/plain": [
76 77 "(100, 100)"
77 78 ]
78 79 }
79 80 ],
80 "prompt_number": 7,
81 81 "source": [
82 82 "a.shape"
83 83 ]
84 84 },
85 85 {
86 86 "cell_type": "code",
87 "execution_count": 8,
87 88 "metadata": {
88 89 "collapsed": false
89 90 },
90 91 "outputs": [],
91 "prompt_number": 8,
92 92 "source": [
93 93 "evs = np.linalg.eigvals(a)"
94 94 ]
95 95 },
96 96 {
97 97 "cell_type": "code",
98 "execution_count": 10,
98 99 "metadata": {
99 100 "collapsed": false
100 101 },
101 102 "outputs": [
102 103 {
104 "execution_count": 10,
103 105 "metadata": {},
104 106 "output_type": "execute_result",
105 "prompt_number": 10,
106 107 "text/plain": [
107 108 "(100,)"
108 109 ]
109 110 }
110 111 ],
111 "prompt_number": 10,
112 112 "source": [
113 113 "evs.shape"
114 114 ]
@@ -122,14 +122,15 b''
122 122 },
123 123 {
124 124 "cell_type": "code",
125 "execution_count": 14,
125 126 "metadata": {
126 127 "collapsed": false
127 128 },
128 129 "outputs": [
129 130 {
131 "execution_count": 14,
130 132 "metadata": {},
131 133 "output_type": "execute_result",
132 "prompt_number": 14,
133 134 "text/plain": [
134 135 "(array([95, 4, 0, 0, 0, 0, 0, 0, 0, 1]),\n",
135 136 " array([ -2.93566063, 2.35937011, 7.65440086, 12.9494316 ,\n",
@@ -147,18 +148,17 b''
147 148 ]
148 149 }
149 150 ],
150 "prompt_number": 14,
151 151 "source": [
152 152 "hist(evs.real)"
153 153 ]
154 154 },
155 155 {
156 156 "cell_type": "code",
157 "execution_count": null,
157 158 "metadata": {
158 159 "collapsed": false
159 160 },
160 161 "outputs": [],
161 "prompt_number": null,
162 162 "source": []
163 163 }
164 164 ],
@@ -3,16 +3,8 b''
3 3 # Copyright (c) IPython Development Team.
4 4 # Distributed under the terms of the Modified BSD License.
5 5
6 #-----------------------------------------------------------------------------
7 # Imports
8 #-----------------------------------------------------------------------------
9
10 6 from .base import Preprocessor
11 7
12
13 #-----------------------------------------------------------------------------
14 # Classes
15 #-----------------------------------------------------------------------------
16 8 class ClearOutputPreprocessor(Preprocessor):
17 9 """
18 10 Removes the output from all code cells in a notebook.
@@ -24,5 +16,5 b' class ClearOutputPreprocessor(Preprocessor):'
24 16 """
25 17 if cell.cell_type == 'code':
26 18 cell.outputs = []
27 cell.prompt_number = None
19 cell.execution_count = None
28 20 return cell, resources
@@ -88,8 +88,7 b' class ExecutePreprocessor(Preprocessor):'
88 88
89 89 # set the prompt number for the input and the output
90 90 if 'execution_count' in content:
91 cell['prompt_number'] = content['execution_count']
92 out.prompt_number = content['execution_count']
91 cell['execution_count'] = content['execution_count']
93 92
94 93 if msg_type == 'status':
95 94 if content['execution_state'] == 'idle':
@@ -101,8 +100,6 b' class ExecutePreprocessor(Preprocessor):'
101 100 elif msg_type == 'clear_output':
102 101 outs = []
103 102 continue
104 elif msg_type == 'execute_result':
105 cell['prompt_number'] = content['execution_count']
106 103
107 104 try:
108 105 out = output_from_msg(msg)
@@ -27,7 +27,7 b' class PreprocessorTestsBase(TestsBase):'
27 27 out['application/pdf'] = 'aA=='
28 28 outputs.append(out)
29 29
30 cells=[nbformat.new_code_cell(source="$ e $", prompt_number=1, outputs=outputs),
30 cells=[nbformat.new_code_cell(source="$ e $", execution_count=1, outputs=outputs),
31 31 nbformat.new_markdown_cell(source="$ e $")]
32 32
33 33 return nbformat.new_notebook(cells=cells)
@@ -2,17 +2,18 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
8 9 "outputs": [],
9 "prompt_number": 1,
10 10 "source": [
11 11 "from IPython.display import clear_output"
12 12 ]
13 13 },
14 14 {
15 15 "cell_type": "code",
16 "execution_count": 2,
16 17 "metadata": {
17 18 "collapsed": false
18 19 },
@@ -24,7 +25,6 b''
24 25 "text": "9\n"
25 26 }
26 27 ],
27 "prompt_number": 2,
28 28 "source": [
29 29 "for i in range(10):\n",
30 30 " clear_output()\n",
@@ -2,17 +2,18 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
8 9 "outputs": [],
9 "prompt_number": 1,
10 10 "source": [
11 11 "i, j = 1, 1"
12 12 ]
13 13 },
14 14 {
15 15 "cell_type": "code",
16 "execution_count": 2,
16 17 "metadata": {
17 18 "collapsed": false
18 19 },
@@ -24,7 +25,6 b''
24 25 "text": "2\n3\n5\n8\n13\n21\n34\n55\n89\n144\n"
25 26 }
26 27 ],
27 "prompt_number": 2,
28 28 "source": [
29 29 "for m in range(10):\n",
30 30 " i, j = j, i + j\n",
@@ -2,6 +2,7 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
@@ -13,7 +14,6 b''
13 14 "text": "Hello World\n"
14 15 }
15 16 ],
16 "prompt_number": 1,
17 17 "source": [
18 18 "print(\"Hello World\")"
19 19 ]
@@ -2,22 +2,22 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
8 9 "outputs": [],
9 "prompt_number": 1,
10 10 "source": [
11 11 "from IPython.display import Image"
12 12 ]
13 13 },
14 14 {
15 15 "cell_type": "code",
16 "execution_count": 2,
16 17 "metadata": {
17 18 "collapsed": false
18 19 },
19 20 "outputs": [],
20 "prompt_number": 2,
21 21 "source": [
22 22 "Image('../input/python.png');"
23 23 ]
@@ -2,22 +2,24 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
8 9 "outputs": [],
9 "prompt_number": 1,
10 10 "source": [
11 11 "from IPython.display import SVG"
12 12 ]
13 13 },
14 14 {
15 15 "cell_type": "code",
16 "execution_count": 2,
16 17 "metadata": {
17 18 "collapsed": false
18 19 },
19 20 "outputs": [
20 21 {
22 "execution_count": 2,
21 23 "image/svg+xml": [
22 24 "<svg height=\"100\" width=\"100\">\n",
23 25 " <circle cx=\"50\" cy=\"50\" fill=\"red\" r=\"40\" stroke=\"black\" stroke-width=\"2\"/>\n",
@@ -25,13 +27,11 b''
25 27 ],
26 28 "metadata": {},
27 29 "output_type": "execute_result",
28 "prompt_number": 2,
29 30 "text/plain": [
30 31 "<IPython.core.display.SVG object>"
31 32 ]
32 33 }
33 34 ],
34 "prompt_number": 2,
35 35 "source": [
36 36 "SVG(data='''\n",
37 37 "<svg height=\"100\" width=\"100\">\n",
@@ -2,6 +2,7 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
@@ -19,13 +20,13 b''
19 20 ]
20 21 }
21 22 ],
22 "prompt_number": 1,
23 23 "source": [
24 24 "raise Exception(\"message\")"
25 25 ]
26 26 },
27 27 {
28 28 "cell_type": "code",
29 "execution_count": 2,
29 30 "metadata": {
30 31 "collapsed": false
31 32 },
@@ -37,7 +38,6 b''
37 38 "text": "ok\n"
38 39 }
39 40 ],
40 "prompt_number": 2,
41 41 "source": [
42 42 "print('ok')"
43 43 ]
@@ -2,6 +2,7 b''
2 2 "cells": [
3 3 {
4 4 "cell_type": "code",
5 "execution_count": 1,
5 6 "metadata": {
6 7 "collapsed": false
7 8 },
@@ -13,7 +14,6 b''
13 14 "text": "\u2603\n"
14 15 }
15 16 ],
16 "prompt_number": 1,
17 17 "source": [
18 18 "print('\u2603')"
19 19 ]
@@ -32,4 +32,4 b' class TestClearOutput(PreprocessorTestsBase):'
32 32 preprocessor = self.build_preprocessor()
33 33 nb, res = preprocessor(nb, res)
34 34 assert nb.cells[0].outputs == []
35 assert nb.cells[0].prompt_number is None
35 assert nb.cells[0].execution_count is None
@@ -33,7 +33,7 b' class TestCoalesceStreams(PreprocessorTestsBase):'
33 33 nbformat.new_output(output_type="stream", name="stdout", text="5"),
34 34 nbformat.new_output(output_type="stream", name="stdout", text="6"),
35 35 nbformat.new_output(output_type="stream", name="stdout", text="7")]
36 cells=[nbformat.new_code_cell(source="# None", prompt_number=1,outputs=outputs)]
36 cells=[nbformat.new_code_cell(source="# None", execution_count=1,outputs=outputs)]
37 37
38 38 nb = nbformat.new_notebook(cells=cells)
39 39 res = self.build_resources()
@@ -49,7 +49,7 b' class TestCoalesceStreams(PreprocessorTestsBase):'
49 49 nbformat.new_output(output_type="stream", name="stdout", text="\nz"),
50 50 nbformat.new_output(output_type="stream", name="stdout", text="\rc\n"),
51 51 nbformat.new_output(output_type="stream", name="stdout", text="z\rz\rd")]
52 cells=[nbformat.new_code_cell(source="# None", prompt_number=1,outputs=outputs)]
52 cells=[nbformat.new_code_cell(source="# None", execution_count=1,outputs=outputs)]
53 53
54 54 nb = nbformat.new_notebook(cells=cells)
55 55 res = self.build_resources()
@@ -53,9 +53,9 b' class TestExecute(PreprocessorTestsBase):'
53 53 normalized_actual_outputs = list(map(self.normalize_output, actual_outputs))
54 54 assert normalized_expected_outputs == normalized_actual_outputs
55 55
56 expected_prompt_number = expected_cell.get('prompt_number', None)
57 actual_prompt_number = actual_cell.get('prompt_number', None)
58 assert expected_prompt_number == actual_prompt_number
56 expected_execution_count = expected_cell.get('execution_count', None)
57 actual_execution_count = actual_cell.get('execution_count', None)
58 assert expected_execution_count == actual_execution_count
59 59
60 60
61 61 def build_preprocessor(self):
@@ -81,8 +81,8 b' class TestExecute(PreprocessorTestsBase):'
81 81 preprocessor = self.build_preprocessor()
82 82 cleaned_input_nb = copy.deepcopy(input_nb)
83 83 for cell in cleaned_input_nb.cells:
84 if 'prompt_number' in cell:
85 del cell['prompt_number']
84 if 'execution_count' in cell:
85 del cell['execution_count']
86 86 cell['outputs'] = []
87 87 output_nb, _ = preprocessor(cleaned_input_nb, res)
88 88 self.assert_notebooks_equal(output_nb, input_nb)
@@ -21,9 +21,9 b' class Testrevealhelp(PreprocessorTestsBase):'
21 21 slide_metadata = {'slideshow' : {'slide_type': 'slide'}}
22 22 subslide_metadata = {'slideshow' : {'slide_type': 'subslide'}}
23 23
24 cells=[nbformat.new_code_cell(source="", prompt_number=1, outputs=outputs),
24 cells=[nbformat.new_code_cell(source="", execution_count=1, outputs=outputs),
25 25 nbformat.new_markdown_cell(source="", metadata=slide_metadata),
26 nbformat.new_code_cell(source="", prompt_number=2, outputs=outputs),
26 nbformat.new_code_cell(source="", execution_count=2, outputs=outputs),
27 27 nbformat.new_markdown_cell(source="", metadata=slide_metadata),
28 28 nbformat.new_markdown_cell(source="", metadata=subslide_metadata)]
29 29
@@ -47,7 +47,7 b' class Testsvg2pdf(PreprocessorTestsBase):'
47 47 slide_metadata = {'slideshow' : {'slide_type': 'slide'}}
48 48 subslide_metadata = {'slideshow' : {'slide_type': 'subslide'}}
49 49
50 cells=[nbformat.new_code_cell(source="", prompt_number=1, outputs=outputs)]
50 cells=[nbformat.new_code_cell(source="", execution_count=1, outputs=outputs)]
51 51
52 52 return nbformat.new_notebook(cells=cells)
53 53
@@ -23,8 +23,8 b''
23 23
24 24 {% block in_prompt -%}
25 25 <div class="prompt input_prompt">
26 {%- if cell.prompt_number is defined -%}
27 In&nbsp;[{{ cell.prompt_number|replace(None, "&nbsp;") }}]:
26 {%- if cell.execution_count is defined -%}
27 In&nbsp;[{{ cell.execution_count|replace(None, "&nbsp;") }}]:
28 28 {%- else -%}
29 29 In&nbsp;[&nbsp;]:
30 30 {%- endif -%}
@@ -55,8 +55,8 b' In&nbsp;[&nbsp;]:'
55 55 <div class="output_area">
56 56 {%- if output.output_type == 'execute_result' -%}
57 57 <div class="prompt output_prompt">
58 {%- if cell.prompt_number is defined -%}
59 Out[{{ cell.prompt_number|replace(None, "&nbsp;") }}]:
58 {%- if cell.execution_count is defined -%}
59 Out[{{ cell.execution_count|replace(None, "&nbsp;") }}]:
60 60 {%- else -%}
61 61 Out[&nbsp;]:
62 62 {%- endif -%}
@@ -20,7 +20,7 b''
20 20 ((*- if type in ['text']*))
21 21 ((( add_prompt(output.text, cell, 'Out') )))
22 22 ((*- else -*))
23 \verb+Out[((( cell.prompt_number )))]:+((( super() )))
23 \verb+Out[((( cell.execution_count )))]:+((( super() )))
24 24 ((*- endif -*))
25 25 ((*- endfor -*))
26 26 ((* endblock execute_result *))
@@ -33,13 +33,13 b''
33 33 % Name: draw_prompt
34 34 % Purpose: Renders an output/input prompt
35 35 ((* macro add_prompt(text, cell, prompt) -*))
36 ((*- if cell.prompt_number is defined -*))
37 ((*- set prompt_number = "" ~ (cell.prompt_number | replace(None, " ")) -*))
36 ((*- if cell.execution_count is defined -*))
37 ((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
38 38 ((*- else -*))
39 ((*- set prompt_number = " " -*))
39 ((*- set execution_count = " " -*))
40 40 ((*- endif -*))
41 ((*- set indentation = " " * (prompt_number | length + 7) -*))
41 ((*- set indentation = " " * (execution_count | length + 7) -*))
42 42 \begin{verbatim}
43 (((- text | add_prompts(first=prompt ~ '[' ~ prompt_number ~ ']: ', cont=indentation) -)))
43 (((- text | add_prompts(first=prompt ~ '[' ~ execution_count ~ ']: ', cont=indentation) -)))
44 44 \end{verbatim}
45 45 ((*- endmacro *))
@@ -33,7 +33,7 b''
33 33 ((*- if type in ['text']*))
34 34 ((( add_prompt(output.text | escape_latex, cell, 'Out', 'outcolor') )))
35 35 ((* else -*))
36 \texttt{\color{outcolor}Out[{\color{outcolor}((( cell.prompt_number )))}]:}((( super() )))
36 \texttt{\color{outcolor}Out[{\color{outcolor}((( cell.execution_count )))}]:}((( super() )))
37 37 ((*- endif -*))
38 38 ((*- endfor -*))
39 39 ((* endblock execute_result *))
@@ -46,13 +46,13 b''
46 46 % Name: draw_prompt
47 47 % Purpose: Renders an output/input prompt
48 48 ((* macro add_prompt(text, cell, prompt, prompt_color) -*))
49 ((*- if cell.prompt_number is defined -*))
50 ((*- set prompt_number = "" ~ (cell.prompt_number | replace(None, " ")) -*))
49 ((*- if cell.execution_count is defined -*))
50 ((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
51 51 ((*- else -*))
52 ((*- set prompt_number = " " -*))
52 ((*- set execution_count = " " -*))
53 53 ((*- endif -*))
54 ((*- set indention = " " * (prompt_number | length + 7) -*))
54 ((*- set indention = " " * (execution_count | length + 7) -*))
55 55 \begin{Verbatim}[commandchars=\\\{\}]
56 ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ prompt_number ~ '}]:} ', cont=indention) )))
56 ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
57 57 \end{Verbatim}
58 58 ((*- endmacro *))
@@ -5,7 +5,7 b''
5 5 {% endblock header %}
6 6
7 7 {% block in_prompt %}
8 # In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
8 # In[{{ cell.execution_count if cell.execution_count else ' ' }}]:
9 9 {% endblock in_prompt %}
10 10
11 11 {% block input %}
@@ -17,11 +17,11 b''
17 17 },
18 18 {
19 19 "cell_type": "code",
20 "execution_count": 2,
20 21 "metadata": {
21 22 "collapsed": false
22 23 },
23 24 "outputs": [],
24 "prompt_number": 2,
25 25 "source": [
26 26 "from sympy import init_printing\n",
27 27 "from sympy import *\n",
@@ -37,11 +37,11 b''
37 37 },
38 38 {
39 39 "cell_type": "code",
40 "execution_count": 4,
40 41 "metadata": {
41 42 "collapsed": false
42 43 },
43 44 "outputs": [],
44 "prompt_number": 4,
45 45 "source": [
46 46 "x,y,z = symbols('x y z')"
47 47 ]
@@ -55,15 +55,16 b''
55 55 },
56 56 {
57 57 "cell_type": "code",
58 "execution_count": 6,
58 59 "metadata": {
59 60 "collapsed": false
60 61 },
61 62 "outputs": [
62 63 {
64 "execution_count": 6,
63 65 "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKMAAAAZBAMAAACvE4OgAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\nme8Q6PJIAAACz0lEQVRIDa1UTWjUQBT+ZpvdzW7TGlrxItjYSg/C6vbiDwjmoCgUpHioPYhdqig9\nFJYiPYmW4klB14NgFGnw4EHpj7UgUtTFXhSEBgVBxIOFggWVrrUqiMY3mZkkLNIK7oN575vvvfky\n8yYJIGzgkSlRrULKrivVSkvq6LbxtcaSjV3aSo0lgWyl5pK69V+SRlEsPxNTGYhhDrV3M2Ue2etc\nEDmuMmM+IjolrCuHXNoLoQDNSAXdzbjsfFVKTY1vCgFXFIxenG4cFSSzRewAPnN0FugXjPDr45MQ\nJwoKtitgXL9zT+CsJeIHYG+Z4H1gwhRU4G/FcAQbbYU3KdDo+0sCK8lRU0guA72uKqMYk9RehHxP\niDIu0NS2v90KGShJYi7T7tgvkrQ2vIT2XtRISWNra6lzGc8/PW3ji4PL7Vmge095YIX0iB71NCaZ\n5N3XyM0VCuNIyFNIyY3AMG/KDUvjn90DGmwq9wpIl5AyU5WsTYy0aJf6JFGB5An3Der5jExKHjNR\n4JKPge/EXqDBoOXpkxkmkJHFfAFRVhDIveWA0S57N2Me6yw+DSX1n1uCq3sIfCF2IcjNkjeWyKli\nginHubboOB4vSNAjyaiXE26ygrkyTfod55Lj3CTE+n2P73ImJpnk6wJJKjYJSwt3OQbNJu4icM5s\nKGGbzMuD70N6JSbJD44x7pLDyJrbkfiLpOEhYVMJSVEj83x5YFLyNrAzJsmvJ+uhLrieXvcJDshy\nHtQuD54c2IWWEnSXfUTDZJJfAjcpOW5imp9aHvw4ZZ4NDV4FGjw0tzadKgbFwinJUd//AT0P1tdW\nBtuRU39oKdk9ONQ163fM+nvu/s4D/FX30otdQIZGlSnJKpq6KUxKVqV1WxGHFIhishjhEO1Gi3r4\nkZCMg+hH1henV8EjmFoly1PTMs/Uadaox+FceY2STpmvt9co/Pe0Jvt1GvgDK/Osw/4jQ4wAAAAA\nSUVORK5CYII=\n",
64 66 "metadata": {},
65 67 "output_type": "execute_result",
66 "prompt_number": 6,
67 68 "text/latex": [
68 69 "$$x^{2} + 2.0 y + \\sin{\\left (z \\right )}$$"
69 70 ],
@@ -73,22 +74,22 b''
73 74 ]
74 75 }
75 76 ],
76 "prompt_number": 6,
77 77 "source": [
78 78 "e = x**2 + 2.0*y + sin(z); e"
79 79 ]
80 80 },
81 81 {
82 82 "cell_type": "code",
83 "execution_count": 7,
83 84 "metadata": {
84 85 "collapsed": false
85 86 },
86 87 "outputs": [
87 88 {
89 "execution_count": 7,
88 90 "image/png": "iVBORw0KGgoAAAANSUhEUgAAABQAAAAOBAMAAADd6iHDAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\nVGZoascqAAAAgElEQVQIHWNgVDJ2YICAMAb2H1BmKgPDTChzFgNDvgOEvT8AzgQKrA9gPZPYUwNk\ncXxnCGd4dWA1kMllwFDKUB9wEchUZmAIYNgMZDDwJIDIPyDiEgOjAAPLFwZWBhYFBh6BqzwfGI4y\nSJUXZXH8Zf7A+IBh////v1hzjh5/xwAAW80hUDE8HYkAAAAASUVORK5CYII=\n",
89 91 "metadata": {},
90 92 "output_type": "execute_result",
91 "prompt_number": 7,
92 93 "text/latex": [
93 94 "$$2 x$$"
94 95 ],
@@ -97,22 +98,22 b''
97 98 ]
98 99 }
99 100 ],
100 "prompt_number": 7,
101 101 "source": [
102 102 "diff(e, x)"
103 103 ]
104 104 },
105 105 {
106 106 "cell_type": "code",
107 "execution_count": 8,
107 108 "metadata": {
108 109 "collapsed": false
109 110 },
110 111 "outputs": [
111 112 {
113 "execution_count": 8,
112 114 "image/png": "iVBORw0KGgoAAAANSUhEUgAAALsAAAAZBAMAAACbakK8AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\nme8Q6PJIAAADAklEQVRIDbVVS2gTURQ90/wmk0k6tCJCsR1SKShIsxE3CgNWBKUxq9qFmqFqShfF\nUKQrkaDiF0pcCKYgBBcuBLV+wIWKARe6kQ4UhNKKWdiF4KIptmA/xPvmzZuMxdYUzIPcd+655568\nvLlJAL6G32oOasQWNHz5Rvg6nrKh/mygfSzlX2ygPaBUGmov6//NXs1yq4sex2EPrsHemTd2snNg\ntkb+Cx1zBL6SqwxZLvQAKYHzKZaPY4fh4TeHd0S5Nox9OClItm/jiU9DrEwwVEawpiVis9VkimqX\nAOr4o2cCs/0BT2I5+FYJRhJbePQxgzcD7QLEqtV5gdnu2Icr3L45gcCyt74Z7neL4SLQ0nm4S+dM\nYCz1gSPHnhKZDWyHhcCCNKwjqaF/TkwGl0L6nClie/wc1D1xdoNsSLhT0IJkhi7Lzr22xb8keE/N\nPm0Sc9yEuhRUyuiG9HzvFNeImCyq39SriOhtQI7IV/TiTqE8glqwohjE0NJwiANxOZTdZoxtfzSa\nx2tI8DtHcKQoQFmV6f1XT2swibxFL+6k5EgenhBCqKLTPX3ULnaYdDlaTMcCSd8zuXTvBq2bJUJr\nlE4WgSV5ZRdBzLFgO6nzhJp1ltvrlB2HCoWxQuG+jTvt2GxBWUZaU2mMApZNuSHA3vJpCliRhqqs\nZtvbTrb9ZIk+i70Ut1OcnpgeKskTCFUwjaYy8Jhr3eiefq0HIfa7yC6HOwVyULRuNDn21JngbcL+\nE8A+MNnSxb+w59+Cj2tELJBbjEZr8SGwn0j2aLkTPdp08R2OcKV6fXB3ikPH3n8tM5WTfrETtZcw\ng3QWH0dH7nKNiMkszqo/EDafaHhJ5Bm6ee4UtdAabxnMcmUUl0SnYx+uVqs5XAGN9QGgdeCrASv0\n3TmCsJcOdhnozexD38goK9HXynEKr1OKDs9guhQD039kGySyIQpJAdbvJ9YTlPvyUl3/aLUf34G/\nuGxIyXpE37DoLbAHwJaU53t9MRCfrU8o/k4iRn36Lar8Wd5wAfgN4R6xelyy/ssAAAAASUVORK5C\nYII=\n",
113 115 "metadata": {},
114 116 "output_type": "execute_result",
115 "prompt_number": 8,
116 117 "text/latex": [
117 118 "$$x^{2} z + 2.0 y z - \\cos{\\left (z \\right )}$$"
118 119 ],
@@ -122,18 +123,17 b''
122 123 ]
123 124 }
124 125 ],
125 "prompt_number": 8,
126 126 "source": [
127 127 "integrate(e, z)"
128 128 ]
129 129 },
130 130 {
131 131 "cell_type": "code",
132 "execution_count": null,
132 133 "metadata": {
133 134 "collapsed": false
134 135 },
135 136 "outputs": [],
136 "prompt_number": null,
137 137 "source": []
138 138 }
139 139 ],
@@ -17,6 +17,7 b''
17 17 },
18 18 {
19 19 "cell_type": "code",
20 "execution_count": 1,
20 21 "metadata": {
21 22 "collapsed": false
22 23 },
@@ -28,7 +29,6 b''
28 29 "text": "module://IPython.kernel.zmq.pylab.backend_inline\n"
29 30 }
30 31 ],
31 "prompt_number": 1,
32 32 "source": [
33 33 "%matplotlib inline\n",
34 34 "import matplotlib\n",
@@ -38,11 +38,11 b''
38 38 },
39 39 {
40 40 "cell_type": "code",
41 "execution_count": 2,
41 42 "metadata": {
42 43 "collapsed": false
43 44 },
44 45 "outputs": [],
45 "prompt_number": 2,
46 46 "source": [
47 47 "from IPython.display import set_matplotlib_formats\n",
48 48 "set_matplotlib_formats('png', 'pdf')\n",
@@ -51,31 +51,31 b''
51 51 },
52 52 {
53 53 "cell_type": "code",
54 "execution_count": 3,
54 55 "metadata": {
55 56 "collapsed": false
56 57 },
57 58 "outputs": [
58 59 {
60 "execution_count": 3,
59 61 "metadata": {},
60 62 "output_type": "execute_result",
61 "prompt_number": 3,
62 63 "text/plain": [
63 64 "{matplotlib.figure.Figure: <function IPython.core.pylabtools.<lambda>>}"
64 65 ]
65 66 }
66 67 ],
67 "prompt_number": 3,
68 68 "source": [
69 69 "ip.display_formatter.formatters['application/pdf'].type_printers"
70 70 ]
71 71 },
72 72 {
73 73 "cell_type": "code",
74 "execution_count": 4,
74 75 "metadata": {
75 76 "collapsed": false
76 77 },
77 78 "outputs": [],
78 "prompt_number": 4,
79 79 "source": [
80 80 "import numpy as np"
81 81 ]
@@ -89,62 +89,62 b''
89 89 },
90 90 {
91 91 "cell_type": "code",
92 "execution_count": 5,
92 93 "metadata": {
93 94 "collapsed": false
94 95 },
95 96 "outputs": [],
96 "prompt_number": 5,
97 97 "source": [
98 98 "a = np.random.uniform(size=(100,100))"
99 99 ]
100 100 },
101 101 {
102 102 "cell_type": "code",
103 "execution_count": 6,
103 104 "metadata": {
104 105 "collapsed": false
105 106 },
106 107 "outputs": [
107 108 {
109 "execution_count": 6,
108 110 "metadata": {},
109 111 "output_type": "execute_result",
110 "prompt_number": 6,
111 112 "text/plain": [
112 113 "(100, 100)"
113 114 ]
114 115 }
115 116 ],
116 "prompt_number": 6,
117 117 "source": [
118 118 "a.shape"
119 119 ]
120 120 },
121 121 {
122 122 "cell_type": "code",
123 "execution_count": 7,
123 124 "metadata": {
124 125 "collapsed": false
125 126 },
126 127 "outputs": [],
127 "prompt_number": 7,
128 128 "source": [
129 129 "evs = np.linalg.eigvals(a)"
130 130 ]
131 131 },
132 132 {
133 133 "cell_type": "code",
134 "execution_count": 8,
134 135 "metadata": {
135 136 "collapsed": false
136 137 },
137 138 "outputs": [
138 139 {
140 "execution_count": 8,
139 141 "metadata": {},
140 142 "output_type": "execute_result",
141 "prompt_number": 8,
142 143 "text/plain": [
143 144 "(100,)"
144 145 ]
145 146 }
146 147 ],
147 "prompt_number": 8,
148 148 "source": [
149 149 "evs.shape"
150 150 ]
@@ -166,14 +166,15 b''
166 166 },
167 167 {
168 168 "cell_type": "code",
169 "execution_count": 9,
169 170 "metadata": {
170 171 "collapsed": false
171 172 },
172 173 "outputs": [
173 174 {
175 "execution_count": 9,
174 176 "metadata": {},
175 177 "output_type": "execute_result",
176 "prompt_number": 9,
177 178 "text/plain": [
178 179 "(array([97, 2, 0, 0, 0, 0, 0, 0, 0, 1]),\n",
179 180 " array([ -2.59479443, 2.67371141, 7.94221725, 13.21072308,\n",
@@ -192,7 +193,6 b''
192 193 ]
193 194 }
194 195 ],
195 "prompt_number": 9,
196 196 "source": [
197 197 "plt.hist(evs.real)"
198 198 ]
@@ -211,7 +211,7 b' class NotebookNotary(LoggingConfigurable):'
211 211 output_type = output['output_type']
212 212 if output_type in {'execute_result', 'display_data'}:
213 213 # if there are any data keys not in the safe whitelist
214 output_keys = set(output).difference({"output_type", "prompt_number", "metadata"})
214 output_keys = set(output).difference({"output_type", "execution_count", "metadata"})
215 215 if output_keys.difference(safe):
216 216 return False
217 217
@@ -52,7 +52,7 b''
52 52 ]
53 53 }
54 54 ],
55 "prompt_number": 1
55 "execution_count": 1
56 56 },
57 57 {
58 58 "cell_type": "heading",
@@ -88,13 +88,13 b''
88 88 ],
89 89 "metadata": {},
90 90 "output_type": "execute_result",
91 "prompt_number": 3,
91 "execution_count": 3,
92 92 "text/plain": [
93 93 "<IPython.core.display.HTML at 0x1112757d0>"
94 94 ]
95 95 }
96 96 ],
97 "prompt_number": 3
97 "execution_count": 3
98 98 },
99 99 {
100 100 "cell_type": "code",
@@ -118,7 +118,7 b''
118 118 ]
119 119 }
120 120 ],
121 "prompt_number": 7
121 "execution_count": 7
122 122 },
123 123 {
124 124 "cell_type": "heading",
@@ -143,13 +143,13 b''
143 143 "metadata": {},
144 144 "output_type": "execute_result",
145 145 "image/png": "iVBORw0KGgoAAAANSUhEUgAAAggAAABDCAYAAAD5/P3lAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAH3AAAB9wBYvxo6AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURB\nVHic7Z15uBxF1bjfugkJhCWBsCSAJGACNg4QCI3RT1lEAVE+UEBNOmwCDcjHT1wQgU+WD3dFxA1o\nCAikAZFFVlnCjizpsCUjHQjBIAkQlpCFJGS79fvjdGf69vTsc2fuza33eeaZmeqq6jM9vZw6dc4p\nBUwC+tE+fqW1fqmRDpRSHjCggS40sBxYDCxKvL8KzNBaL21EPoPB0DPIWVY/4NlE0ffzYfhgu+Qx\nGHoy/YFjaK+CcB3QkIIAHAWs3wRZsuhUSs0CXgQeBm7UWi/spn0Z+jA5yxpEfYruqnwYllRic5a1\nMaWv8U5gaT4M19Sx396IAnZLfB/SLkEMhp5O/3YL0AvoAHaKXl8HLlZK3QZcpbWe0lbJDOsaHuDU\n0e4u4JAy2wPk/C1JzrKWArOQ0fUtwH35MOysQxaDwbCO0NFuAXoh6wPjgQeUUvcqpUa0WyCDoQls\nCIwBjgfuAV7KWdY+7RWpmJxlXZezrEdylvXxdstiMK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wf+J1REAwGg8Fg6AMEnvNklL78\nHMRRca/E5hVINNIVwI2B56z6/3ExLRI31pXNAAAAAElFTkSuQmCC\n",
146 "prompt_number": 6,
146 "execution_count": 6,
147 147 "text/plain": [
148 148 "<IPython.core.display.Image at 0x111275490>"
149 149 ]
150 150 }
151 151 ],
152 "prompt_number": 6
152 "execution_count": 6
153 153 }
154 154 ]
155 155 }
@@ -75,6 +75,7 b' def upgrade_cell(cell):'
75 75 code cell:
76 76 - remove language metadata
77 77 - cell.input -> cell.source
78 - cell.prompt_number -> cell.execution_count
78 79 - update outputs
79 80 """
80 81 cell.setdefault('metadata', NotebookNode())
@@ -82,7 +83,7 b' def upgrade_cell(cell):'
82 83 cell.pop('language', '')
83 84 cell.metadata.collapsed = cell.pop('collapsed')
84 85 cell.source = cell.pop('input')
85 cell.setdefault('prompt_number', None)
86 cell.execution_count = cell.pop('prompt_number', None)
86 87 cell.outputs = upgrade_outputs(cell.outputs)
87 88 elif cell.cell_type == 'html':
88 89 # Technically, this exists. It will never happen in practice.
@@ -90,9 +91,18 b' def upgrade_cell(cell):'
90 91 return cell
91 92
92 93 def downgrade_cell(cell):
94 """downgrade a cell from v4 to v3
95
96 code cell:
97 - set cell.language
98 - cell.input <- cell.source
99 - cell.prompt_number <- cell.execution_count
100 - update outputs
101 """
93 102 if cell.cell_type == 'code':
94 103 cell.language = 'python'
95 104 cell.input = cell.pop('source', '')
105 cell.prompt_number = cell.pop('execution_count', None)
96 106 cell.collapsed = cell.metadata.pop('collapsed', False)
97 107 cell.outputs = downgrade_outputs(cell.outputs)
98 108 return cell
@@ -134,6 +144,7 b' def upgrade_output(output):'
134 144 if output['output_type'] in {'pyout', 'display_data'}:
135 145 if output['output_type'] == 'pyout':
136 146 output['output_type'] = 'execute_result'
147 output['execution_count'] = output.pop('prompt_number', None)
137 148 to_mime_key(output)
138 149 to_mime_key(output.metadata)
139 150 if 'application/json' in output:
@@ -158,6 +169,7 b' def downgrade_output(output):'
158 169 """
159 170 if output['output_type'] == 'execute_result':
160 171 output['output_type'] = 'pyout'
172 output['prompt_number'] = output.pop('execution_count', None)
161 173 if 'application/json' in output:
162 174 output['application/json'] = json.dumps(output['application/json'])
163 175 from_mime_key(output)
@@ -74,7 +74,7 b' def output_from_msg(msg):'
74 74 return new_output(output_type=msg_type,
75 75 metadata=content['metadata'],
76 76 mime_bundle=content['data'],
77 prompt_number=content['execution_count'],
77 execution_count=content['execution_count'],
78 78 )
79 79
80 80 elif msg_type == 'stream':
@@ -103,7 +103,7 b" def new_code_cell(source='', **kwargs):"
103 103 cell.update(from_dict(kwargs))
104 104 cell.setdefault('metadata', NotebookNode())
105 105 cell.setdefault('source', '')
106 cell.setdefault('prompt_number', None)
106 cell.setdefault('execution_count', None)
107 107 cell.setdefault('outputs', [])
108 108
109 109 validate(cell, 'code_cell')
@@ -150,7 +150,7 b''
150 150 "description": "Notebook code cell.",
151 151 "type": "object",
152 152 "additionalProperties": false,
153 "required": ["cell_type", "metadata", "source", "outputs", "prompt_number"],
153 "required": ["cell_type", "metadata", "source", "outputs", "execution_count"],
154 154 "properties": {
155 155 "cell_type": {
156 156 "description": "String identifying the type of cell.",
@@ -179,7 +179,7 b''
179 179 "type": "array",
180 180 "items": {"$ref": "#/definitions/output"}
181 181 },
182 "prompt_number": {
182 "execution_count": {
183 183 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
184 184 "type": ["integer", "null"],
185 185 "minimum": 0
@@ -199,15 +199,15 b''
199 199 "description": "Result of executing a code cell.",
200 200 "type": "object",
201 201 "additionalProperties": false,
202 "required": ["output_type", "metadata", "prompt_number"],
202 "required": ["output_type", "metadata", "execution_count"],
203 203 "properties": {
204 204 "output_type": {
205 205 "description": "Type of cell output.",
206 206 "enum": ["execute_result"]
207 207 },
208 "prompt_number": {
208 "execution_count": {
209 209 "description": "A result's prompt number.",
210 "type": ["integer"],
210 "type": ["integer", "null"],
211 211 "minimum": 0
212 212 },
213 213 "application/json": {
@@ -314,7 +314,7 b''
314 314 "description": "Contents of the cell, represented as an array of lines.",
315 315 "$ref": "#/definitions/misc/multiline_string"
316 316 },
317 "prompt_number": {
317 "execution_count": {
318 318 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
319 319 "type": ["integer", "null"],
320 320 "minimum": 0
@@ -20,7 +20,7 b' cells.append(new_markdown_cell('
20 20
21 21 cells.append(new_code_cell(
22 22 source='import numpy',
23 prompt_number=1,
23 execution_count=1,
24 24 ))
25 25
26 26 cells.append(new_markdown_cell(
@@ -38,20 +38,20 b' cells.append(new_heading_cell('
38 38
39 39 cells.append(new_code_cell(
40 40 source='a = numpy.random.rand(100)',
41 prompt_number=2,
41 execution_count=2,
42 42 ))
43 43 cells.append(new_code_cell(
44 44 source='a = 10\nb = 5\n',
45 prompt_number=3,
45 execution_count=3,
46 46 ))
47 47 cells.append(new_code_cell(
48 48 source='a = 10\nb = 5',
49 prompt_number=4,
49 execution_count=4,
50 50 ))
51 51
52 52 cells.append(new_code_cell(
53 53 source=u'print "ünîcødé"',
54 prompt_number=3,
54 execution_count=3,
55 55 outputs=[new_output(
56 56 output_type=u'execute_result',
57 57 mime_bundle={
@@ -66,7 +66,7 b' cells.append(new_code_cell('
66 66 },
67 67 'application/javascript': u'var i=0;'
68 68 },
69 prompt_number=3
69 execution_count=3
70 70 ),new_output(
71 71 output_type=u'display_data',
72 72 mime_bundle={
@@ -61,7 +61,7 b' def test_empty_stream():'
61 61 nt.assert_equal(output.text, '')
62 62
63 63 def test_empty_execute_result():
64 output = new_output('execute_result', prompt_number=1)
64 output = new_output('execute_result', execution_count=1)
65 65 nt.assert_equal(output.output_type, 'execute_result')
66 66
67 67 mimebundle = {
@@ -80,8 +80,8 b' def test_display_data():'
80 80 nt.assert_equal(output[key], expected)
81 81
82 82 def test_execute_result():
83 output = new_output('execute_result', mimebundle, prompt_number=10)
84 nt.assert_equal(output.prompt_number, 10)
83 output = new_output('execute_result', mimebundle, execution_count=10)
84 nt.assert_equal(output.execution_count, 10)
85 85 for key, expected in mimebundle.items():
86 86 nt.assert_equal(output[key], expected)
87 87
@@ -95,15 +95,15 b' def test_error():'
95 95 nt.assert_equal(o.traceback, [u'frame 0', u'frame 1', u'frame 2'])
96 96
97 97 def test_code_cell_with_outputs():
98 cell = new_code_cell(prompt_number=10, outputs=[
98 cell = new_code_cell(execution_count=10, outputs=[
99 99 new_output('display_data', mimebundle),
100 100 new_output('stream', text='hello'),
101 new_output('execute_result', mimebundle, prompt_number=10),
101 new_output('execute_result', mimebundle, execution_count=10),
102 102 ])
103 nt.assert_equal(cell.prompt_number, 10)
103 nt.assert_equal(cell.execution_count, 10)
104 104 nt.assert_equal(len(cell.outputs), 3)
105 105 er = cell.outputs[-1]
106 nt.assert_equal(er.prompt_number, 10)
106 nt.assert_equal(er.execution_count, 10)
107 107 nt.assert_equal(er['output_type'], 'execute_result')
108 108
109 109 def test_stream():
General Comments 0
You need to be logged in to leave comments. Login now