Skip to content

Commit

Permalink
rerun notebooks and clear numba warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
AgnieszkaZaba committed Dec 10, 2024
1 parent 8d28db4 commit 178a828
Show file tree
Hide file tree
Showing 11 changed files with 1,632 additions and 326 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,15 @@
{
"cell_type": "code",
"id": "23e0cf61",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-08T22:48:58.129587Z",
"start_time": "2024-12-08T22:48:58.078686Z"
}
},
"metadata": {},
"source": [
"if platform.system() != 'Windows':\n",
" for file in glob.glob('output/anim_frame_*.pdf'):\n",
" subprocess.run(['ps2pdf', file, file+'_'], capture_output=True, check=True)\n",
" subprocess.run(['mv', file+'_', file], check=True)"
],
"outputs": [],
"execution_count": 12
"execution_count": null
},
{
"cell_type": "code",
Expand Down
375 changes: 332 additions & 43 deletions examples/PySDM_examples/Arabas_et_al_2023/copula_hello.ipynb

Large diffs are not rendered by default.

54 changes: 46 additions & 8 deletions examples/PySDM_examples/Arabas_et_al_2023/fig_A2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"id": "c6f48049ea08fe2e"
},
{
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:07:17.683093Z",
"start_time": "2024-12-10T19:07:17.680958Z"
}
},
"cell_type": "code",
"source": [
"import sys\n",
Expand All @@ -28,12 +33,17 @@
],
"id": "dba473e974480091",
"outputs": [],
"execution_count": null
"execution_count": 1
},
{
"cell_type": "code",
"id": "7ea1f100",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:07:18.553880Z",
"start_time": "2024-12-10T19:07:17.688797Z"
}
},
"source": [
"import os\n",
"import itertools\n",
Expand All @@ -51,12 +61,17 @@
"from open_atmos_jupyter_utils import show_plot"
],
"outputs": [],
"execution_count": null
"execution_count": 2
},
{
"cell_type": "code",
"id": "a56c35fe",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:07:18.616824Z",
"start_time": "2024-12-10T19:07:18.613867Z"
}
},
"source": [
"CI = 'CI' in os.environ\n",
"\n",
Expand All @@ -83,12 +98,19 @@
" return np.sqrt(np.mean(np.square(actual - expected)))"
],
"outputs": [],
"execution_count": null
"execution_count": 3
},
{
"cell_type": "code",
"id": "6c3ba75d",
"metadata": {},
"metadata": {
"jupyter": {
"is_executing": true
},
"ExecuteTime": {
"start_time": "2024-12-10T19:07:18.628649Z"
}
},
"source": [
"cases = tuple({\"dt\": dt, \"N\": mlt, \"seed\": seed} for dt, mlt, seed in itertools.product(DTS, MLT, SEEDS))\n",
"\n",
Expand Down Expand Up @@ -146,7 +168,23 @@
"with open('output.pkl','wb') as file:\n",
" pickle.dump(output, file)"
],
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"5:262144:0 ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/agnieszkazaba/PycharmProjects/PySDM/PySDM/backends/thrust_rtc.py:74: UserWarning: CUDA is not available, using FakeThrustRTC!\n",
" warnings.warn(\"CUDA is not available, using FakeThrustRTC!\")\n"
]
}
],
"execution_count": null
},
{
Expand Down
89 changes: 72 additions & 17 deletions examples/PySDM_examples/Bartman_et_al_2021/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:08:53.936568Z",
"start_time": "2024-12-10T19:08:53.928270Z"
}
},
"source": [
"import sys\n",
"if 'google.colab' in sys.modules:\n",
Expand All @@ -27,11 +32,16 @@
" pip_install_on_colab('PySDM-examples')"
],
"outputs": [],
"execution_count": null
"execution_count": 1
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:08:56.943705Z",
"start_time": "2024-12-10T19:08:53.955929Z"
}
},
"source": [
"from PySDM_examples.Arabas_et_al_2015 import Settings, SpinUp\n",
"from PySDM_examples.Szumowski_et_al_1998 import Simulation, Storage\n",
Expand All @@ -50,7 +60,7 @@
"from matplotlib.gridspec import GridSpec"
],
"outputs": [],
"execution_count": null
"execution_count": 2
},
{
"cell_type": "code",
Expand Down Expand Up @@ -92,27 +102,72 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:10:16.997824Z",
"start_time": "2024-12-10T19:09:05.454322Z"
}
},
"source": [
"simulation.run(ProgBarController())"
],
"outputs": [],
"execution_count": null
"outputs": [
{
"data": {
"text/plain": [
"FloatProgress(value=0.0, max=1.0)"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "3c3c15bac3554992a2fd3561f7f01169"
}
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": 4
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:10:17.100250Z",
"start_time": "2024-12-10T19:10:17.027190Z"
}
},
"source": [
"temp_file = TemporaryFile('.nc')\n",
"exporter = NetCDFExporter(storage, settings, simulation, temp_file.absolute_path)\n",
"exporter.run(ProgBarController())"
],
"outputs": [],
"execution_count": null
"outputs": [
{
"data": {
"text/plain": [
"FloatProgress(value=0.0, max=1.0)"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "f6e74820c325436f89cb745ba26a8ac5"
}
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": 5
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-10T19:10:17.308418Z",
"start_time": "2024-12-10T19:10:17.105187Z"
}
},
"source": [
"default_figsize = rcParams[\"figure.figsize\"]\n",
"figsize = (1.75 * default_figsize[0], 3.1* default_figsize[1])\n",
Expand Down Expand Up @@ -176,7 +231,7 @@
"pyplot.close(fig)"
],
"outputs": [],
"execution_count": null
"execution_count": 6
},
{
"cell_type": "code",
Expand All @@ -197,8 +252,8 @@
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-08T22:55:44.806466Z",
"start_time": "2024-12-08T22:55:41.828713Z"
"end_time": "2024-12-10T19:15:11.015148Z",
"start_time": "2024-12-10T19:15:10.681211Z"
}
},
"source": [
Expand All @@ -211,19 +266,19 @@
{
"data": {
"text/plain": [
"HTML(value=\"<a href='./tmpnde48zdo.svg' target='_blank'>./tmpnde48zdo.svg</a><br>\")"
"HTML(value=\"<a href='./tmp61kw9k3q.svg' target='_blank'>./tmp61kw9k3q.svg</a><br>\")"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "7391d5bb2d2f46758a7fbb7cbfd010a7"
"model_id": "7b2ea768988f432ebada3f9b5d50a865"
}
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": 8
"execution_count": 13
},
{
"metadata": {},
Expand Down
Loading

0 comments on commit 178a828

Please sign in to comment.