Installation#
PyBOP is a versatile Python package designed for optimisation and parameterisation of battery models. Follow the instructions below to install PyBOP and set up your environment to begin utilising its capabilities.
Installing PyBOP with pip#
The simplest method to install PyBOP is using pip. Run the following command in your terminal:
pip install pybop
This command will download and install the latest stable version of PyBOP. If you want to install a specific version, you can specify the version number using the following command:
pip install pybop==23.11
Installing the Development Version#
If you’re interested in the cutting-edge features and want to try out the latest enhancements, you can install the development version directly from the develop branch on GitHub:
pip install git+https://github.com/pybop-team/PyBOP.git@develop
Please note that the development version may be less stable than the official releases.
Local Installation from Source#
For those who prefer to install PyBOP from a local clone of the repository or wish to modify the source code, you can use pip to install the package in “editable” mode. Replace “path/to/pybop” with the actual path to your local PyBOP directory:
pip install -e "path/to/pybop"
In editable mode, changes you make to the source code will immediately affect the PyBOP installation without the need for reinstallation.
Optional Dependencies#
plotly - For plotting, PyBOP uses plotly. It can be installed with:
pip install pybop[plot]
scikit-fem - This is a dependency for the multi-dimensional pybamm models, and can be installed using:
pip install pybop[scifem]
bpx - To use the Faraday Institution’s Battery Parameter eXchange (BPX) package install the optional requirement:
pip install pybop[bpx]
To install all the optional dependencies, the command pip install pybop[all] is available. For more information on the optional packages, users are directed towards the pyproject.toml.
Verifying Installation#
To verify that PyBOP has been installed successfully, try running one of the provided example scripts included in the documentation or repository. If the example executes without any errors, PyBOP is ready to use. Alternatively, you can run the following command in your terminal to check the version of PyBOP that is installed:
python -c "import pybop; print(pybop.__version__)"
For Developers#
If you are installing PyBOP for development purposes, such as contributing to the project, please ensure that you follow the guidelines outlined in the Contributing Guide. It includes additional steps that might be necessary for setting up a development environment, including the installation of dependencies and setup of pre-commit hooks.
Further Assistance#
If you encounter any issues during the installation process or have any questions regarding the use of PyBOP, feel free to reach out to the community via the PyBOP GitHub Discussions.
Next Steps#
After installing PyBOP, you might want to:
Explore the Quick Start Guide to begin using PyBOP.
Check out the API Reference for detailed information on PyBOP’s programming interface.