Skip to content

Commit

Permalink
Merge pull request #1443 from OceanParcels/rerunning_notebooks
Browse files Browse the repository at this point in the history
Updating all tutorials with latest conda environment and parcels v3 code
  • Loading branch information
erikvansebille authored Oct 10, 2023
2 parents 2f721d1 + 4d4b5eb commit 8597833
Show file tree
Hide file tree
Showing 25 changed files with 60,434 additions and 59,745 deletions.
719 changes: 368 additions & 351 deletions docs/examples/documentation_advanced_zarr.ipynb

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions docs/examples/documentation_geospatial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@
"from lxml import etree\n",
"from shapely.geometry import LineString, Point\n",
"\n",
"from parcels import AdvectionRK4, ErrorCode, FieldSet, JITParticle, ParticleSet\n",
"from parcels import (\n",
" AdvectionRK4,\n",
" FieldSet,\n",
" JITParticle,\n",
" ParticleSet,\n",
" download_example_dataset,\n",
")\n",
"\n",
"DATA_OUTPUT_FOLDER = Path(\"tutorial_geospatial_output\")\n",
"DATA_OUTPUT_FOLDER.mkdir(exist_ok=True)\n",
Expand All @@ -140,16 +146,18 @@
"metadata": {},
"outputs": [
{
"name": "stderr",
"name": "stdout",
"output_type": "stream",
"text": [
"INFO: Compiled ArrayJITParticleAdvectionRK4 ==> /tmp/parcels-1000/libcc2185fa8a93ecc6f43d3f424a40fb67_0.so\n"
"INFO: Output files are stored in tutorial_geospatial_output/agulhas_trajectories.zarr.\n",
"100%|██████████| 10368000.0/10368000.0 [00:15<00:00, 651613.20it/s]\n"
]
}
],
"source": [
"# An example parcels simulation\n",
"filenames = \"GlobCurrent_example_data/20*.nc\"\n",
"data_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
"filenames = filename = str(data_folder / \"20*.nc\")\n",
"variables = {\n",
" \"U\": \"eastward_eulerian_current_velocity\",\n",
" \"V\": \"northward_eulerian_current_velocity\",\n",
Expand All @@ -175,6 +183,7 @@
" if particle.state > 4:\n",
" particle.delete()\n",
"\n",
"\n",
"pset.execute(\n",
" [AdvectionRK4, DeleteParticle],\n",
" runtime=timedelta(days=120),\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/documentation_indexing.ipynb

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/examples/documentation_stuck_particles.ipynb

Large diffs are not rendered by default.

52 changes: 30 additions & 22 deletions docs/examples/documentation_unstuck_Agrid.ipynb

Large diffs are not rendered by default.

156 changes: 85 additions & 71 deletions docs/examples/parcels_tutorial.ipynb

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions docs/examples/tutorial_Argofloats.ipynb

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions docs/examples/tutorial_NestedFields.ipynb

Large diffs are not rendered by default.

53,120 changes: 26,583 additions & 26,537 deletions docs/examples/tutorial_analyticaladvection.ipynb

Large diffs are not rendered by default.

357 changes: 204 additions & 153 deletions docs/examples/tutorial_delaystart.ipynb

Large diffs are not rendered by default.

31 changes: 13 additions & 18 deletions docs/examples/tutorial_diffusion.ipynb

Large diffs are not rendered by default.

64,892 changes: 32,925 additions & 31,967 deletions docs/examples/tutorial_interaction.ipynb

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/examples/tutorial_interpolation.ipynb

Large diffs are not rendered by default.

38 changes: 25 additions & 13 deletions docs/examples/tutorial_jit_vs_scipy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"INFO: Compiled ArrayJITParticleAdvectionRK4 ==> /var/folders/1n/500ln6w97859_nqq86vwpl000000gr/T/parcels-504/libe8a271835dbec54c6df79d8b8421813a_0.so\n",
"(100%) Timer root : 6.879e+00 s\n",
"( 1%) ( 1%) Timer fieldset creation : 7.331e-02 s\n",
"( 76%) ( 76%) Timer scipy : 5.246e+00 s\n",
"( 23%) ( 23%) Timer jit : 1.558e+00 s\n"
"100%|██████████| 3600.0/3600.0 [00:01<00:00, 1843.14it/s]\n",
"100%|██████████| 3600.0/3600.0 [00:00<00:00, 533400.25it/s]\n",
"(100%) Timer root : 3.165e+00 s\n",
"( 3%) ( 3%) Timer fieldset creation : 9.443e-02 s\n",
"( 65%) ( 65%) Timer scipy : 2.073e+00 s\n",
"( 32%) ( 32%) Timer jit : 9.969e-01 s\n"
]
}
],
Expand Down Expand Up @@ -98,7 +99,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"As you can see above, even in this very small example **Scipy mode took almost 5 times as long** (4.7 seconds versus 1.1 seconds) as the JIT mode. For larger examples, this can grow to hundreds of times slower.\n",
"As you can see above, even in this very small example **Scipy mode took more than 2 times as long** (2.1 seconds versus 1.0 seconds) as the JIT mode. For larger examples, this can grow to hundreds of times slower.\n",
"\n",
"This is just an illustrative example, depending on the number of calls to `AdvectionRK4`, the size of the `FieldSet`, the size of the `pset`, the ratio between `dt` and `outputdt` in the `.execute` etc, the difference between JIT and Scipy can vary significantly. However, JIT will almost always be faster!\n",
"\n",
Expand Down Expand Up @@ -166,9 +167,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"(100%) Timer root : 4.803e+00 s\n",
"( 49%) ( 49%) Timer dllt : 2.351e+00 s\n",
"( 51%) ( 51%) Timer dllt_p : 2.445e+00 s\n"
" 0%| | 0/3600.0 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"100%|██████████| 3600.0/3600.0 [00:00<00:00, 4426.66it/s]\n",
"100%|██████████| 3600.0/3600.0 [00:00<00:00, 4111.05it/s]\n",
"(100%) Timer root : 1.705e+00 s\n",
"( 48%) ( 48%) Timer dllt : 8.206e-01 s\n",
"( 52%) ( 52%) Timer dllt_p : 8.785e-01 s\n"
]
}
],
Expand Down Expand Up @@ -241,9 +251,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"(100%) Timer root : 8.433e+00 s\n",
"( 96%) ( 96%) Timer dllt : 8.085e+00 s\n",
"( 4%) ( 4%) Timer dllt_p : 3.461e-01 s\n"
"100%|██████████| 864000.0/864000.0 [00:03<00:00, 243133.93it/s]\n",
"100%|██████████| 864000.0/864000.0 [00:00<00:00, 5615534.75it/s]\n",
"(100%) Timer root : 3.715e+00 s\n",
"( 96%) ( 96%) Timer dllt : 3.558e+00 s\n",
"( 4%) ( 4%) Timer dllt_p : 1.568e-01 s\n"
]
}
],
Expand Down Expand Up @@ -298,7 +310,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 6 additions & 4 deletions docs/examples/tutorial_kernelloop.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/examples/tutorial_nemo_3D.ipynb

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions docs/examples/tutorial_nemo_curvilinear.ipynb

Large diffs are not rendered by default.

572 changes: 67 additions & 505 deletions docs/examples/tutorial_output.ipynb

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/examples/tutorial_parcels_structure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"INFO: Compiled ArrayAgeParticleAgeNorthVelAdvectionRK4 ==> /var/folders/1n/500ln6w97859_nqq86vwpl000000gr/T/parcels-504/libaf3202ef8aa79577647d9631e4f42fe7_0.so\n"
"INFO: Output files are stored in GCParticles.zarr.\n",
"100%|██████████| 2073600.0/2073600.0 [00:04<00:00, 444884.89it/s]\n"
]
}
],
Expand Down Expand Up @@ -433,7 +434,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
21 changes: 15 additions & 6 deletions docs/examples/tutorial_particle_field_interaction.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/examples/tutorial_periodic_boundaries.ipynb

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions docs/examples/tutorial_sampling.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 8597833

Please sign in to comment.