Installation
The subsequently described installation steps are demonstrated as shell commands, where the path before the % sign denotes the directory in which the commands following the % should be entered.
Install/Check Dependencies
The major software dependencies of PyPSA-Distribution coincides with those of PyPSA-Earth,
described at this link.
In particular, after having verified to have installed git, a conda distribution (e.g. miniconda), and
an Integrated Development Environment (IDE), such as Visual Studio Code, you can proceed with the following.
Clone the Repository
Note
For Windows users. Please, that windows is supported using WSL (Windows Subsystem Linux), due Issue 392 Snakemake Windows users may install the WSL as discussed in this link, also including the setup of Visual Studio Code. More information in the short_tutorial section
First of all, clone the PyPSA-Distribution repository using the version control system git.
The path to the directory into which the git repository is cloned, must not have any spaces.
If you do not have git installed, follow installation instructions here.
/some/other/path % cd /some/path/without/spaces
/some/path/without/spaces % git clone --recurse-submodules https://github.com/pypsa-meets-earth/pypsa-distribution.git
Note
PyPSA-Distribution depends recoursively on PyPSA-Earth, therefore, option –recurse-submodules is needed: it automatically downloads the PyPSA-Earth repository as well.
Install the Python Environment
The python package requirements are curated in the pypsa-earth/envs/environment.yaml file. The environment can be installed using:
.../pypsa-distribution % conda env create -f pypsa-earth/envs/environment.yaml
If the above takes longer than 30min, you might want to try mamba for faster installation:
(base) conda install -c conda-forge mamba
.../pypsa-distribution % mamba env create -f pypsa-earth/envs/environment.yaml
Extra python package requirements are satisfied by manually installing them. Currently the ramp package is added to existing pypsa-earth environment by using:
.../pypsa-distribution % conda activate pypsa-earth
(pypsa-earth) pip install rampdemand
Install the pre-commit (for developers)
We are using the pre-commit framework to run some checks on the code before committing. The tool provide automated ways to keep the code clean and consistent. To make sure to install the tool, please run:
.../pypsa-distribution % conda activate pypsa-earth
.../pypsa-distribution % pre-commit install
Set Configuration File
PyPSA-Earth has several configuration options that must be specified in a config.yaml file located in the project directory. An example configuration config.distribution.yaml is maintained in the repository. More details on the configuration options are in config section.
Note that the config.distribution.yaml is a difference file with respect to the config.pypsa-earth.yaml one.