Skip to content

Commit ef373f9

Browse files
committed
fix example
1 parent 6407acc commit ef373f9

9 files changed

+46
-29
lines changed

examples/param_worksheet/ParamExample.ipynb

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
"outputs": [],
3030
"source": [
3131
"# default settings so we can run/debug this worksheet as is\n",
32-
"date = datetime.date(2022, 8, 20)\n",
32+
"run_date = datetime.date(2022, 8, 20)\n",
3333
"n = 10"
3434
]
3535
},
3636
{
3737
"cell_type": "code",
38-
"execution_count": 3,
38+
"execution_count": null,
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
@@ -75,7 +75,7 @@
7575
"# show the incoming parameter in formatted text.\n",
7676
"display(\n",
7777
" Markdown(\n",
78-
" f'This worksheet is reporting on \"{date}\".'\n",
78+
" f'This worksheet is reporting on \"{run_date}\".'\n",
7979
" )\n",
8080
")"
8181
]
@@ -93,9 +93,18 @@
9393
"execution_count": 5,
9494
"metadata": {},
9595
"outputs": [],
96+
"source": [
97+
"# set Seaborn theme\n",
98+
"sns.set_theme()\n"
99+
]
100+
},
101+
{
102+
"cell_type": "code",
103+
"execution_count": 6,
104+
"metadata": {},
105+
"outputs": [],
96106
"source": [
97107
"# example from https://seaborn.pydata.org/tutorial/aesthetics.html\n",
98-
"sns.set_theme()\n",
99108
"def sinplot(n=10, flip=1):\n",
100109
" x = np.linspace(0, 14, 100)\n",
101110
" for i in range(1, n + 1):\n",
@@ -104,7 +113,7 @@
104113
},
105114
{
106115
"cell_type": "code",
107-
"execution_count": 6,
116+
"execution_count": 7,
108117
"metadata": {},
109118
"outputs": [
110119
{
@@ -119,8 +128,10 @@
119128
}
120129
],
121130
"source": [
131+
"# make a plot\n",
122132
"sinplot(n=n)\n",
123-
"_ = plt.title(f\"n={n}\")"
133+
"plt.title(f\"n={n}\")\n",
134+
"plt.show() # sometimes doing this explicitly is worth it"
124135
]
125136
}
126137
],
@@ -140,7 +151,7 @@
140151
"name": "python",
141152
"nbconvert_exporter": "python",
142153
"pygments_lexer": "ipython3",
143-
"version": "3.9.16 (main, Jan 11 2023, 10:02:19) \n[Clang 14.0.6 ]"
154+
"version": "3.9.16"
144155
},
145156
"orig_nbformat": 4,
146157
"vscode": {

examples/param_worksheet/ParamExample_2022-08-19_10.html renamed to examples/param_worksheet/ParamExample_10_2022-08-19.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14638,7 +14638,7 @@
1463814638

1463914639

1464014640
<div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-OutputArea-output " data-mime-type="text/markdown">
14641-
<p>This worksheet is reporting on &quot;2022-08-20&quot;.</p>
14641+
<p>This worksheet is reporting on &quot;2022-08-19&quot;.</p>
1464214642

1464314643
</div>
1464414644

@@ -14662,6 +14662,8 @@
1466214662
</div>
1466314663
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs jp-mod-noInput ">
1466414664

14665+
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs jp-mod-noInput ">
14666+
1466514667
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noInput ">
1466614668

1466714669
<div class="jp-Cell-outputWrapper">
2.22 MB
Loading

examples/param_worksheet/ParamExample_2022-08-20_15.html renamed to examples/param_worksheet/ParamExample_15_2022-08-20.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14662,6 +14662,8 @@
1466214662
</div>
1466314663
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs jp-mod-noInput ">
1466414664

14665+
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs jp-mod-noInput ">
14666+
1466514667
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noInput ">
1466614668

1466714669
<div class="jp-Cell-outputWrapper">

examples/param_worksheet/ParamExample_2022-08-18_5.html renamed to examples/param_worksheet/ParamExample_5_2022-08-18.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14638,7 +14638,7 @@
1463814638

1463914639

1464014640
<div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-OutputArea-output " data-mime-type="text/markdown">
14641-
<p>This worksheet is reporting on &quot;2022-08-20&quot;.</p>
14641+
<p>This worksheet is reporting on &quot;2022-08-18&quot;.</p>
1464214642

1464314643
</div>
1464414644

@@ -14662,6 +14662,8 @@
1466214662
</div>
1466314663
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs jp-mod-noInput ">
1466414664

14665+
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs jp-mod-noInput ">
14666+
1466514667
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noInput ">
1466614668

1466714669
<div class="jp-Cell-outputWrapper">
2.22 MB
Loading

examples/param_worksheet/run_examples.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
tasks = [
1414
JTask(
1515
sheet_name="ParamExample",
16-
output_suffix=f"_{value_map['d']}_{value_map['n']}",
16+
output_suffix=f"_{value_map['n']}_{value_map['run_date']}",
1717
exclude_input=True,
1818
init_code=f"""
1919
import datetime
2020
worksheet_params = {repr(value_map)}
21-
""", strict=False
21+
""",
2222
)
2323
for value_map in [
24-
{"n": 5, "d": datetime.date(2022, 8, 18)},
25-
{"n": 10, "d": datetime.date(2022, 8, 19)},
26-
{"n": 15, "d": datetime.date(2022, 8, 20)},
24+
{"n": 5, "run_date": datetime.date(2022, 8, 18)},
25+
{"n": 10, "run_date": datetime.date(2022, 8, 19)},
26+
{"n": 15, "run_date": datetime.date(2022, 8, 20)},
2727
]
2828
]
2929
print("starting tasks:")

examples/param_worksheet/run_log.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
starting tasks:
22
[JTask(
33
sheet_name= 'ParamExample',
4-
output_suffix= '_2022-08-18_5',
4+
output_suffix= '_5_2022-08-18',
55
exclude_input= True,
6-
init_code= "\nimport datetime\nworksheet_params = {'n': 5, 'd': datetime.date(2022, 8, 18)}\n",
6+
init_code= "\nimport datetime\nworksheet_params = {'n': 5, 'run_date': datetime.date(2022, 8, 18)}\n",
77
path_prefix= None,
88
),
99
JTask(
1010
sheet_name= 'ParamExample',
11-
output_suffix= '_2022-08-19_10',
11+
output_suffix= '_10_2022-08-19',
1212
exclude_input= True,
13-
init_code= "\nimport datetime\nworksheet_params = {'n': 10, 'd': datetime.date(2022, 8, 19)}\n",
13+
init_code= "\nimport datetime\nworksheet_params = {'n': 10, 'run_date': datetime.date(2022, 8, 19)}\n",
1414
path_prefix= None,
1515
),
1616
JTask(
1717
sheet_name= 'ParamExample',
18-
output_suffix= '_2022-08-20_15',
18+
output_suffix= '_15_2022-08-20',
1919
exclude_input= True,
20-
init_code= "\nimport datetime\nworksheet_params = {'n': 15, 'd': datetime.date(2022, 8, 20)}\n",
20+
init_code= "\nimport datetime\nworksheet_params = {'n': 15, 'run_date': datetime.date(2022, 8, 20)}\n",
2121
path_prefix= None,
2222
)]
23-
start render_as_html "ParamExample.ipynb" "_2022-08-19_10" 2023-01-22 10:15:44.727280
24-
done render_as_html "ParamExample_2022-08-19_10.html" 2023-01-22 10:15:47.581793
25-
start render_as_html "ParamExample.ipynb" "_2022-08-20_15" 2023-01-22 10:15:44.727305
26-
done render_as_html "ParamExample_2022-08-20_15.html" 2023-01-22 10:15:47.599934
27-
start render_as_html "ParamExample.ipynb" "_2022-08-18_5" 2023-01-22 10:15:44.727987
28-
done render_as_html "ParamExample_2022-08-18_5.html" 2023-01-22 10:15:47.740577
23+
start render_as_html "ParamExample.ipynb" "_5_2022-08-18" 2023-01-22 13:15:53.226685
24+
done render_as_html "ParamExample_5_2022-08-18.html" 2023-01-22 13:15:56.222264
25+
start render_as_html "ParamExample.ipynb" "_10_2022-08-19" 2023-01-22 13:15:53.229997
26+
done render_as_html "ParamExample_10_2022-08-19.html" 2023-01-22 13:15:56.222623
27+
start render_as_html "ParamExample.ipynb" "_15_2022-08-20" 2023-01-22 13:15:53.231890
28+
done render_as_html "ParamExample_15_2022-08-20.html" 2023-01-22 13:15:56.265349
2929
Loading page (1/2)
30-
[> ] 0%[======> ] 10%[============================> ] 48%[=============================> ] 49%[=================================================> ] 82%[======================================================> ] 90%[======================================================> ] 90%[============================================================] 100%Rendering (2/2)
30+
[> ] 0%[======> ] 10%[============================> ] 48%[============================> ] 48%[===================================================> ] 85%[======================================================> ] 90%[======================================================> ] 90%[============================================================] 100%Rendering (2/2)
3131
[> ] 0%[===============> ] 25%[============================================================] 100%Done
3232
Loading page (1/2)
33-
[> ] 0%[======> ] 10%[============================> ] 48%[=============================> ] 49%[===================================================> ] 85%[======================================================> ] 90%[======================================================> ] 90%[============================================================] 100%Rendering (2/2)
33+
[> ] 0%[======> ] 10%[============================> ] 48%[=============================> ] 49%[===================================================> ] 86%[======================================================> ] 90%[======================================================> ] 90%[============================================================] 100%Rendering (2/2)
3434
[> ] 0%[===============> ] 25%[============================================================] 100%Done
3535
Loading page (1/2)
36-
[> ] 0%[======> ] 10%[============================> ] 48%[=============================> ] 49%[===================================================> ] 86%[======================================================> ] 90%[======================================================> ] 90%[============================================================] 100%Rendering (2/2)
36+
[> ] 0%[======> ] 10%[============================> ] 48%[============================> ] 48%[=================================================> ] 82%[======================================================> ] 90%[======================================================> ] 90%[============================================================] 100%Rendering (2/2)
3737
[> ] 0%[===============> ] 25%[============================================================] 100%Done

0 commit comments

Comments
 (0)