Installation
Warning
Leaspy requires Python >= 3.9, < 3.13.
Tip
Whether you wish to install a released version of Leaspy, or to install its development version, it is highly recommended to use a virtual environment to install the project and its dependencies.
There exists multiple solutions for that, the most common option is to use conda:
conda create --name leaspy python=3.10
conda activate leaspy
Install a released version
To install the latest version of Leaspy:
pip install leaspy
Install in development mode
If you haven’t done it already, create and activate a dedicated environment (see the beginning of the installation section).
Clone the repository
To install the project in development mode, you first need to get the source code by cloning the project’s repository:
git clone git@gitlab.com:icm-institute/aramislab/leaspy.git
cd leaspy
Install poetry
This project relies on poetry that you would need to install (see the official instructions).
Tip
It is recommended install it in a dedicated environment, separated from the one in which you will install Leaspy and its dependencies. One possibility is to install it with a tool called pipx.
If you don’t have pipx installed, already, you can follow the official installation guidelines.
In short, you can do:
pip install pipx
pipx ensurepath
pipx install poetry
Install Leaspy and its dependencies
Install leaspy in development mode:
poetry install
Install the pre-commit hook
Once you have installed Leaspy in development mode, do not forget to install the pre-commit hook in order to automatically format and lint your commits:
pipx install pre-commit
pre-commit install
Notebook configuration
After installation, you can run the examples here.
To do so, in your leaspy environment, you can download ipykernel to use leaspy with jupyter notebooks:
conda install ipykernel
python -m ipykernel install --user --name=leaspy
Now, you can open jupyter lab or jupyter notebook and select the leaspy kernel.