Getting started with Rockpool
Rockpool requires Python 3.7, numpy and scipy to install. These requirements will be installed by
pip when installing Rockpool. We recommend using anaconda, miniconda or another environment manager to keep your Python dependencies clean.
The simplest way to install Rockpool is by using
pip to download and install the latest version from PyPI.
pip install rockpool
You can also install Rockpool using
conda, from the
conda install -c conda-forge rockpool
To check your Rockpool version, access the
__version__ attribute of the module:
import rockpool rockpool.__version__
Rockpool has several dependencies for various aspects of the library. However, these dependencies are compartmentalised as much as possible. For example, Jax is required to use the Jax-backed modules (e.g.
RateJax); PyTorch is required to use the Torch-backed modules, and so on. But if these dependencies are not available, the remainder of Rockpool is still usable.
PyTest for running tests
To automatically install most of the extra dependencies required by Rockpool, use the command
$ pip install rockpool[all]
$ pip install rockpool\[all\]
To check which computational back-ends are available to Rockpool, use the
import rockpool rockpool.list_backends()
Building the documentation
The Rockpool documentation is based on sphinx, and all dependencies required for a local HTML version are installed with
pip install rockpool[all].
To build a live, locally-hosted HTML version of the docs, use the command
$ cd docs $ make clean html
Once built, the documentation will be placed in
index.html in a web browser to start using the documentation.
To build a PDF version of the docs, you need to install
imagemagick on your system, as well as a working version of
pdflatex. You will need to install these dependencies manually.
Once all dependencies are installed, you can build the PDF docs with
$ cd docs $ make clean latexpdf
If you would like to contribute to Rockpool, then you should begin by forking the public repository at https://github.com/synsense/rockpool to your own account. Then clone your fork to your development machine
$ git clone https://github.com/your-fork-location/rockpool.git rockpool
Install the package in development mode using
$ cd rockpool $ pip install -e . --user
$ pip install -e .[all] --user
The main branch is
development. You should commit your modifications to a new feature branch.
$ git checkout -b feature/my-feature develop ... $ git commit -m 'This is a verbose commit message.'
Then push your new branch to your repository
$ git push -u origin feature/my-feature
Use the Black code formatter on your submission during your final commit. This is required for us to merge your changes. If your modifications aren’t already covered by a unit test, please include a unit test with your merge request. Unit tests go in the
Then when you’re ready, make a merge request on github.com, from the feature branch in your fork to https://github.com/synsense/rockpool.
As part of the merge review process, we’ll check that all the unit tests pass. You can check this yourself (and probably should before making your merge request), by running the unit tests locally.
To run all the unit tests for Rockpool, use
$ pytest tests