Skip to content

Commit dddfef7

Browse files
committed
notebooks: update to work with flakes
1 parent 412eb09 commit dddfef7

40 files changed

+3843
-4306
lines changed

_data/python-pfhub/notebooks/test.ipynb

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": 7,
1616
"id": "occupied-accuracy",
1717
"metadata": {},
1818
"outputs": [
@@ -38,7 +38,12 @@
3838
"source": [
3939
"from pfhub.main import line_plot, levelset_plot, get_table_data_style, plot_order_of_accuracy, get_result_data\n",
4040
"from itables import init_notebook_mode\n",
41-
"init_notebook_mode(all_interactive=True);"
41+
"init_notebook_mode(all_interactive=True);\n",
42+
"\n",
43+
"from pathlib import Path\n",
44+
"\n",
45+
"cwd = Path().resolve()\n",
46+
"benchmark_path = f'{cwd}/../../simulation_list.yaml'"
4247
]
4348
},
4449
{
@@ -7072,7 +7077,8 @@
70727077
" x='time (s)',\n",
70737078
" y='Free Energy',\n",
70747079
" title=\"Free Energy, <i>r</i><sub>0</sub>=0.99<i>r</i><sup>*</sup>\"\n",
7075-
" )\n",
7080+
" ),\n",
7081+
" benchmark_path=benchmark_path\n",
70767082
")"
70777083
]
70787084
},
@@ -14078,7 +14084,8 @@
1407814084
" x='time (s)',\n",
1407914085
" y='Solid Fraction',\n",
1408014086
" title=\"Solid Fraction, <i>r</i><sub>0</sub>=0.99<i>r</i><sup>*</sup>\"\n",
14081-
" )\n",
14087+
" ),\n",
14088+
" benchmark_path=benchmark_path\n",
1408214089
")"
1408314090
]
1408414091
},
@@ -21084,7 +21091,8 @@
2108421091
" x='time (s)',\n",
2108521092
" y='Free Energy',\n",
2108621093
" title=\"Free Energy, <i>r</i><sub>0</sub>=<i>r</i><sup>*</sup>\"\n",
21087-
" )\n",
21094+
" ),\n",
21095+
" benchmark_path=benchmark_path\n",
2108821096
")"
2108921097
]
2109021098
},
@@ -28090,7 +28098,8 @@
2809028098
" x='time (s)',\n",
2809128099
" y='Solid Fraction',\n",
2809228100
" title=\"Solid Fraction, <i>r</i><sub>0</sub>=<i>r</i><sup>*</sup>\"\n",
28093-
" )\n",
28101+
" ),\n",
28102+
" benchmark_path=benchmark_path\n",
2809428103
")"
2809528104
]
2809628105
},
@@ -35096,7 +35105,8 @@
3509635105
" x='time (s)',\n",
3509735106
" y='Free Energy',\n",
3509835107
" title=\"Free Energy, <i>r</i><sub>0</sub>=1.01<i>r</i><sup>*</sup>\"\n",
35099-
" )\n",
35108+
" ),\n",
35109+
" benchmark_path=benchmark_path\n",
3510035110
")"
3510135111
]
3510235112
},
@@ -42102,7 +42112,8 @@
4210242112
" x='time (s)',\n",
4210342113
" y='Solid Fraction',\n",
4210442114
" title=\"Solid Fraction, <i>r</i><sub>0</sub>=1.01<i>r</i><sup>*</sup>\"\n",
42105-
" )\n",
42115+
" ),\n",
42116+
" benchmark_path=benchmark_path\n",
4210642117
")"
4210742118
]
4210842119
},
@@ -48558,7 +48569,7 @@
4855848569
"source": [
4855948570
"#PYTEST_VALIDATE_IGNORE_OUTPUT\n",
4856048571
"\n",
48561-
"data = get_result_data(['phase_field_1'], ['8a.1'], ['x', 'y', 'z'])\n",
48572+
"data = get_result_data(['phase_field_1'], ['8a.1'], ['x', 'y', 'z'], benchmark_path=benchmark_path)\n",
4856248573
"\n",
4856348574
"levelset_plot(\n",
4856448575
" data,\n",
@@ -55022,7 +55033,7 @@
5502255033
}
5502355034
],
5502455035
"source": [
55025-
"data = get_result_data(['phase_field_2'], ['8a.1'], ['x', 'y', 'z'])\n",
55036+
"data = get_result_data(['phase_field_2'], ['8a.1'], ['x', 'y', 'z'], benchmark_path=benchmark_path)\n",
5502655037
"\n",
5502755038
"levelset_plot(\n",
5502855039
" data,\n",
@@ -78333,7 +78344,7 @@
7833378344
}
7833478345
],
7833578346
"source": [
78336-
"data = get_result_data(['phase_field_3'], ['8a.1'], ['x', 'y', 'z'])\n",
78347+
"data = get_result_data(['phase_field_3'], ['8a.1'], ['x', 'y', 'z'], benchmark_path=benchmark_path)\n",
7833778348
"\n",
7833878349
"levelset_plot(\n",
7833978350
" data,\n",
@@ -79354,7 +79365,7 @@
7935479365
"keys = ['x', 'y', 'z']\n",
7935579366
"\n",
7935679367
"data_names = ['phase_field_3', 'phase_field_4', 'phase_field_5']\n",
79357-
"df = get_result_data(data_names, ['8a.1'], keys=keys)\n",
79368+
"df = get_result_data(data_names, ['8a.1'], keys=keys, benchmark_path=benchmark_path)\n",
7935879369
"\n",
7935979370
"plot_order_of_accuracy(\n",
7936079371
" df,\n",
@@ -79455,7 +79466,7 @@
7945579466
"#PYTEST_VALIDATE_IGNORE_OUTPUT\n",
7945679467
"\n",
7945779468
"init_notebook_mode(False)\n",
79458-
"get_table_data_style('8a.1')"
79469+
"get_table_data_style('8a.1', benchmark_path=benchmark_path)"
7945979470
]
7946079471
},
7946179472
{

0 commit comments

Comments
 (0)