From 234429cdd68e7ea71fb66ab80d3c7745c7fe345c Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 12 Dec 2024 12:31:26 +0000 Subject: [PATCH 1/7] docs: update conda installation + minor fixes --- .../user_guide/installation/gnu-linux-mac.rst | 24 ++++++----- docs/source/user_guide/installation/index.rst | 40 +++++++------------ .../user_guide/installation/windows.rst | 22 +++++++--- 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/docs/source/user_guide/installation/gnu-linux-mac.rst b/docs/source/user_guide/installation/gnu-linux-mac.rst index 97171b53b7..855b29f584 100644 --- a/docs/source/user_guide/installation/gnu-linux-mac.rst +++ b/docs/source/user_guide/installation/gnu-linux-mac.rst @@ -50,7 +50,8 @@ To create a virtual environment ``env`` within your current directory type: virtualenv env -You can then “activate” the environment using: +or use any of your preferred environment management tool. You can then “activate” +the environment using: .. code:: bash @@ -64,27 +65,25 @@ the environment and go back to your original system, just type: deactivate -PyBaMM can be installed via pip. On macOS, it is necessary to install the `SUNDIALS `__ +PyBaMM can be installed via ``pip`` or ``conda``. On macOS, it is necessary +to install the `SUNDIALS `__ library beforehand. -.. tab:: GNU/Linux - - In a terminal, run the following command: +.. tab:: pip .. code:: bash pip install pybamm -.. tab:: macOS - - In a terminal, run the following command: +.. tab:: conda .. code:: bash - pip install pybamm + conda install -c conda-forge pybamm-base -PyBaMM’s required dependencies (such as ``numpy``, ``casadi``, etc) will be -installed automatically when you install PyBaMM using ``pip``. +PyBaMM’s `required dependencies `_ +(such as ``numpy``, ``casadi``, etc) will be installed automatically when you +install ``pybamm`` using ``pip`` or ``pybamm-base`` using ``conda``. For an introduction to virtual environments, see (https://realpython.com/python-virtual-environments-a-primer/). @@ -101,12 +100,15 @@ Users can install ``jax`` and ``jaxlib`` to use the Jax solver. The ``pip install "pybamm[jax]"`` command automatically downloads and installs ``pybamm`` and the compatible versions of ``jax`` and ``jaxlib`` on your system. +PyBaMM's full `conda-forge distribution `_ (``pybamm``) includes ``jax`` and ``jaxlib`` by default. + .. _optional-iree-mlir-support: Optional - IREE / MLIR support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Users can install ``iree`` (for MLIR just-in-time compilation) to use for main expression evaluation in the IDAKLU solver. Requires ``jax``. +At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. .. code:: bash diff --git a/docs/source/user_guide/installation/index.rst b/docs/source/user_guide/installation/index.rst index 9225f1ee98..6535933d70 100644 --- a/docs/source/user_guide/installation/index.rst +++ b/docs/source/user_guide/installation/index.rst @@ -4,42 +4,30 @@ Installation PyBaMM is available on GNU/Linux, MacOS and Windows. It can be installed using ``pip`` or ``conda``, or from source. -.. tab:: GNU/Linux and Windows +.. tab:: pip - .. tab:: pip + PyBaMM can be installed via pip from `PyPI `__. - PyBaMM can be installed via pip from `PyPI `__. + .. code:: bash - .. code:: bash + pip install pybamm - pip install pybamm +.. tab:: conda - .. tab:: conda + PyBaMM is part of the `Anaconda `_ distribution and is available as a conda package through the conda-forge channel. + + The ``pybamm`` package on conda-forge installs PyBaMM with all the `required and optional dependencies `_ available on conda-forge. + At the moment, PyBaMM's conda-forge distribution does not include the `IDAKLUSolver <../../api/solvers/idaklu_solver.html#idaklu-solver>`_. - PyBaMM is part of the `Anaconda `_ distribution and is available as a conda package through the conda-forge channel. + .. code:: bash - .. code:: bash + conda install -c conda-forge pybamm - conda install -c conda-forge pybamm + The ``pybamm-base`` package installs PyBaMM only with its `required dependencies `_. -.. tab:: macOS + .. code:: bash - .. tab:: pip - - PyBaMM can be installed via pip from `PyPI `__. - - .. code:: bash - - pip install pybamm - - - .. tab:: conda - - PyBaMM is part of the `Anaconda `_ distribution and is available as a conda package through the conda-forge channel. - - .. code:: bash - - conda install -c conda-forge pybamm + conda install -c conda-forge pybamm-base Optional solvers diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index 44dc79a7d3..9b01d02a0f 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -40,7 +40,8 @@ type: python -m virtualenv env -You can then “activate” the environment using: +or use any of your preferred environment management tool. You can then “activate” +the environment using: .. code:: @@ -56,12 +57,21 @@ the environment and go back to your original system, just type: PyBaMM can be installed via pip: -.. code:: bash +.. tab:: pip + + .. code:: bash + + pip install pybamm - pip install pybamm +.. tab:: conda -PyBaMM’s dependencies (such as ``numpy``, ``scipy``, etc) will be -installed automatically when you install PyBaMM using ``pip``. + .. code:: bash + + conda install -c conda-forge pybamm-base + +PyBaMM’s `required dependencies `_ +(such as ``numpy``, ``casadi``, etc) will be installed automatically when you +install ``pybamm`` using ``pip`` or ``pybamm-base`` using ``conda``. For an introduction to virtual environments, see (https://realpython.com/python-virtual-environments-a-primer/). @@ -77,6 +87,8 @@ Users can install ``jax`` and ``jaxlib`` to use the Jax solver. The ``pip install "pybamm[jax]"`` command automatically downloads and installs ``pybamm`` and the compatible versions of ``jax`` and ``jaxlib`` on your system. +PyBaMM's full `conda-forge distribution `_ (``pybamm``) includes ``jax`` and ``jaxlib`` by default. + Uninstall PyBaMM ---------------- From 5538b87929ea817f43be184ed0e2424e8cfae6ee Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:35:20 +0000 Subject: [PATCH 2/7] style: pre-commit fixes --- docs/source/user_guide/installation/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/user_guide/installation/index.rst b/docs/source/user_guide/installation/index.rst index 6535933d70..c4ff08b553 100644 --- a/docs/source/user_guide/installation/index.rst +++ b/docs/source/user_guide/installation/index.rst @@ -15,7 +15,7 @@ It can be installed using ``pip`` or ``conda``, or from source. .. tab:: conda PyBaMM is part of the `Anaconda `_ distribution and is available as a conda package through the conda-forge channel. - + The ``pybamm`` package on conda-forge installs PyBaMM with all the `required and optional dependencies `_ available on conda-forge. At the moment, PyBaMM's conda-forge distribution does not include the `IDAKLUSolver <../../api/solvers/idaklu_solver.html#idaklu-solver>`_. @@ -23,7 +23,7 @@ It can be installed using ``pip`` or ``conda``, or from source. conda install -c conda-forge pybamm - The ``pybamm-base`` package installs PyBaMM only with its `required dependencies `_. + The ``pybamm-base`` package installs PyBaMM only with its `required dependencies `_. .. code:: bash From 95ba3fa6e831b23c4e6b05154a63af8e908a5bd8 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 12 Dec 2024 12:37:24 +0000 Subject: [PATCH 3/7] update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 508c5f3058..06cbca77cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ## Breaking changes +- The conda distribution (`pybamm`) now install all optional dependencies available on conda-forge. Use the new `pybamm-base` conda +package to install pybamm with only the required dependencies. ([conda-forge/pybamm-feedstock#70](https://github.com/conda-forge/pybamm-feedstock/pull/70)) - Separated extrapolation options for `pybamm.BoundaryValue` and `pybamm.BoundaryGradient`, and updated the default to be "linear" for the value and "quadratic" for the gradient. ([#4614](https://github.com/pybamm-team/PyBaMM/pull/4614)) - Double-layer SEI models have been removed (with the corresponding parameters). All models assume now a single SEI layer. ([#4470](https://github.com/pybamm-team/PyBaMM/pull/4470)) From cf279949cfddb46a9747c5e7da9a389ff6ae0227 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 12 Dec 2024 13:49:51 +0000 Subject: [PATCH 4/7] typos and outdated docs Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> --- CHANGELOG.md | 4 ++-- docs/source/user_guide/installation/gnu-linux-mac.rst | 5 ++--- docs/source/user_guide/installation/index.rst | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06cbca77cf..920a292683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,8 @@ ## Breaking changes -- The conda distribution (`pybamm`) now install all optional dependencies available on conda-forge. Use the new `pybamm-base` conda -package to install pybamm with only the required dependencies. ([conda-forge/pybamm-feedstock#70](https://github.com/conda-forge/pybamm-feedstock/pull/70)) +- The conda distribution (`pybamm`) now installs all optional dependencies available on conda-forge. Use the new `pybamm-base` conda +package to install PyBaMM with only the required dependencies. ([conda-forge/pybamm-feedstock#70](https://github.com/conda-forge/pybamm-feedstock/pull/70)) - Separated extrapolation options for `pybamm.BoundaryValue` and `pybamm.BoundaryGradient`, and updated the default to be "linear" for the value and "quadratic" for the gradient. ([#4614](https://github.com/pybamm-team/PyBaMM/pull/4614)) - Double-layer SEI models have been removed (with the corresponding parameters). All models assume now a single SEI layer. ([#4470](https://github.com/pybamm-team/PyBaMM/pull/4470)) diff --git a/docs/source/user_guide/installation/gnu-linux-mac.rst b/docs/source/user_guide/installation/gnu-linux-mac.rst index 855b29f584..92e1b921c3 100644 --- a/docs/source/user_guide/installation/gnu-linux-mac.rst +++ b/docs/source/user_guide/installation/gnu-linux-mac.rst @@ -50,7 +50,7 @@ To create a virtual environment ``env`` within your current directory type: virtualenv env -or use any of your preferred environment management tool. You can then “activate” +or use any of your preferred environment management tools. You can then “activate” the environment using: .. code:: bash @@ -65,8 +65,7 @@ the environment and go back to your original system, just type: deactivate -PyBaMM can be installed via ``pip`` or ``conda``. On macOS, it is necessary -to install the `SUNDIALS `__ +PyBaMM can be installed via ``pip`` or ``conda``. library beforehand. .. tab:: pip diff --git a/docs/source/user_guide/installation/index.rst b/docs/source/user_guide/installation/index.rst index c4ff08b553..bdccb972c7 100644 --- a/docs/source/user_guide/installation/index.rst +++ b/docs/source/user_guide/installation/index.rst @@ -14,7 +14,7 @@ It can be installed using ``pip`` or ``conda``, or from source. .. tab:: conda - PyBaMM is part of the `Anaconda `_ distribution and is available as a conda package through the conda-forge channel. + PyBaMM is available as a ``conda`` package through the conda-forge channel. The ``pybamm`` package on conda-forge installs PyBaMM with all the `required and optional dependencies `_ available on conda-forge. At the moment, PyBaMM's conda-forge distribution does not include the `IDAKLUSolver <../../api/solvers/idaklu_solver.html#idaklu-solver>`_. From 4bd9bc09a740b2081852ef70e765ad633d9792f1 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 12 Dec 2024 13:50:18 +0000 Subject: [PATCH 5/7] woops, missed one Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> --- docs/source/user_guide/installation/windows.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index 9b01d02a0f..bf533bb568 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -40,7 +40,7 @@ type: python -m virtualenv env -or use any of your preferred environment management tool. You can then “activate” +or use any of your preferred environment management tools. You can then “activate” the environment using: .. code:: From 5a7684cb2e19e866e8b37ab9f3e5203fabc2f598 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 12 Dec 2024 14:26:16 +0000 Subject: [PATCH 6/7] highlight missing idaklu deps --- docs/source/user_guide/installation/gnu-linux-mac.rst | 5 ++++- docs/source/user_guide/installation/index.rst | 5 ++++- docs/source/user_guide/installation/install-from-docker.rst | 2 +- docs/source/user_guide/installation/windows.rst | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/source/user_guide/installation/gnu-linux-mac.rst b/docs/source/user_guide/installation/gnu-linux-mac.rst index 92e1b921c3..510e6d41e5 100644 --- a/docs/source/user_guide/installation/gnu-linux-mac.rst +++ b/docs/source/user_guide/installation/gnu-linux-mac.rst @@ -76,6 +76,10 @@ library beforehand. .. tab:: conda + .. note:: + + At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. + .. code:: bash conda install -c conda-forge pybamm-base @@ -107,7 +111,6 @@ Optional - IREE / MLIR support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Users can install ``iree`` (for MLIR just-in-time compilation) to use for main expression evaluation in the IDAKLU solver. Requires ``jax``. -At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. .. code:: bash diff --git a/docs/source/user_guide/installation/index.rst b/docs/source/user_guide/installation/index.rst index bdccb972c7..381e2da976 100644 --- a/docs/source/user_guide/installation/index.rst +++ b/docs/source/user_guide/installation/index.rst @@ -17,7 +17,10 @@ It can be installed using ``pip`` or ``conda``, or from source. PyBaMM is available as a ``conda`` package through the conda-forge channel. The ``pybamm`` package on conda-forge installs PyBaMM with all the `required and optional dependencies `_ available on conda-forge. - At the moment, PyBaMM's conda-forge distribution does not include the `IDAKLUSolver <../../api/solvers/idaklu_solver.html#idaklu-solver>`_. + + .. note:: + + At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. .. code:: bash diff --git a/docs/source/user_guide/installation/install-from-docker.rst b/docs/source/user_guide/installation/install-from-docker.rst index aeffdd25a1..11771765c7 100644 --- a/docs/source/user_guide/installation/install-from-docker.rst +++ b/docs/source/user_guide/installation/install-from-docker.rst @@ -13,7 +13,7 @@ Ensure Docker installation by running: .. code:: bash - docker --version + docker --version Pulling the Docker image ------------------------ diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index bf533bb568..10b8a11f0d 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -65,6 +65,10 @@ PyBaMM can be installed via pip: .. tab:: conda + .. note:: + + At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. + .. code:: bash conda install -c conda-forge pybamm-base From a56755682ab2d913440bb4966542ffc87ac5202e Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 12 Dec 2024 14:35:36 +0000 Subject: [PATCH 7/7] rm "the" --- docs/source/user_guide/installation/gnu-linux-mac.rst | 2 +- docs/source/user_guide/installation/index.rst | 2 +- docs/source/user_guide/installation/windows.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/user_guide/installation/gnu-linux-mac.rst b/docs/source/user_guide/installation/gnu-linux-mac.rst index 510e6d41e5..877462b5ac 100644 --- a/docs/source/user_guide/installation/gnu-linux-mac.rst +++ b/docs/source/user_guide/installation/gnu-linux-mac.rst @@ -78,7 +78,7 @@ library beforehand. .. note:: - At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. + At the moment, PyBaMM's conda-forge distribution does not include ``IDAKLUSolver``. .. code:: bash diff --git a/docs/source/user_guide/installation/index.rst b/docs/source/user_guide/installation/index.rst index 381e2da976..9fb81c8532 100644 --- a/docs/source/user_guide/installation/index.rst +++ b/docs/source/user_guide/installation/index.rst @@ -20,7 +20,7 @@ It can be installed using ``pip`` or ``conda``, or from source. .. note:: - At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. + At the moment, PyBaMM's conda-forge distribution does not include ``IDAKLUSolver``. .. code:: bash diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index 10b8a11f0d..5e7405abb4 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -67,7 +67,7 @@ PyBaMM can be installed via pip: .. note:: - At the moment, PyBaMM's conda-forge distribution does not include the ``IDAKLUSolver``. + At the moment, PyBaMM's conda-forge distribution does not include ``IDAKLUSolver``. .. code:: bash