diff --git a/docs/source/examples/notebooks/batch_study.ipynb b/docs/source/examples/notebooks/batch_study.ipynb index 2b9b7b2615..807a368fcc 100644 --- a/docs/source/examples/notebooks/batch_study.ipynb +++ b/docs/source/examples/notebooks/batch_study.ipynb @@ -31,7 +31,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "\n", "# loading up 3 models to compare\n", @@ -224,7 +224,7 @@ "source": [ "# using less number of images in the example\n", "# for a smoother GIF use more images\n", - "batch_study.create_gif(number_of_images=5, duration=0.2)" + "batch_study.create_gif(number_of_images=5, duration=0.2, output_filename=\"batch.gif\")" ] }, { diff --git a/docs/source/examples/notebooks/callbacks.ipynb b/docs/source/examples/notebooks/callbacks.ipynb index 7bcf75f8b2..e4c4295ce1 100644 --- a/docs/source/examples/notebooks/callbacks.ipynb +++ b/docs/source/examples/notebooks/callbacks.ipynb @@ -48,7 +48,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q\n", + "%pip install \"pybamm[plot,cite]\" -q\n", "import pybamm\n", "\n", "model = pybamm.lithium_ion.DFN()\n", diff --git a/docs/source/examples/notebooks/change-settings.ipynb b/docs/source/examples/notebooks/change-settings.ipynb index a7ca997a91..5b21f4dd6b 100644 --- a/docs/source/examples/notebooks/change-settings.ipynb +++ b/docs/source/examples/notebooks/change-settings.ipynb @@ -43,7 +43,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/creating_models/1-an-ode-model.ipynb b/docs/source/examples/notebooks/creating_models/1-an-ode-model.ipynb index fa5d4f9e09..a610700887 100644 --- a/docs/source/examples/notebooks/creating_models/1-an-ode-model.ipynb +++ b/docs/source/examples/notebooks/creating_models/1-an-ode-model.ipynb @@ -36,7 +36,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/docs/source/examples/notebooks/creating_models/2-a-pde-model.ipynb b/docs/source/examples/notebooks/creating_models/2-a-pde-model.ipynb index 2c58e0cb01..c427fd4fe6 100644 --- a/docs/source/examples/notebooks/creating_models/2-a-pde-model.ipynb +++ b/docs/source/examples/notebooks/creating_models/2-a-pde-model.ipynb @@ -41,7 +41,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/docs/source/examples/notebooks/creating_models/3-negative-particle-problem.ipynb b/docs/source/examples/notebooks/creating_models/3-negative-particle-problem.ipynb index 87735951d7..2c338149e7 100644 --- a/docs/source/examples/notebooks/creating_models/3-negative-particle-problem.ipynb +++ b/docs/source/examples/notebooks/creating_models/3-negative-particle-problem.ipynb @@ -58,7 +58,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/examples/notebooks/creating_models/4-comparing-full-and-reduced-order-models.ipynb b/docs/source/examples/notebooks/creating_models/4-comparing-full-and-reduced-order-models.ipynb index 20eb4abced..15d9e8e027 100644 --- a/docs/source/examples/notebooks/creating_models/4-comparing-full-and-reduced-order-models.ipynb +++ b/docs/source/examples/notebooks/creating_models/4-comparing-full-and-reduced-order-models.ipynb @@ -62,7 +62,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/examples/notebooks/creating_models/5-half-cell-model.ipynb b/docs/source/examples/notebooks/creating_models/5-half-cell-model.ipynb index 02b9fda40b..b28d6add1a 100644 --- a/docs/source/examples/notebooks/creating_models/5-half-cell-model.ipynb +++ b/docs/source/examples/notebooks/creating_models/5-half-cell-model.ipynb @@ -71,7 +71,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "\n", diff --git a/docs/source/examples/notebooks/creating_models/6-a-simple-SEI-model.ipynb b/docs/source/examples/notebooks/creating_models/6-a-simple-SEI-model.ipynb index ac34142fab..e383498065 100644 --- a/docs/source/examples/notebooks/creating_models/6-a-simple-SEI-model.ipynb +++ b/docs/source/examples/notebooks/creating_models/6-a-simple-SEI-model.ipynb @@ -123,7 +123,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/experiments-start-time.ipynb b/docs/source/examples/notebooks/experiments-start-time.ipynb index 1b87c48cef..4af1bd6201 100644 --- a/docs/source/examples/notebooks/experiments-start-time.ipynb +++ b/docs/source/examples/notebooks/experiments-start-time.ipynb @@ -36,7 +36,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "from datetime import datetime" ] diff --git a/docs/source/examples/notebooks/expression_tree/broadcasts.ipynb b/docs/source/examples/notebooks/expression_tree/broadcasts.ipynb index aac3bd2995..035fe77ed7 100644 --- a/docs/source/examples/notebooks/expression_tree/broadcasts.ipynb +++ b/docs/source/examples/notebooks/expression_tree/broadcasts.ipynb @@ -24,7 +24,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np" ] diff --git a/docs/source/examples/notebooks/expression_tree/expression-tree.ipynb b/docs/source/examples/notebooks/expression_tree/expression-tree.ipynb index c860198501..b15c8b1d32 100644 --- a/docs/source/examples/notebooks/expression_tree/expression-tree.ipynb +++ b/docs/source/examples/notebooks/expression_tree/expression-tree.ipynb @@ -35,7 +35,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "\n", diff --git a/docs/source/examples/notebooks/getting_started/tutorial-1-how-to-run-a-model.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-1-how-to-run-a-model.ipynb index aae433eb78..aa50147343 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-1-how-to-run-a-model.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-1-how-to-run-a-model.ipynb @@ -34,7 +34,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/getting_started/tutorial-10-creating-a-model.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-10-creating-a-model.ipynb index cb0d30a510..8744e94f7e 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-10-creating-a-model.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-10-creating-a-model.ipynb @@ -40,7 +40,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/getting_started/tutorial-11-creating-a-submodel.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-11-creating-a-submodel.ipynb index 5e68225f7d..a38c0c90ee 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-11-creating-a-submodel.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-11-creating-a-submodel.ipynb @@ -32,7 +32,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/getting_started/tutorial-2-compare-models.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-2-compare-models.ipynb index 0ff4f2902c..aa957be1b3 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-2-compare-models.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-2-compare-models.ipynb @@ -32,7 +32,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/getting_started/tutorial-3-basic-plotting.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-3-basic-plotting.ipynb index 583fb99613..40a02f682a 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-3-basic-plotting.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-3-basic-plotting.ipynb @@ -40,7 +40,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt\n", "\n", diff --git a/docs/source/examples/notebooks/getting_started/tutorial-4-setting-parameter-values.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-4-setting-parameter-values.ipynb index b3c9e256f5..64a345c312 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-4-setting-parameter-values.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-4-setting-parameter-values.ipynb @@ -32,7 +32,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "os.chdir(pybamm.__path__[0]+'/..')" diff --git a/docs/source/examples/notebooks/getting_started/tutorial-5-run-experiments.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-5-run-experiments.ipynb index 831dc0404c..3aad616445 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-5-run-experiments.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-5-run-experiments.ipynb @@ -33,7 +33,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np" ] diff --git a/docs/source/examples/notebooks/getting_started/tutorial-6-managing-simulation-outputs.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-6-managing-simulation-outputs.ipynb index bea655f2b5..3599c37abb 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-6-managing-simulation-outputs.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-6-managing-simulation-outputs.ipynb @@ -42,7 +42,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "model = pybamm.lithium_ion.SPMe()\n", "sim = pybamm.Simulation(model)\n", diff --git a/docs/source/examples/notebooks/getting_started/tutorial-7-model-options.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-7-model-options.ipynb index 338b13f555..96f6e203f2 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-7-model-options.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-7-model-options.ipynb @@ -24,7 +24,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/getting_started/tutorial-8-solver-options.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-8-solver-options.ipynb index b76cfd1f9d..46a7b24346 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-8-solver-options.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-8-solver-options.ipynb @@ -28,7 +28,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/getting_started/tutorial-9-changing-the-mesh.ipynb b/docs/source/examples/notebooks/getting_started/tutorial-9-changing-the-mesh.ipynb index 0e71b218e4..ee4cdc7f63 100644 --- a/docs/source/examples/notebooks/getting_started/tutorial-9-changing-the-mesh.ipynb +++ b/docs/source/examples/notebooks/getting_started/tutorial-9-changing-the-mesh.ipynb @@ -28,7 +28,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/initialize-model-with-solution.ipynb b/docs/source/examples/notebooks/initialize-model-with-solution.ipynb index 758257071e..aba568d33f 100644 --- a/docs/source/examples/notebooks/initialize-model-with-solution.ipynb +++ b/docs/source/examples/notebooks/initialize-model-with-solution.ipynb @@ -23,14 +23,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[33mWARNING: You are using pip version 21.0.1; however, version 21.1 is available.\n", - "You should consider upgrading via the '/Users/vsulzer/Documents/Energy_storage/PyBaMM/.tox/dev/bin/python -m pip install --upgrade pip' command.\u001b[0m\n", + "\u001B[33mWARNING: You are using pip version 21.0.1; however, version 21.1 is available.\n", + "You should consider upgrading via the '/Users/vsulzer/Documents/Energy_storage/PyBaMM/.tox/dev/bin/python -m pip install --upgrade pip' command.\u001B[0m\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "\n", "import pybamm\n", "import pandas as pd\n", diff --git a/docs/source/examples/notebooks/models/DFN-with-particle-size-distributions.ipynb b/docs/source/examples/notebooks/models/DFN-with-particle-size-distributions.ipynb index be9084ef96..59e1e47e97 100644 --- a/docs/source/examples/notebooks/models/DFN-with-particle-size-distributions.ipynb +++ b/docs/source/examples/notebooks/models/DFN-with-particle-size-distributions.ipynb @@ -42,7 +42,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt" ] diff --git a/docs/source/examples/notebooks/models/DFN.ipynb b/docs/source/examples/notebooks/models/DFN.ipynb index 25b79ec260..682adc8c21 100644 --- a/docs/source/examples/notebooks/models/DFN.ipynb +++ b/docs/source/examples/notebooks/models/DFN.ipynb @@ -128,7 +128,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np" ] diff --git a/docs/source/examples/notebooks/models/MPM.ipynb b/docs/source/examples/notebooks/models/MPM.ipynb index 26365ab37b..c7e1068dc2 100644 --- a/docs/source/examples/notebooks/models/MPM.ipynb +++ b/docs/source/examples/notebooks/models/MPM.ipynb @@ -103,7 +103,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt" ] diff --git a/docs/source/examples/notebooks/models/MSMR.ipynb b/docs/source/examples/notebooks/models/MSMR.ipynb index 7413339f5b..6dbe14f484 100644 --- a/docs/source/examples/notebooks/models/MSMR.ipynb +++ b/docs/source/examples/notebooks/models/MSMR.ipynb @@ -23,7 +23,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt" ] diff --git a/docs/source/examples/notebooks/models/SEI-on-cracks.ipynb b/docs/source/examples/notebooks/models/SEI-on-cracks.ipynb index dd5f353413..be159e4c04 100644 --- a/docs/source/examples/notebooks/models/SEI-on-cracks.ipynb +++ b/docs/source/examples/notebooks/models/SEI-on-cracks.ipynb @@ -21,14 +21,14 @@ "output_type": "stream", "text": [ "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.3.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.0.1\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", + "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip available: \u001B[0m\u001B[31;49m22.3.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m23.0.1\u001B[0m\n", + "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt" ] diff --git a/docs/source/examples/notebooks/models/SPM.ipynb b/docs/source/examples/notebooks/models/SPM.ipynb index 587c1413bb..91a09a11b6 100644 --- a/docs/source/examples/notebooks/models/SPM.ipynb +++ b/docs/source/examples/notebooks/models/SPM.ipynb @@ -73,7 +73,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/models/SPMe.ipynb b/docs/source/examples/notebooks/models/SPMe.ipynb index 1548caa623..a9542d89ec 100644 --- a/docs/source/examples/notebooks/models/SPMe.ipynb +++ b/docs/source/examples/notebooks/models/SPMe.ipynb @@ -126,7 +126,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/models/Validating_mechanical_models_Enertech_DFN.ipynb b/docs/source/examples/notebooks/models/Validating_mechanical_models_Enertech_DFN.ipynb index bc04f92fbc..8bdfa76f60 100644 --- a/docs/source/examples/notebooks/models/Validating_mechanical_models_Enertech_DFN.ipynb +++ b/docs/source/examples/notebooks/models/Validating_mechanical_models_Enertech_DFN.ipynb @@ -23,7 +23,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/examples/notebooks/models/compare-comsol-discharge-curve.ipynb b/docs/source/examples/notebooks/models/compare-comsol-discharge-curve.ipynb index e23e1ee15f..90611a91a0 100644 --- a/docs/source/examples/notebooks/models/compare-comsol-discharge-curve.ipynb +++ b/docs/source/examples/notebooks/models/compare-comsol-discharge-curve.ipynb @@ -32,7 +32,7 @@ }, "outputs": [], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/models/compare-ecker-data.ipynb b/docs/source/examples/notebooks/models/compare-ecker-data.ipynb index 4fb7960c9d..05a375fa45 100644 --- a/docs/source/examples/notebooks/models/compare-ecker-data.ipynb +++ b/docs/source/examples/notebooks/models/compare-ecker-data.ipynb @@ -32,7 +32,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "import pandas as pd\n", diff --git a/docs/source/examples/notebooks/models/compare-lithium-ion.ipynb b/docs/source/examples/notebooks/models/compare-lithium-ion.ipynb index ed7f55f897..f194a62d02 100644 --- a/docs/source/examples/notebooks/models/compare-lithium-ion.ipynb +++ b/docs/source/examples/notebooks/models/compare-lithium-ion.ipynb @@ -48,7 +48,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "os.chdir(pybamm.__path__[0]+'/..')\n", diff --git a/docs/source/examples/notebooks/models/compare-particle-diffusion-models.ipynb b/docs/source/examples/notebooks/models/compare-particle-diffusion-models.ipynb index 22e72eafb0..6bd9f4cf63 100644 --- a/docs/source/examples/notebooks/models/compare-particle-diffusion-models.ipynb +++ b/docs/source/examples/notebooks/models/compare-particle-diffusion-models.ipynb @@ -35,7 +35,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "import numpy as np\n", diff --git a/docs/source/examples/notebooks/models/composite_particle.ipynb b/docs/source/examples/notebooks/models/composite_particle.ipynb index 8d279f959c..59fa9c957e 100644 --- a/docs/source/examples/notebooks/models/composite_particle.ipynb +++ b/docs/source/examples/notebooks/models/composite_particle.ipynb @@ -36,7 +36,7 @@ "metadata": {}, "outputs": [], "source": [ - "#%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "#%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import os\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", diff --git a/docs/source/examples/notebooks/models/coupled-degradation.ipynb b/docs/source/examples/notebooks/models/coupled-degradation.ipynb index c7e651d268..bbdacbec79 100644 --- a/docs/source/examples/notebooks/models/coupled-degradation.ipynb +++ b/docs/source/examples/notebooks/models/coupled-degradation.ipynb @@ -29,7 +29,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt" ] diff --git a/docs/source/examples/notebooks/models/electrode-state-of-health.ipynb b/docs/source/examples/notebooks/models/electrode-state-of-health.ipynb index 4d32f6a40e..4cfe8c517c 100644 --- a/docs/source/examples/notebooks/models/electrode-state-of-health.ipynb +++ b/docs/source/examples/notebooks/models/electrode-state-of-health.ipynb @@ -33,7 +33,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt\n", "import numpy as np" diff --git a/docs/source/examples/notebooks/models/jelly-roll-model.ipynb b/docs/source/examples/notebooks/models/jelly-roll-model.ipynb index 933d27aa78..fe6173f1ce 100644 --- a/docs/source/examples/notebooks/models/jelly-roll-model.ipynb +++ b/docs/source/examples/notebooks/models/jelly-roll-model.ipynb @@ -56,7 +56,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np \n", "from numpy import pi\n", diff --git a/docs/source/examples/notebooks/models/latexify.ipynb b/docs/source/examples/notebooks/models/latexify.ipynb index 401b3108d5..63e7c0d519 100644 --- a/docs/source/examples/notebooks/models/latexify.ipynb +++ b/docs/source/examples/notebooks/models/latexify.ipynb @@ -31,7 +31,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/models/lead-acid.ipynb b/docs/source/examples/notebooks/models/lead-acid.ipynb index db43a642ba..f550540182 100644 --- a/docs/source/examples/notebooks/models/lead-acid.ipynb +++ b/docs/source/examples/notebooks/models/lead-acid.ipynb @@ -32,7 +32,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/models/lithium-plating.ipynb b/docs/source/examples/notebooks/models/lithium-plating.ipynb index 051e215ca1..ef739ba1ea 100644 --- a/docs/source/examples/notebooks/models/lithium-plating.ipynb +++ b/docs/source/examples/notebooks/models/lithium-plating.ipynb @@ -24,7 +24,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/examples/notebooks/models/loss_of_active_materials.ipynb b/docs/source/examples/notebooks/models/loss_of_active_materials.ipynb index 7eae36e725..7de93a0a4a 100644 --- a/docs/source/examples/notebooks/models/loss_of_active_materials.ipynb +++ b/docs/source/examples/notebooks/models/loss_of_active_materials.ipynb @@ -33,7 +33,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "\n", "model = pybamm.lithium_ion.DFN(\n", diff --git a/docs/source/examples/notebooks/models/pouch-cell-model.ipynb b/docs/source/examples/notebooks/models/pouch-cell-model.ipynb index d5d291d5b4..8e84374fbe 100644 --- a/docs/source/examples/notebooks/models/pouch-cell-model.ipynb +++ b/docs/source/examples/notebooks/models/pouch-cell-model.ipynb @@ -55,7 +55,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import pickle\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/examples/notebooks/models/rate-capability.ipynb b/docs/source/examples/notebooks/models/rate-capability.ipynb index 27942e7cd3..fa01342f1d 100644 --- a/docs/source/examples/notebooks/models/rate-capability.ipynb +++ b/docs/source/examples/notebooks/models/rate-capability.ipynb @@ -30,7 +30,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/docs/source/examples/notebooks/models/simulating-ORegan-2022-parameter-set.ipynb b/docs/source/examples/notebooks/models/simulating-ORegan-2022-parameter-set.ipynb index 19c548f8fc..7eb647fc97 100644 --- a/docs/source/examples/notebooks/models/simulating-ORegan-2022-parameter-set.ipynb +++ b/docs/source/examples/notebooks/models/simulating-ORegan-2022-parameter-set.ipynb @@ -25,7 +25,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/models/submodel_cracking_DFN_or_SPM.ipynb b/docs/source/examples/notebooks/models/submodel_cracking_DFN_or_SPM.ipynb index 28ee46f6de..3391f7f07b 100644 --- a/docs/source/examples/notebooks/models/submodel_cracking_DFN_or_SPM.ipynb +++ b/docs/source/examples/notebooks/models/submodel_cracking_DFN_or_SPM.ipynb @@ -23,7 +23,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/examples/notebooks/models/thermal-models.ipynb b/docs/source/examples/notebooks/models/thermal-models.ipynb index dcf1a761e5..8bcc504af0 100644 --- a/docs/source/examples/notebooks/models/thermal-models.ipynb +++ b/docs/source/examples/notebooks/models/thermal-models.ipynb @@ -27,7 +27,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/models/unsteady-heat-equation.ipynb b/docs/source/examples/notebooks/models/unsteady-heat-equation.ipynb index 423e4fc800..2de30eedfe 100644 --- a/docs/source/examples/notebooks/models/unsteady-heat-equation.ipynb +++ b/docs/source/examples/notebooks/models/unsteady-heat-equation.ipynb @@ -45,7 +45,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/docs/source/examples/notebooks/models/using-model-options_thermal-example.ipynb b/docs/source/examples/notebooks/models/using-model-options_thermal-example.ipynb index 158f0bdd6d..0c97752792 100644 --- a/docs/source/examples/notebooks/models/using-model-options_thermal-example.ipynb +++ b/docs/source/examples/notebooks/models/using-model-options_thermal-example.ipynb @@ -32,7 +32,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import os\n", "os.chdir(pybamm.__path__[0]+'/..')" diff --git a/docs/source/examples/notebooks/models/using-submodels.ipynb b/docs/source/examples/notebooks/models/using-submodels.ipynb index 221492e012..ab26b97f2f 100644 --- a/docs/source/examples/notebooks/models/using-submodels.ipynb +++ b/docs/source/examples/notebooks/models/using-submodels.ipynb @@ -34,7 +34,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, diff --git a/docs/source/examples/notebooks/parameterization/change-input-current.ipynb b/docs/source/examples/notebooks/parameterization/change-input-current.ipynb index 52ed915327..0285ab69dd 100644 --- a/docs/source/examples/notebooks/parameterization/change-input-current.ipynb +++ b/docs/source/examples/notebooks/parameterization/change-input-current.ipynb @@ -41,7 +41,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/parameterization/parameter-values.ipynb b/docs/source/examples/notebooks/parameterization/parameter-values.ipynb index c0d9464dcf..f0a770af08 100644 --- a/docs/source/examples/notebooks/parameterization/parameter-values.ipynb +++ b/docs/source/examples/notebooks/parameterization/parameter-values.ipynb @@ -31,7 +31,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/parameterization/parameterization.ipynb b/docs/source/examples/notebooks/parameterization/parameterization.ipynb index 35226ed89f..f3db45aa44 100644 --- a/docs/source/examples/notebooks/parameterization/parameterization.ipynb +++ b/docs/source/examples/notebooks/parameterization/parameterization.ipynb @@ -41,7 +41,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/docs/source/examples/notebooks/plotting/customize-quick-plot.ipynb b/docs/source/examples/notebooks/plotting/customize-quick-plot.ipynb index dbe6888a15..d7a5fda2da 100644 --- a/docs/source/examples/notebooks/plotting/customize-quick-plot.ipynb +++ b/docs/source/examples/notebooks/plotting/customize-quick-plot.ipynb @@ -45,7 +45,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "\n", "models = [pybamm.lithium_ion.SPM(), pybamm.lithium_ion.SPMe(), pybamm.lithium_ion.DFN()]\n", diff --git a/docs/source/examples/notebooks/plotting/plot-voltage-components.ipynb b/docs/source/examples/notebooks/plotting/plot-voltage-components.ipynb index 8740981d04..bab1b8093e 100644 --- a/docs/source/examples/notebooks/plotting/plot-voltage-components.ipynb +++ b/docs/source/examples/notebooks/plotting/plot-voltage-components.ipynb @@ -116,7 +116,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "\n", "model = pybamm.lithium_ion.DFN()\n", diff --git a/docs/source/examples/notebooks/simulating-long-experiments.ipynb b/docs/source/examples/notebooks/simulating-long-experiments.ipynb index bfa0321e3a..890107e421 100644 --- a/docs/source/examples/notebooks/simulating-long-experiments.ipynb +++ b/docs/source/examples/notebooks/simulating-long-experiments.ipynb @@ -33,7 +33,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt" ] diff --git a/docs/source/examples/notebooks/simulation-class.ipynb b/docs/source/examples/notebooks/simulation-class.ipynb index 6797e85e61..bb93ec207a 100644 --- a/docs/source/examples/notebooks/simulation-class.ipynb +++ b/docs/source/examples/notebooks/simulation-class.ipynb @@ -17,7 +17,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm" ] }, @@ -134,7 +134,7 @@ "source": [ "# using less number of images in the example\n", "# for a smoother GIF use more images\n", - "simulation.create_gif(number_of_images=5, duration=0.2)" + "simulation.create_gif(number_of_images=5, duration=0.2, output_filename=\"simulation.gif\")" ] }, { diff --git a/docs/source/examples/notebooks/solution-data-and-processed-variables.ipynb b/docs/source/examples/notebooks/solution-data-and-processed-variables.ipynb index ff6ab7cc4d..87e5e44730 100644 --- a/docs/source/examples/notebooks/solution-data-and-processed-variables.ipynb +++ b/docs/source/examples/notebooks/solution-data-and-processed-variables.ipynb @@ -42,7 +42,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/solvers/dae-solver.ipynb b/docs/source/examples/notebooks/solvers/dae-solver.ipynb index b9531ed54a..324d500df3 100644 --- a/docs/source/examples/notebooks/solvers/dae-solver.ipynb +++ b/docs/source/examples/notebooks/solvers/dae-solver.ipynb @@ -25,7 +25,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/solvers/ode-solver.ipynb b/docs/source/examples/notebooks/solvers/ode-solver.ipynb index ae981ed597..992dae5980 100644 --- a/docs/source/examples/notebooks/solvers/ode-solver.ipynb +++ b/docs/source/examples/notebooks/solvers/ode-solver.ipynb @@ -25,7 +25,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/docs/source/examples/notebooks/solvers/speed-up-solver.ipynb b/docs/source/examples/notebooks/solvers/speed-up-solver.ipynb index 258c37c885..2bd7f47ae1 100644 --- a/docs/source/examples/notebooks/solvers/speed-up-solver.ipynb +++ b/docs/source/examples/notebooks/solvers/speed-up-solver.ipynb @@ -29,7 +29,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import matplotlib.pyplot as plt\n", "import numpy as np" diff --git a/docs/source/examples/notebooks/spatial_methods/finite-volumes.ipynb b/docs/source/examples/notebooks/spatial_methods/finite-volumes.ipynb index fd05496570..7afd4da6f9 100644 --- a/docs/source/examples/notebooks/spatial_methods/finite-volumes.ipynb +++ b/docs/source/examples/notebooks/spatial_methods/finite-volumes.ipynb @@ -62,7 +62,7 @@ } ], "source": [ - "%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n", + "%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n", "import pybamm\n", "import numpy as np\n", "import os\n", diff --git a/pybamm/plotting/quick_plot.py b/pybamm/plotting/quick_plot.py index d6828ce18a..5e9c9ef941 100644 --- a/pybamm/plotting/quick_plot.py +++ b/pybamm/plotting/quick_plot.py @@ -781,10 +781,12 @@ def create_gif(self, number_of_images=80, duration=0.1, output_filename="plot.gi images = [] # create images/plots + stub_name = output_filename.split(".")[0] for val in time_array: self.plot(val) - images.append("plot" + str(val) + ".png") - self.fig.savefig("plot" + str(val) + ".png", dpi=300) + temp_name = f"{stub_name}{val}.png" + images.append(temp_name) + self.fig.savefig(temp_name, dpi=300) plt.close() # compile the images/plots to create a GIF diff --git a/tests/unit/test_batch_study.py b/tests/unit/test_batch_study.py index 89e6bd62b0..c04e71b5cb 100644 --- a/tests/unit/test_batch_study.py +++ b/tests/unit/test_batch_study.py @@ -93,14 +93,18 @@ def test_create_gif(self): bs = pybamm.BatchStudy({"spm": pybamm.lithium_ion.SPM()}) bs.solve([0, 10]) + # Create a temporary file name + test_stub = "batch_study_test" + test_file = f"{test_stub}.gif" + # create a GIF before calling the plot method - bs.create_gif(number_of_images=3, duration=1) + bs.create_gif(number_of_images=3, duration=1, output_filename=test_file) # create a GIF after calling the plot method bs.plot(testing=True) - bs.create_gif(number_of_images=3, duration=1) + bs.create_gif(number_of_images=3, duration=1, output_filename=test_file) - os.remove("plot.gif") + os.remove(test_file) if __name__ == "__main__": diff --git a/tests/unit/test_plotting/test_quick_plot.py b/tests/unit/test_plotting/test_quick_plot.py index 3415777ee8..418cee8765 100644 --- a/tests/unit/test_plotting/test_quick_plot.py +++ b/tests/unit/test_plotting/test_quick_plot.py @@ -290,11 +290,12 @@ def test_spm_simulation(self): quick_plot.plot(0) # test creating a GIF - quick_plot.create_gif(number_of_images=3, duration=3) - assert not os.path.exists("plot*.png") - assert os.path.exists("plot.gif") - os.remove("plot.gif") - + test_stub = "spm_sim_test" + test_file = f"{test_stub}.gif" + quick_plot.create_gif(number_of_images=3, duration=3, output_filename=test_file) + assert not os.path.exists(f"{test_stub}*.png") + assert os.path.exists(test_file) + os.remove(test_file) pybamm.close_plots() def test_loqs_spme(self): diff --git a/tests/unit/test_simulation.py b/tests/unit/test_simulation.py index d0926e5c94..f008c7ff2a 100644 --- a/tests/unit/test_simulation.py +++ b/tests/unit/test_simulation.py @@ -343,14 +343,18 @@ def test_create_gif(self): sim = pybamm.Simulation(pybamm.lithium_ion.SPM()) sim.solve(t_eval=[0, 10]) + # Create a temporary file name + test_stub = "test_sim" + test_file = f"{test_stub}.gif" + # create a GIF without calling the plot method - sim.create_gif(number_of_images=3, duration=1) + sim.create_gif(number_of_images=3, duration=1, output_filename=test_file) # call the plot method before creating the GIF sim.plot(testing=True) - sim.create_gif(number_of_images=3, duration=1) + sim.create_gif(number_of_images=3, duration=1, output_filename=test_file) - os.remove("plot.gif") + os.remove(test_file) def test_drive_cycle_interpolant(self): model = pybamm.lithium_ion.SPM()