PyPSA-Earth
An Open Optimisation Model of the Earth Energy System.
https://github.com/pypsa-meets-earth/pypsa-earth
Category: Energy Systems
Sub Category: Global and Regional Energy System Models
Keywords
energy-system-model energy-system-planning investment-optimization operational-optimization power-system-model power-system-planning pypsa-africa pypsa-earth python scenario-analysis
Keywords from Contributors
energy-system pypsa power-systems energy-model climate-change renewable-energy optimal-power-flow optimisation power-systems-analysis powerflow
Last synced: about 24 hours ago
JSON representation
Repository metadata
PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
- Host: GitHub
- URL: https://github.com/pypsa-meets-earth/pypsa-earth
- Owner: pypsa-meets-earth
- Created: 2021-02-28T19:26:35.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-18T08:09:33.000Z (9 days ago)
- Last Synced: 2025-04-19T16:12:02.712Z (8 days ago)
- Topics: energy-system-model, energy-system-planning, investment-optimization, operational-optimization, power-system-model, power-system-planning, pypsa-africa, pypsa-earth, python, scenario-analysis
- Language: Python
- Homepage: https://pypsa-earth.readthedocs.io/en/latest/
- Size: 26.2 MB
- Stars: 257
- Watchers: 10
- Forks: 228
- Open Issues: 200
- Releases: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSES/AGPL-3.0-or-later.txt
- Citation: CITATION.cff
README.md
PyPSA-Earth. A Flexible Python-based Open Optimisation Model to Study Energy System Futures around the World.
Development Status: Stable and Active
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. Originally it was derived from the European PyPSA-Eur model using new data and functions which provide capabilities for modelling the world energy system or any subset of it, enabling large-scale collaboration and transparent analysis for a sustainable energy future. It is suitable for operational studies, as well as expansion studies on combined generation, storage and transmission accounting for cross-sectoral interactions. The model provides two main features: (1) customizable data extraction and preparation scripts with global coverage for power and cross-sectoral modelling and (2) a PyPSA energy modelling framework integration. In particular, the data includes energy demand, generation and medium to high-voltage networks from open sources, yet additional data can be further integrated. A broad range of clustering and grid meshing strategies help adapt the model to computational and practical needs.
With the recent integration of PyPSA-Earth and the sector-coupled PyPSA-Earth model, all functionality is now combined into a single, comprehensive tool. This unified model allows for detailed optimization of multi-energy systems, covering electricity, heating, transport, and more. It is designed to adapt to the specific needs of any country or region, offering customizable data extraction, preparation scripts with global coverage, and a broad range of clustering and grid meshing strategies to meet computational and practical requirements.
PyPSA-Earth is capable to provide the modelling evidence needed to translate implications behind energy scenarios into the regional actions. By making this tool openly available, we aim to foster collaboration, innovation, and informed decision-making that leads to sustainable and efficient energy solutions worldwide.
For more details, the model is described in the Applied Energy article "PyPSA-Earth: A new global open energy system optimization model demonstrated in Africa," 2023. The preprint describing the sector-coupled functionalities is also available here. Additional information can be found in the documentation.
PyPSA meets Earth is a free and open source software initiative aiming to develop 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! Check out our website for results and our projects. Happy coding!
The diagram below depicts one representative clustered node for the sector-coupled model with its generation, storage and conversion technologies.
Livetracker. Most popular global models:
How to get involved
There are multiple ways to get involved and learn more about our work:
- Join our forum and communication platform on PyPSA-meets-Earth Discord Server
- Chat on Discord with us in the following open meetings:
- General initiative meeting for project news and high-level code updates. Held every fourth Thursday 16-17:00 (UK time) and is a perfect place to meet the community and get a high-level update on PyPSA ecosystem relevant for PyPSA-Earth developments.
- Weekly developers meetings
- Eastern-Hemisphere friendly Morning meeting every Thursday at 09:00 (UK time).
- Western-Hemisphere friendly Evening meeting every Thursday 16:00 (UK time). Every forth Thursday is replaced by the General initiative meeting which has a more high-level perspective, but you can also join to discuss more particular questions.
- Look at public materials at google Drive to share to minutes, presentations, lists and documents. Feel gree to get a look!
- Notify your interest to on-demand meetings:
- On-demand meetings
- Demand creation and prediction meeting
- AI asset detection meeting
- Outreach meeting for planning, discussing events, workshops, communication, community activities
- On-demand meetings
- Join us and propose your stream.
Installation
-
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/environment.yaml
file.
The environment can be installed using:
.../pypsa-earth % conda env create -f 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-earth % mamba env create -f 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
-
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)
Running the model in previous versions
The model can be run in previous versions by checking out the respective tag. For instance, to run the model in version 0.6.0, which is the last version before the recent PyPSA update, the following command can be used:
git checkout v0.6.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.
Test run on tutorial
-
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.
Training
- We recently updated some hackathon material for PyPSA-Earth. The hackathon contains jupyter notebooks with exercises. After going through the 1 day theoretical and practical material you should have a suitable coding setup and feel confident about contributing.
- The get a general feeling about the PyPSA functionality, we further recommend going through the PyPSA and Atlite examples.
Questions and Issues
- We are happy to answer questions and help with issues if they are public. Through being public the wider community can benefit from the raised points. Some tips. Bugs and feature requests should be raised in the GitHub Issues. General workflow or user questions as well as discussion points should be posted at the GitHub Discussions tab. Happy coding.
Documentation
The documentation is available here: documentation.
Collaborators
Citation (CITATION.cff)
# SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors # SPDX-License-Identifier: AGPL-3.0-or-later title: PyPSA-Earth. A new global open energy system optimization model demonstrated in Africa abstract: This repository contains the source code of the paper PyPSA-Earth. A new global open energy system optimization model demonstrated in Africa by Maximilian Parzen, Hazem Abdel-Khalek, Ekaterina Fedotova, Matin Mahmood, Martha Maria Frysztacki, Johannes Hampp, Lukas Franken, Leon Schumm, Fabian Neumann, Davide Poli, Aristides Kiprakis and Davide Fioriti, from Applied Energy doi: 10.1016/j.apenergy.2023.121096 repository-code: https://github.com/pypsa-meets-earth/pypsa-earth version: 1.0.0 date-released: 2023-04-18 message: If you use this software in your work, please cite it using the following metadata. authors: - given-names: Maximilian family-names: Parzen orcid: https://orcid.org/0000-0002-4390-0063 - given-names: Hazem family-names: Abdel-Khalek - given-names: Ekaterina family-names: Fedotova orcid: https://orcid.org/0000-0002-5590-9591 - given-names: Matin family-names: Mahmood - given-names: Martha Maria family-names: Frysztacki orcid: https://orcid.org/0000-0002-0788-1328 - given-names: Johannes family-names: Hampp orcid: https://orcid.org/0000-0002-1776-116X - given-names: Lukas family-names: Franken - given-names: Leon family-names: Schumm - given-names: Fabian family-names: Neumann orcid: https://orcid.org/0000-0002-6604-5450 - given-names: Davide family-names: Poli orcid: https://orcid.org/0000-0002-5045-9034 - given-names: Aristides family-names: Kiprakis - given-names: Davide family-names: Fioriti orcid: https://orcid.org/0000-0001-5491-7912 cff-version: 1.2.0
Owner metadata
- Name: PyPSA meets Earth
- Login: pypsa-meets-earth
- Email:
- Kind: organization
- Description: An open source energy system model initiative for our Earth
- Website: https://pypsa-meets-earth.github.io/
- Location:
- Twitter: pypsameetsearth
- Company:
- Icon url: https://avatars.githubusercontent.com/u/84225086?v=4
- Repositories: 11
- Last ynced at: 2023-03-04T04:30:40.464Z
- Profile URL: https://github.com/pypsa-meets-earth
GitHub Events
Total
- Create event: 31
- Release event: 3
- Issues event: 139
- Watch event: 28
- Delete event: 28
- Member event: 3
- Issue comment event: 584
- Push event: 216
- Pull request review event: 373
- Pull request review comment event: 285
- Pull request event: 309
- Fork event: 49
Last Year
- Create event: 31
- Release event: 3
- Issues event: 139
- Watch event: 28
- Delete event: 28
- Member event: 3
- Issue comment event: 584
- Push event: 216
- Pull request review event: 373
- Pull request review comment event: 285
- Pull request event: 309
- Fork event: 49
Committers metadata
Last synced: 6 days ago
Total Commits: 4,811
Total Committers: 70
Avg Commits per committer: 68.729
Development Distribution Score (DDS): 0.792
Commits in past year: 754
Committers in past year: 30
Avg Commits per committer in past year: 25.133
Development Distribution Score (DDS) in past year: 0.841
Name | Commits | |
---|---|---|
davide-f | f****s@g****m | 1000 |
ekatef | e****a@g****m | 734 |
Max Parzen | m****n@e****k | 525 |
pre-commit-ci[bot] | 6****] | 501 |
Hazem-IEG | h****k@i****e | 412 |
energyls | l****m@o****e | 296 |
Restyled.io | c****s@r****o | 288 |
Emmanuel Bolarinwa | g****a@g****m | 130 |
yerbol-akhmetov | y****3@g****m | 121 |
github-actions[bot] | 4****] | 74 |
Fabian | f****f@g****e | 70 |
mnm-matin | m****9@g****m | 67 |
DeniseGiub | d****o@s****t | 63 |
contrib-readme-bot | c****n@n****m | 62 |
Eddy-JV | e****t@g****m | 44 |
Thomas Kouroughli | t****u@i****m | 42 |
Anton Achhammer | a****r@o****e | 38 |
Hazem | 8****G | 31 |
drifter089 | a****7@g****m | 27 |
GridGrapher | 1****r | 25 |
Fabrizio Finozzi | 1****a | 22 |
virio-andreyana | a****o@g****m | 20 |
glenkiely-ieg | 9****g | 17 |
cpschau | c****s@i****e | 15 |
Eric Nitschke | e****e@t****e | 15 |
giacfalk | g****a@g****m | 12 |
carlosfv | c****2@h****m | 11 |
martha.mf | m****i@k****u | 11 |
Emre-Yorat89 | y****e@g****m | 9 |
lkstrp | l****p@p****e | 9 |
and 40 more... |
Committer domains:
- ieg.fraunhofer.de: 3
- ed.ac.uk: 2
- oth-regensburg.de: 2
- restyled.io: 1
- gmx.de: 1
- studenti.unipi.it: 1
- noreply.com: 1
- tuhh.de: 1
- kit.edu: 1
- pm.me: 1
- ieg.fraunhofer.degit config --global user.email hazem.abdel-khalek: 1
- openenergytransition.org: 1
- dl580-cpu1.unipi.it: 1
- iee.fraunhofer.de: 1
- ieg.frauunhofer.de: 1
- uit.no: 1
- up.edu.ph: 1
- mit.edu: 1
- ryanmsparks.com: 1
- ulg.ac.be: 1
- berkeley.edu: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 537
Total pull requests: 882
Average time to close issues: 4 months
Average time to close pull requests: 12 days
Total issue authors: 54
Total pull request authors: 70
Average comments per issue: 2.8
Average comments per pull request: 2.41
Merged pull request: 634
Bot issues: 0
Bot pull requests: 264
Past year issues: 164
Past year pull requests: 301
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 11 days
Past year issue authors: 29
Past year pull request authors: 34
Past year average comments per issue: 1.85
Past year average comments per pull request: 2.19
Past year merged pull request: 194
Past year bot issues: 0
Past year bot pull requests: 79
Top Issue Authors
- davide-f (168)
- pz-max (136)
- ekatef (60)
- GbotemiB (24)
- yerbol-akhmetov (17)
- hazemakhalek (15)
- energyLS (10)
- Tomkourou (9)
- mnm-matin (9)
- danielelerede-oet (6)
- bobbyxng (5)
- euronion (5)
- Eric-Nitschke (5)
- carlosfv92 (4)
- koen-vg (4)
Top Pull Request Authors
- davide-f (151)
- github-actions[bot] (109)
- ekatef (102)
- pz-max (97)
- restyled-io[bot] (90)
- pre-commit-ci[bot] (63)
- yerbol-akhmetov (38)
- GbotemiB (30)
- finozzifa (22)
- Tomkourou (16)
- energyLS (13)
- virio-andreyana (10)
- danielelerede-oet (10)
- cpschau (6)
- doneachh (6)
Top Issue Labels
- bug (195)
- good first issue (85)
- improvement (62)
- help wanted (47)
- feature request (30)
- documentation (27)
- high priority (7)
- alternative_clustering (6)
- reimplementation (5)
- question (2)
Top Pull Request Labels
- improvement (3)
- dependencies (2)
- bug (1)
- feature request (1)
- wontfix (1)
Dependencies
- atlite >=0.2.2
- dask <=2021.3.1
- descartes *
- esy-osm-pbf *
- esy-osmfilter *
- memory_profiler *
- powerplantmatching >=0.4.8
- pycountry *
- pypsa *
- pyyaml *
- rioxarray *
- scikit-learn *
- seaborn *
- setuptools *
- setuptools <58.3.0
- sphinx *
- sphinx_rtd_theme *
- tables *
- vresutils >=0.3.1
- actions/cache v2 composite
- actions/checkout v2 composite
- conda-incubator/setup-miniconda v2 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- conda-incubator/setup-miniconda v2 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- conda-incubator/setup-miniconda v2 composite
- akhilmhdh/contributors-readme-action v2.3.6 composite
- atlite
- cartopy
- contextily
- country_converter
- dask
- descartes
- earth-osm >=0.1.0
- fiona !=1.8.22
- geopandas >=0.11.0
- geopy
- geoviews
- glpk
- graphviz
- gurobi
- hvplot
- ipopt <3.13.3
- ipykernel
- ipython
- jupyterlab
- lxml
- mamba
- matplotlib <=3.5.2
- memory_profiler
- netcdf4
- networkx
- numpy
- openpyxl
- pandas
- pip
- powerplantmatching >=0.5.7
- pre-commit
- py7zr
- pydoe2
- pyomo
- pypsa >=0.24,<0.25
- pytables
- python >=3.8
- pytz
- rasterio !=1.2.10
- reverse-geocode
- rioxarray
- ruamel.yaml <=0.17.26
- scipy
- seaborn
- shapely >=2
- snakemake-minimal
- tqdm
- xarray
- xlrd
Score: 10.373178632943564