Skip to content

Commit 9fe8433

Browse files
run simulations in tutorials on CI; merge duplicated files for settings and simulation acros condensation tutorial and Pyrcel example (#1600)
1 parent 0ebdb7d commit 9fe8433

File tree

5 files changed

+2492
-265
lines changed

5 files changed

+2492
-265
lines changed

examples/PySDM_examples/Pyrcel/simulation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def _save(self, output):
9191
attr[drop_id].append(attr_data[drop_id])
9292
super()._save(output)
9393

94-
def run(self):
94+
def run(self, observers=()):
95+
for observer in observers:
96+
self.particulator.observers.append(observer)
9597
output_products = super()._run(
9698
self.settings.nt, self.settings.steps_per_output_interval
9799
)

examples/PySDM_examples/Pyrcel/tutorial_settings.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

examples/PySDM_examples/Pyrcel/tutorial_simulation.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

tutorials/collisions/collisions_playground.ipynb

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"cell_type": "code",
2525
"metadata": {
2626
"ExecuteTime": {
27-
"end_time": "2024-12-05T22:12:53.537976Z",
28-
"start_time": "2024-12-05T22:12:53.509740Z"
27+
"end_time": "2025-05-15T15:58:05.775543Z",
28+
"start_time": "2025-05-15T15:58:05.772087Z"
2929
}
3030
},
3131
"source": [
@@ -36,7 +36,7 @@
3636
" pip_install_on_colab('PySDM-examples')"
3737
],
3838
"outputs": [],
39-
"execution_count": 5
39+
"execution_count": 6
4040
},
4141
{
4242
"metadata": {},
@@ -72,8 +72,8 @@
7272
"cell_type": "code",
7373
"metadata": {
7474
"ExecuteTime": {
75-
"end_time": "2024-12-05T22:12:53.555929Z",
76-
"start_time": "2024-12-05T22:12:53.542388Z"
75+
"end_time": "2025-05-15T15:58:05.785980Z",
76+
"start_time": "2025-05-15T15:58:05.784129Z"
7777
}
7878
},
7979
"source": [
@@ -92,14 +92,14 @@
9292
"from PySDM_examples.Shima_et_al_2009.tutorial_example import run"
9393
],
9494
"outputs": [],
95-
"execution_count": 6
95+
"execution_count": 7
9696
},
9797
{
9898
"cell_type": "code",
9999
"metadata": {
100100
"ExecuteTime": {
101-
"end_time": "2024-12-05T22:12:53.589430Z",
102-
"start_time": "2024-12-05T22:12:53.577604Z"
101+
"end_time": "2025-05-15T15:58:05.797240Z",
102+
"start_time": "2025-05-15T15:58:05.792780Z"
103103
}
104104
},
105105
"source": [
@@ -128,7 +128,7 @@
128128
" plotter.show()"
129129
],
130130
"outputs": [],
131-
"execution_count": 7
131+
"execution_count": 8
132132
},
133133
{
134134
"cell_type": "markdown",
@@ -151,8 +151,8 @@
151151
"is_executing": true
152152
},
153153
"ExecuteTime": {
154-
"end_time": "2024-12-05T22:12:55.865731Z",
155-
"start_time": "2024-12-05T22:12:53.596622Z"
154+
"end_time": "2025-05-15T15:58:07.011791Z",
155+
"start_time": "2025-05-15T15:58:05.806155Z"
156156
}
157157
},
158158
"source": [
@@ -174,7 +174,9 @@
174174
"progbar = widgets.IntProgress(min=0, max=100, description='%')\n",
175175
"\n",
176176
"if 'CI' not in os.environ:\n",
177-
" widgets.display(sliders, boxes, progbar, widgets.interactive_output(demo, inputs))"
177+
" widgets.display(sliders, boxes, progbar, widgets.interactive_output(demo, inputs))\n",
178+
"else:\n",
179+
" demo(**{k:v.value for k,v in inputs.items()})"
178180
],
179181
"outputs": [
180182
{
@@ -185,7 +187,7 @@
185187
"application/vnd.jupyter.widget-view+json": {
186188
"version_major": 2,
187189
"version_minor": 0,
188-
"model_id": "bdfd1e87e43745bebed2fee0a1bc4c5f"
190+
"model_id": "3496ed2134e4414eaa22d17c076cadd3"
189191
}
190192
},
191193
"metadata": {},
@@ -199,7 +201,7 @@
199201
"application/vnd.jupyter.widget-view+json": {
200202
"version_major": 2,
201203
"version_minor": 0,
202-
"model_id": "76294dfff7c94e12a6c7bc50d74b2b70"
204+
"model_id": "93a049b67eb841fd922feab04fddbc06"
203205
}
204206
},
205207
"metadata": {},
@@ -213,7 +215,7 @@
213215
"application/vnd.jupyter.widget-view+json": {
214216
"version_major": 2,
215217
"version_minor": 0,
216-
"model_id": "a698fc09aef847e28bf5b94321de4d19"
218+
"model_id": "40f367276c294cecbe7b87c0d53a698a"
217219
}
218220
},
219221
"metadata": {},
@@ -227,14 +229,14 @@
227229
"application/vnd.jupyter.widget-view+json": {
228230
"version_major": 2,
229231
"version_minor": 0,
230-
"model_id": "c2a987c930ec456ba119b36c4661d99b"
232+
"model_id": "33aaa5a61fc14d8c9b281049c0cbfb82"
231233
}
232234
},
233235
"metadata": {},
234236
"output_type": "display_data"
235237
}
236238
],
237-
"execution_count": 8
239+
"execution_count": 9
238240
},
239241
{
240242
"cell_type": "markdown",
@@ -255,18 +257,6 @@
255257
"\n",
256258
"4. How does the mean radius of the droplets affect the collision rate? "
257259
]
258-
},
259-
{
260-
"cell_type": "code",
261-
"metadata": {
262-
"ExecuteTime": {
263-
"end_time": "2024-12-05T22:12:55.882614Z",
264-
"start_time": "2024-12-05T22:12:55.881190Z"
265-
}
266-
},
267-
"source": [],
268-
"outputs": [],
269-
"execution_count": null
270260
}
271261
],
272262
"metadata": {

0 commit comments

Comments
 (0)