Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PyBaMM importable in Linux systems if jax is already installed #1874

Merged
merged 10 commits into from
Dec 29, 2021
5 changes: 3 additions & 2 deletions examples/notebooks/Creating Models/1-an-ode-model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -296,7 +297,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -310,7 +311,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
3 changes: 2 additions & 1 deletion examples/notebooks/Creating Models/2-a-pde-model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -340,7 +341,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -362,7 +363,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -422,7 +423,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -648,7 +649,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -728,7 +729,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -742,7 +743,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
Expand Down Expand Up @@ -264,7 +265,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -278,7 +279,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
Expand Down Expand Up @@ -158,7 +159,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -172,7 +173,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -1072,7 +1073,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import os\n",
Expand Down Expand Up @@ -728,7 +729,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
Expand Down Expand Up @@ -213,7 +214,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -227,7 +228,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"model = pybamm.lithium_ion.SPMe()\n",
Expand Down Expand Up @@ -436,7 +437,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -450,7 +451,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
Expand Down Expand Up @@ -149,7 +150,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -163,7 +164,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
Expand Down Expand Up @@ -149,7 +150,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -163,7 +164,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
Expand Down Expand Up @@ -325,7 +326,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
3 changes: 2 additions & 1 deletion examples/notebooks/batch_study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"\n",
Expand Down Expand Up @@ -639,7 +640,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
5 changes: 3 additions & 2 deletions examples/notebooks/change-settings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
}
],
"source": [
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
Expand Down Expand Up @@ -671,7 +672,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -685,7 +686,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
7 changes: 4 additions & 3 deletions examples/notebooks/customize-quick-plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install pybamm -q\n",
"%pip uninstall --yes jax # uninstall jax if it is installed (Google Colab)\n",
"%pip install pybamm -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",
Expand Down Expand Up @@ -228,7 +229,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -242,7 +243,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
"version": "3.9.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Loading