Disclaimer: PyPSA-Earth-Sec is still under development.
The workflow is adaped to work smoothly for the following countries: Morocco, Namibia, Nigeria and Benin. The spatial and temporal resolution of the model are flexible. It's advisable to use more than 3 nodes per country and a timestep not smaller than 3-hours.
Currently, no real sectoral demand data is used for the country inspected, instead, we use dummy data. The collection, compilation and processing of real data is underway.
The model now includes the following energy carriers: electricity, hydrogen, gas, oil* and biomass as well as carbon as gas emissions and feedstock for the synthesis of the carriers.
The demand sectors covered are: residential, industry, land transport, aviation, shipping, services and agriculture.
The diagram below depicts one representative clustered node showing the combination of carriers and sectors covered in the model as well as the generation and conversion technologies included.
-
Open your terminal at a location where you want to install pypsa-earth-sec. Type the following in your terminal to download the package and the dependency (pypsa-earth) from GitHub. Note that the tag
--recursive-submodules
is needed to automatically clone also the pypsa-earth dependency..../some/path/without/spaces % git clone --recurse-submodules https://github.com/pypsa-meets-earth/pypsa-earth-sec.git
To make sure you run the latest version of the submodule (if desired), run the following command to update the git submodules:
.../some/path/without/spaces % git submodule update
-
Move the current directory to the head of the repository.
.../some/path/without/spaces % cd pypsa-earth-sec
-
(optional) For reproducibility and compatibility purposes, it is possible to specify a specific version of the pypsa-earth submodule. To do so, feel to reproduce the following lines, yet this is not mandatory. If you desire to run the latest pypsa-earth model, please skip this point 3.
.../pypsa-earth-sec % cd pypsa-earth .../pypsa-earth % git reset --hard \{commit id\} .../pypsa-earth % cd ..
-
The python package requirements are curated in the
envs/environment.yaml
file of the pypsa-earth repository. The environment can be installed using:.../pypsa-earth-sec % conda env create -f pypsa-earth/envs/environment.yaml
-
For running the optimization one has to install the solver. We can recommend the open source HiGHs solver which installation manual is given here.
-
To use jupyter lab (new jupyter notebooks) continue with the ipython kernel installation and test if your jupyter lab works:
.../pypsa-earth % ipython kernel install --user --name=pypsa-earth .../pypsa-earth % jupyter lab
-
In the folder pypsa-earth-sec open a terminal/command window to be located at this path
./pypsa-earth-sec/
-
Rename config.default.yaml to config.yaml. For instance in Linux:
mv config.default.yaml config.yaml
-
Open the file
config.yaml
and follow the steps done before in pypsa-earth- choose the country you want to model. For example
countries: ["MA"]
- choose the country you want to model. For example
-
Run a dryrun of the Snakemake workflow by typing simply in the terminal:
snakemake -j 1 solve_all_networks -n
Remove the -n to do a real run. Follow the tutorial of PyPSA-Eur 1 and 2 on YouTube to continue with an analysis.