diff --git a/doc/notebooks/01_tutorial_getting_started.ipynb b/doc/notebooks/01_tutorial_getting_started.ipynb index 8ae0745ee5523b794078c22fa840e497a00a9d26..0d5e8378702ca9c450eb6452fe8db81e89a9f253 100644 --- a/doc/notebooks/01_tutorial_getting_started.ipynb +++ b/doc/notebooks/01_tutorial_getting_started.ipynb @@ -943,7 +943,7 @@ " plt.imshow(img);\n", "except ImportError:\n", " print(\"No requests installed\")\n", - " img = None" + " img = np.random.random((82, 290, 4))" ] }, { diff --git a/doc/notebooks/demo_plotting_and_animation.ipynb b/doc/notebooks/demo_plotting_and_animation.ipynb index 07c980788f7617b1bfb8bfad8a13f2f2d7b5c33d..732f33bd01273442dc93898343f53b88343a949e 100644 --- a/doc/notebooks/demo_plotting_and_animation.ipynb +++ b/doc/notebooks/demo_plotting_and_animation.ipynb @@ -408,9 +408,12 @@ } ], "source": [ - "plt.figure()\n", - "animation = plt.scalar_field_animation(run_func, frames=60)\n", - "ps.jupyter.display_as_html_video(animation)" + "if shutil.which(\"ffmpeg\") is not None:\n", + " plt.figure()\n", + " animation = plt.scalar_field_animation(run_func, frames=60)\n", + " ps.jupyter.display_as_html_video(animation)\n", + "else:\n", + " print(\"No ffmpeg installed\")" ] }, { @@ -474,8 +477,11 @@ } ], "source": [ - "animation = plt.surface_plot_animation(run_func, frames=60)\n", - "ps.jupyter.display_as_html_video(animation)" + "if shutil.which(\"ffmpeg\") is not None:\n", + " animation = plt.surface_plot_animation(run_func, frames=60)\n", + " ps.jupyter.display_as_html_video(animation)\n", + "else:\n", + " print(\"No ffmpeg installed\")" ] }, { @@ -636,9 +642,12 @@ } ], "source": [ - "plt.figure()\n", - "animation = plt.vector_field_animation(run_func, frames=60)\n", - "ps.jupyter.display_as_html_video(animation)" + "if shutil.which(\"ffmpeg\") is not None:\n", + " plt.figure()\n", + " animation = plt.vector_field_animation(run_func, frames=60)\n", + " ps.jupyter.display_as_html_video(animation)\n", + "else:\n", + " print(\"No ffmpeg installed\")" ] }, { @@ -671,8 +680,11 @@ } ], "source": [ - "animation = plt.vector_field_magnitude_animation(run_func, frames=60)\n", - "ps.jupyter.display_as_html_video(animation)" + "if shutil.which(\"ffmpeg\") is not None:\n", + " animation = plt.vector_field_magnitude_animation(run_func, frames=60)\n", + " ps.jupyter.display_as_html_video(animation)\n", + "else:\n", + " print(\"No ffmpeg installed\")" ] }, { diff --git a/doc/notebooks/demo_wave_equation.ipynb b/doc/notebooks/demo_wave_equation.ipynb index 007e9a7b5dedb1cd07e6b8d7536bc4fc9d244a18..2aa083d96b33e6b2c69bee0783e1c55b4ab616fd 100644 --- a/doc/notebooks/demo_wave_equation.ipynb +++ b/doc/notebooks/demo_wave_equation.ipynb @@ -471,9 +471,12 @@ " u_arrays[0], u_arrays[1], u_arrays[2] = u_arrays[1], u_arrays[2], u_arrays[0]\n", " return u_arrays[2]\n", " \n", - " ani = plt.surface_plot_animation(run_LLVM, zlim=(-1, 1))\n", " assert np.isfinite(np.max(u_arrays[2]))\n", - "ps.jupyter.display_as_html_video(ani)" + " if shutil.which(\"ffmpeg\") is not None:\n", + " ani = plt.surface_plot_animation(run_LLVM, zlim=(-1, 1))\n", + " ps.jupyter.display_as_html_video(ani)\n", + " else:\n", + " print(\"No ffmpeg installed\")" ] }, {