Starter kit#
To start using the model and its dependencies, multiple scripts and tool should be used.
- Get the model
Clone the git repository from GitHub.
Install your environment using envs folder (latest data were produced with envs/environment.aws_r6a.12xlarge.yaml). A detailed installation guide is available in the PyPSA-Eur documentation.
Optimisation has been done using Gurobi (commercial solver). HiGHS is a good open source alternative. Other alternatives are listed in the PyPSA-Eur documentation.
- Run the model
Use snakemake using the following command
snakemake -call all --configfile config/config.veka.yaml -n
Model can be ran locally or on a remote server to improve performances (should work on a AWS EC2 r6a.12xlarge).
Edit the configurations files to improve the scenarios : config/config.veka.yaml and config/scenarios.veka.yaml.
- Extract data from the PyPSA-Eur outputs
Copy desired files from results and resources folders to analysis/{run} folder. If you use a remote server, use SFTP to download data from the server.
Configure the correct run versions in scripts/graph_extraction_main.py for scenarios, sensitivities and reference runs.
Run the data extraction pipeline (locally).
The output data (analysis/{run}/graph_extraction_st) are created in analysis folder and should be copied in the app/assets/data folder if you want to add them to the streamlit.
- Ship the data in streamlit
Streamlit platform is free to use when the data are available on Github publicly. Currently our website is linked to main-v10 branch on the Github of Climact.
To use the new data, reconfigure app/st_common.py with the new runs paths (change scenario_dict values).
Merge the updated data with the GitHub branch main-v10 to ship the data online.
Streamlit will automatically update the webpage. If you want to be sure that cached data are updated, you can reboot the app on the Streamlit dashboard.
The webpage can be debugged locally using:
streamlit run app/VEKA_2050+.py
Since Streamlit can also be run as a container, we have added app/Dockerfile_demo as an example.
- The documentation is shared online through Readthedocs.
Pushing new updates on the main-v10 branch on GitHub will also automatically update the page.
Documentation is stored in the doc folder.
The documentation can be tested locally using:
cd doc make clean make html open _build/html/index.html
The documentation is also configured to generate a PDF file using:
cd doc make clean # Need twice for LaTeX references make latexpdf; make latexpdf open _build/latex/PyPSA-Eur.pdf