Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions docs/getting_started/tutorial_output.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,9 @@
"\n",
"# Create animation\n",
"anim = FuncAnimation(fig, animate, frames=nframes, interval=100)\n",
"plt.close(fig)\n",
"anim"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
44 changes: 13 additions & 31 deletions docs/user_guide/examples/tutorial_delaystart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"metadata": {},
"outputs": [],
"source": [
"from datetime import timedelta\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xarray as xr\n",
"from IPython.display import HTML\n",
"from matplotlib.animation import FuncAnimation\n",
"\n",
"import parcels"
"import parcels\n",
"\n",
"# for interactive display of animations\n",
"plt.rcParams[\"animation.html\"] = \"jshtml\""
]
},
{
Expand Down Expand Up @@ -138,8 +138,6 @@
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"\n",
"ds_particles = xr.open_zarr(\"delayparticle_time.zarr\")\n",
"\n",
"fig = plt.figure(figsize=(7, 5), constrained_layout=True)\n",
Expand Down Expand Up @@ -173,16 +171,9 @@
" )\n",
"\n",
"\n",
"anim = FuncAnimation(fig, animate, frames=len(timerange), interval=100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"HTML(anim.to_jshtml())"
"anim = FuncAnimation(fig, animate, frames=len(timerange), interval=100)\n",
"plt.close()\n",
"anim"
]
},
{
Expand Down Expand Up @@ -261,13 +252,13 @@
"outputs": [],
"source": [
"output_file = parcels.ParticleFile(\n",
" \"delayparticle_releasedt.zarr\", outputdt=timedelta(hours=1)\n",
" \"delayparticle_releasedt.zarr\", outputdt=np.timedelta64(1, \"h\")\n",
")\n",
"\n",
"pset.execute(\n",
" parcels.kernels.AdvectionRK4,\n",
" runtime=timedelta(hours=24),\n",
" dt=timedelta(minutes=5),\n",
" runtime=np.timedelta64(24, \"h\"),\n",
" dt=np.timedelta64(5, \"h\"),\n",
" output_file=output_file,\n",
")"
]
Expand All @@ -286,8 +277,6 @@
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"\n",
"ds_particles = xr.open_zarr(\"delayparticle_releasedt.zarr\")\n",
"\n",
"fig = plt.figure(figsize=(7, 5), constrained_layout=True)\n",
Expand Down Expand Up @@ -321,16 +310,9 @@
" )\n",
"\n",
"\n",
"anim = FuncAnimation(fig, animate, frames=len(timerange), interval=100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"HTML(anim.to_jshtml())"
"anim = FuncAnimation(fig, animate, frames=len(timerange), interval=100)\n",
"plt.close(fig)\n",
"anim"
]
},
{
Expand Down