Skip to content

Commit 565c59d

Browse files
committed
fix ci
1 parent ee2433b commit 565c59d

File tree

3 files changed

+39
-29
lines changed

3 files changed

+39
-29
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mamba installed.)
2323
## How to use
2424

2525
Use
26-
[`CaptureShell`](https://fastai.github.io/execnb/shell.html#captureshell)
26+
[`CaptureShell`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell)
2727
to run Jupyter code and capture notebook outputs, without running a
2828
Jupyter server (or even having it installed):
2929

@@ -44,7 +44,7 @@ s.run('1+1')
4444
'execution_count': 1}]
4545

4646
To execute a notebook and save it with outputs filled in, use
47-
[`CaptureShell.execute`](https://fastai.github.io/execnb/shell.html#captureshell.execute):
47+
[`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
4848

4949
``` python
5050
try:
@@ -56,7 +56,7 @@ finally: Path('tmp.ipynb').unlink()
5656
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': 3, 'metadata': {}, 'output_type': 'execute_result'}]
5757

5858
You can also execute notebooks from the command line with
59-
[`exec_nb`](https://fastai.github.io/execnb/shell.html#exec_nb):
59+
[`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
6060

6161
``` python
6262
!exec_nb --help

nbs/02_shell.ipynb

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@
781781
"text/plain": [
782782
"[{'name': 'stdout',\n",
783783
" 'output_type': 'stream',\n",
784-
" 'text': ['CPU times: user 1 us, sys: 0 ns, total: 1 us\\n',\n",
785-
" 'Wall time: 4.05 us\\n'],\n",
784+
" 'text': ['CPU times: user 2 us, sys: 1 us, total: 3 us\\n',\n",
785+
" 'Wall time: 4.29 us\\n'],\n",
786786
" 'execution_count': None},\n",
787787
" {'data': {'text/plain': ['2']},\n",
788788
" 'metadata': {},\n",
@@ -1025,7 +1025,7 @@
10251025
"File <ipython-input-1-a5c3817716b6>:1\n",
10261026
"----> 1 import time; time.sleep(1.1)\n",
10271027
"\n",
1028-
"Cell In[6], line 7, in run_cell.<locals>.handler(*args)\n",
1028+
"Cell In[143], line 7, in run_cell.<locals>.handler(*args)\n",
10291029
"----> 7 def handler(*args): raise TimeoutError()\n",
10301030
"\n",
10311031
"TimeoutError: \n",
@@ -1064,7 +1064,7 @@
10641064
"File <span class=\"ansi-green-fg\">&lt;ipython-input-1-a5c3817716b6&gt;:1</span>\n",
10651065
"<span class=\"ansi-green-fg\">----&gt; 1</span> <span class=\"ansi-bold\" style=\"color: rgb(0,135,0)\">import</span> <span class=\"ansi-bold\" style=\"color: rgb(0,0,255)\">time</span>; time<span style=\"color: rgb(98,98,98)\">.</span>sleep(<span style=\"color: rgb(98,98,98)\">1.1</span>)\n",
10661066
"\n",
1067-
"Cell <span class=\"ansi-green-fg\">In[6], line 7</span>, in <span class=\"ansi-cyan-fg\">run_cell.&lt;locals&gt;.handler</span><span class=\"ansi-blue-fg\">(*args)</span>\n",
1067+
"Cell <span class=\"ansi-green-fg\">In[143], line 7</span>, in <span class=\"ansi-cyan-fg\">run_cell.&lt;locals&gt;.handler</span><span class=\"ansi-blue-fg\">(*args)</span>\n",
10681068
"<span class=\"ansi-green-fg\">----&gt; 7</span> <span class=\"ansi-bold\" style=\"color: rgb(0,135,0)\">def</span> <span style=\"color: rgb(0,0,255)\">handler</span>(<span style=\"color: rgb(98,98,98)\">*</span>args): <span class=\"ansi-bold\" style=\"color: rgb(0,135,0)\">raise</span> <span class=\"ansi-bold\" style=\"color: rgb(215,95,95)\">TimeoutError</span>()\n",
10691069
"\n",
10701070
"<span class=\"ansi-red-fg\">TimeoutError</span>: \n",
@@ -1465,7 +1465,8 @@
14651465
"[{'data': {'text/plain': ['<IPython.core.display.Markdown object>'],\n",
14661466
" 'text/markdown': [\"This is *bold*. Here's a [link](https://www.fast.ai).\"]},\n",
14671467
" 'metadata': {},\n",
1468-
" 'output_type': 'execute_result'}]"
1468+
" 'output_type': 'execute_result',\n",
1469+
" 'execution_count': None}]"
14691470
]
14701471
},
14711472
"execution_count": null,
@@ -1520,11 +1521,13 @@
15201521
" 'File \\x1b[0;32m<ipython-input-1-1c97c1d317ab>:1\\x1b[0m\\n',\n",
15211522
" '\\x1b[0;32m----> 1\\x1b[0m \\x1b[38;5;28;01mraise\\x1b[39;00m \\x1b[38;5;167;01mException\\x1b[39;00m(\\x1b[38;5;124m\"\\x1b[39m\\x1b[38;5;124mOopsie!\\x1b[39m\\x1b[38;5;124m\"\\x1b[39m)\\n',\n",
15221523
" '\\n',\n",
1523-
" '\\x1b[0;31mException\\x1b[0m: Oopsie!\\n']},\n",
1524+
" '\\x1b[0;31mException\\x1b[0m: Oopsie!\\n'],\n",
1525+
" 'execution_count': None},\n",
15241526
" {'ename': 'Exception',\n",
15251527
" 'evalue': 'Oopsie!',\n",
15261528
" 'output_type': 'error',\n",
1527-
" 'traceback': 'Traceback (most recent call last):\\n File \"/Users/jhoward/miniconda3/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\\n exec(code_obj, self.user_global_ns, self.user_ns)\\n File \"<ipython-input-1-1c97c1d317ab>\", line 1, in <module>\\n raise Exception(\"Oopsie!\")\\nException: Oopsie!\\n'}]"
1529+
" 'traceback': 'Traceback (most recent call last):\\n File \"/Users/jhoward/miniconda3/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\\n exec(code_obj, self.user_global_ns, self.user_ns)\\n File \"<ipython-input-1-1c97c1d317ab>\", line 1, in <module>\\n raise Exception(\"Oopsie!\")\\nException: Oopsie!\\n',\n",
1530+
" 'execution_count': None}]"
15281531
]
15291532
},
15301533
"execution_count": null,
@@ -1613,10 +1616,14 @@
16131616
{
16141617
"data": {
16151618
"text/plain": [
1616-
"[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']},\n",
1619+
"[{'name': 'stdout',\n",
1620+
" 'output_type': 'stream',\n",
1621+
" 'text': ['1\\n'],\n",
1622+
" 'execution_count': None},\n",
16171623
" {'data': {'text/plain': ['2']},\n",
16181624
" 'metadata': {},\n",
1619-
" 'output_type': 'execute_result'}]"
1625+
" 'output_type': 'execute_result',\n",
1626+
" 'execution_count': None}]"
16201627
]
16211628
},
16221629
"execution_count": null,
@@ -1679,7 +1686,7 @@
16791686
"name": "stdout",
16801687
"output_type": "stream",
16811688
"text": [
1682-
"[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']}, {'data': {'text/plain': ['2']}, 'metadata': {}, 'output_type': 'execute_result'}]\n"
1689+
"[{'execution_count': None, 'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']}, {'data': {'text/plain': ['2']}, 'execution_count': None, 'metadata': {}, 'output_type': 'execute_result'}]\n"
16831690
]
16841691
}
16851692
],
@@ -1741,11 +1748,11 @@
17411748
"\n",
17421749
"While Executing Cell #2:\n",
17431750
"Traceback (most recent call last):\n",
1744-
" File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_18616/1421292703.py\", line 3, in <module>\n",
1751+
" File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_6273/1421292703.py\", line 3, in <module>\n",
17451752
" s.execute('../tests/error.ipynb', exc_stop=True)\n",
1746-
" File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_18616/3609882568.py\", line 18, in execute\n",
1753+
" File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_6273/3609882568.py\", line 18, in execute\n",
17471754
" self.run_all(nb, exc_stop=exc_stop, preproc=preproc, postproc=postproc,\n",
1748-
" File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_18616/3068237356.py\", line 19, in run_all\n",
1755+
" File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_6273/3068237356.py\", line 19, in run_all\n",
17491756
" if self.exc and exc_stop: raise self.exc from None\n",
17501757
" ^^^^^^^^^^^^^^^^^^^^^^^^\n",
17511758
" File \"/Users/jhoward/miniconda3/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\n",
@@ -1843,9 +1850,9 @@
18431850
"#|hide\n",
18441851
"# `display_data` flushes stdout and stderr - in that order\n",
18451852
"res = CaptureShell().run(\"import sys; sys.stderr.write('Error!'); print(1); display(1)\")\n",
1846-
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']},\n",
1847-
" {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!']},\n",
1848-
" {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data'}])"
1853+
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n'], 'execution_count': None},\n",
1854+
" {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!'], 'execution_count': None},\n",
1855+
" {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data', 'execution_count': None}])"
18491856
]
18501857
},
18511858
{
@@ -1857,7 +1864,7 @@
18571864
"#|hide\n",
18581865
"# Consecutive writes to stdout are grouped\n",
18591866
"res = CaptureShell().run('print(1); print(2); print(3)')\n",
1860-
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n']}])"
1867+
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n'], 'execution_count': None}])"
18611868
]
18621869
},
18631870
{
@@ -1869,8 +1876,8 @@
18691876
"#|hide\n",
18701877
"# Consecutive writes to stdout are grouped despite an intermediate write to stderr, which is captured after\n",
18711878
"res = CaptureShell().run(\"import sys; print(1); print(2); sys.stderr.write('Error!'); print(3)\")\n",
1872-
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n']},\n",
1873-
" {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!']}])"
1879+
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n'], 'execution_count': None},\n",
1880+
" {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!'], 'execution_count': None}])"
18741881
]
18751882
},
18761883
{
@@ -1882,10 +1889,10 @@
18821889
"#|hide\n",
18831890
"# `execute_result` is always last\n",
18841891
"res = CaptureShell().run(\"import sys; sys.stderr.write('Error!'); print(1); display(1); 1\")\n",
1885-
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']},\n",
1886-
" {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!']},\n",
1887-
" {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data'},\n",
1888-
" {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'execute_result'}])"
1892+
"test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n'], 'execution_count': None},\n",
1893+
" {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!'], 'execution_count': None},\n",
1894+
" {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data', 'execution_count': None},\n",
1895+
" {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'execute_result', 'execution_count': None}])"
18891896
]
18901897
},
18911898
{
@@ -1947,7 +1954,10 @@
19471954
" 'execution_count': None,\n",
19481955
" 'id': 'ea528db5',\n",
19491956
" 'metadata': {},\n",
1950-
" 'outputs': [{'name': 'stdout', 'output_type': 'stream', 'text': ['2\\n']}],\n",
1957+
" 'outputs': [{'name': 'stdout',\n",
1958+
" 'output_type': 'stream',\n",
1959+
" 'text': ['2\\n'],\n",
1960+
" 'execution_count': None}],\n",
19511961
" 'source': 'print(a)',\n",
19521962
" 'idx_': 1}]"
19531963
]

nbs/nbdev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project:
33

44
website:
55
title: "execnb"
6-
site-url: "https://fastai.github.io/execnb/"
6+
site-url: "https://AnswerDotAI.github.io/execnb/"
77
description: "A description of your project"
88
repo-branch: master
9-
repo-url: "https://github.com/fastai/execnb/"
9+
repo-url: "https://github.com/AnswerDotAI/execnb/"

0 commit comments

Comments
 (0)