Loading repository data…
Loading repository data…
pypsa-meets-earth / repository
PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
PyPSA-Earth: A Global Sector-Coupled Open-Source Multi-Energy System Model
PyPSA-Earth is the first open-source global cross-sectoral energy system model with high spatial and temporal resolution. The workflow provide capabilities for modelling the energy systems of any country in the world, enabling large-scale collaboration and transparent analysis for an inclusive and sustainable energy future. PyPSA-Earth is suitable for both operational studies and capacity expansion studies. Its sector-coupled modeling capabilities enable features for the detailed optimization of multi-energy systems, covering electricity, heating, transport, industry, hydrogen and more.
All the data needed for a simulation are automatically and flexibly retrieved from open sources. This includes, in particular, energy demand across sectors, generation capacities, medium- to high-voltage networks, and renewable energy potentials. Custom datasets can also be integrated as needed, and kept private if required. At the same time, PyPSA-Earth-Status provides functionality to share regional insights. If you are willing to contribute your regional expertise, feel free to open an issue there.
PyPSA-Earth is capable of providing the modelling evidence needed to translate the implications of energy scenarios into actionable regional strategies. By making this tool openly available, we aim to foster collaboration, innovation, and informed decision-making to support sustainable and efficient energy solutions worldwide.
Details on the model are available in the following academic publications:
PyPSA meets Earth is an independent research initiative developing a powerful energy system model for Earth. We work on open data, open source modelling, open source solver support and open communities. Stay tuned and join our mission - We look for users, co-developers and leaders!
The diagram below depicts one representative clustered node for the sector-coupled model with its generation, storage and conversion technologies.
There are multiple ways to get involved and learn more about our work:
Open your terminal at a location where you want to install pypsa-earth. Type the following in your terminal to download the package from GitHub:
.../some/path/without/spaces % git clone https://github.com/pypsa-meets-earth/pypsa-earth.git
The python package requirements are curated in the envs/{your operating system}64.lock.yaml file.
.../pypsa-earth % conda env create -f envs/linux-64.lock.yaml
.../pypsa-earth % conda env create -f envs/osx-arm64.lock.yaml
On non-arm macOS, the environment can be installed using:
.../pypsa-earth % conda env create -f envs/osx-64.lock.yaml
.../pypsa-earth % conda env create -f envs/win-64.lock.yaml
If the above takes longer than 30 min, you might want to try mamba for faster installation:
```bash
(base) conda install -c conda-forge mamba
.../pypsa-earth % mamba env create -f envs/{{your operating system}}64.lock.yaml
Alternatively, you can use pixi for faster and simpler dependency management (no separate lock files per OS):
# install pixi: https://pixi.prefix.dev/latest/#installation
.../pypsa-earth % pixi install
.../pypsa-earth % pixi shell # opens a shell with all dependencies available
(optional) In step 2, three solvers are installed: HiGHs, glpk and gurobi. HiGHs is the recommended open-source solver. Gurobi is generally faster, but requires a license for full functionality, which is freely available to academics (see instructions website).
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
Verify or install a java redistribution from the official website or equivalent. To verify the successful installation the following code can be tested from bash:
.../pypsa-earth % java -version
The expected output should resemble the following:
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
The model can be run in previous versions by checking out the respective tag. For instance, to run the model in version 0.8.0, which is the last version before the recent PyPSA update, the following command can be used:
git checkout v0.8.0
After checking out the tag, the model can be run as usual. Please make sure to use the environment built for the respective version.
In the folder open a terminal/command window to be located at this path ~/pypsa-earth/
Activate the environment conda activate pypsa-earth
Rename config.tutorial.yaml to config.yaml. For instance in Linux:
mv config.tutorial.yaml config.yaml
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.