PyPSA-Spain
An extension of PyPSA-Eur to model the Spanish Energy System.
https://github.com/cristobal-gc/pypsa-spain
Category: Energy Systems
Sub Category: Global and Regional Energy System Models
Keywords from Contributors
energy-system-model energy-system power-systems capacity-expansion-planning energy-model pypsa capacity-expansion-model energy-data energy-system-analysis europe
Last synced: about 14 hours ago
JSON representation
Repository metadata
PyPSA-Spain is an open-source model of the Spanish energy system based on the European model PyPSA-Eur
- Host: GitHub
- URL: https://github.com/cristobal-gc/pypsa-spain
- Owner: cristobal-GC
- Fork: true (PyPSA/pypsa-eur)
- Created: 2024-07-18T16:52:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-12-01T10:02:43.000Z (26 days ago)
- Last Synced: 2025-12-14T14:42:50.680Z (12 days ago)
- Language: Python
- Homepage: https://pypsa-spain.readthedocs.io/
- Size: 115 MB
- Stars: 16
- Watchers: 1
- Forks: 3
- Open Issues: 1
- Releases: 0
https://github.com/cristobal-GC/pypsa-spain/blob/master/

[](https://github.com/pypsa/pypsa-eur/actions/workflows/test.yaml)
[](https://pypsa-eur.readthedocs.io/en/latest/?badge=latest)

[](https://doi.org/10.5281/zenodo.3520874)
[](https://doi.org/10.5281/zenodo.3938042)
[](https://snakemake.readthedocs.io)
[](https://discord.gg/AnuJBk23FU)
[](https://api.reuse.software/info/github.com/pypsa/pypsa-eur)
# PyPSA-Spain: An extension of PyPSA-Eur to model the Spanish Energy System
The primary motivation behind the development of PyPSA-Spain was to leverage the
benefits of a national energy model over a regional one, like the availability of specific
datasets from national organisations. Additionally, a single-country model enables higher
spatial and temporal resolution with the same computational resources due to the smaller
geographical domain. Finally, it does not require assumptions about coordinated action
between countries, making it a more suitable tool for analysing national energy policies.
To accommodate cross-border interactions, a nested model approach with PyPSA-Eur was
used, wherein electricity prices from neighbouring countries are precomputed through the
optimisation of the European energy system.
PyPSA-Spain is an up-to-date fork of PyPSA-Eur, ensuring that advancements
and bug fixes made to PyPSA-Eur are integrated. In addition, PyPSA-Spain includes a number of novel functionalities that enhance the representation
of the Spanish energy system, as compared with PyPSA-Eur.
Find more details in [https://pypsa-spain.readthedocs.io/en/latest/](https://pypsa-spain.readthedocs.io/en/latest/)
A description of the new functionalities implemented in PyPSA-Spain is now available in this article: [https://doi.org/10.1016/j.esr.2025.101764](https://doi.org/10.1016/j.esr.2025.101764).

## Basic commands for running PyPSA-Spain
As a fork of PyPSA-Eur, PyPSA-Spain uses the same command structure.
Note that PyPSA-Spain employs the **sector network** approach
- **Full workflow run**:
```bash
$ snakemake all --configfile config/config_ES.yaml --cores 4
```
- **Partial runs**:
```bash
##### Cluster the network
$ snakemake cluster_networks --configfile config/config_ES.yaml --cores 4
```
```bash
##### Prepare the network
$ snakemake prepare_sector_networks --configfile config/config_ES.yaml --cores 4
```
```bash
##### Solve the network
$ snakemake solve_sector_networks --configfile config/config_ES.yaml --cores 4
```
- **Run to get a specific output**, for example, `base.nc` network:
```bash
$ snakemake resources/networks/base.nc --configfile config/config_ES.yaml --cores 4
```
**Comments:**
1. Adjust the number of `--cores` according to your system.
2. Add the `-n` flag (dry-run) to check the workflow before execution
## Licence
PyPSA-Spain is a fork of [PyPSA-Eur](https://github.com/PyPSA/pypsa-eur), which is released as free software under the
[MIT License](https://opensource.org/licenses/MIT), see [`doc/licenses.rst`](doc/licenses.rst).
However, different licenses and terms of use may apply to the various input data.
Owner metadata
- Name:
- Login: cristobal-GC
- Email:
- Kind: user
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/83344529?v=4
- Repositories: 1
- Last ynced at: 2023-05-06T11:25:44.548Z
- Profile URL: https://github.com/cristobal-GC
GitHub Events
Total
- Create event: 9
- Issues event: 1
- Release event: 2
- Watch event: 13
- Delete event: 8
- Issue comment event: 1
- Push event: 127
- Pull request review event: 1
- Pull request event: 14
- Fork event: 2
Last Year
- Create event: 8
- Issues event: 1
- Release event: 1
- Watch event: 13
- Delete event: 8
- Issue comment event: 1
- Push event: 124
- Pull request review event: 1
- Pull request event: 14
- Fork event: 2
Committers metadata
Last synced: 4 days ago
Total Commits: 4,532
Total Committers: 96
Avg Commits per committer: 47.208
Development Distribution Score (DDS): 0.709
Commits in past year: 355
Committers in past year: 38
Avg Commits per committer in past year: 9.342
Development Distribution Score (DDS) in past year: 0.673
| Name | Commits | |
|---|---|---|
| Fabian Neumann | f****n@o****e | 1319 |
| pre-commit-ci[bot] | 6****] | 452 |
| Fabian | f****f@g****e | 427 |
| lisazeyen | l****n@w****e | 358 |
| Jonas Hörsch | j****h@k****u | 238 |
| Tom Brown | t****m@n****g | 216 |
| Cristóbal José Gallego Castillo | 8****C | 182 |
| martavp | m****z@g****m | 119 |
| martacki | m****i@k****u | 114 |
| Philipp Glaum | p****m@t****e | 95 |
| AmosSchledorn | a****n@i****m | 86 |
| Koen van Greevenbroek | k****k@u****o | 79 |
| virio-andreyana | 1****a | 77 |
| Lukas Trippe | l****p@p****e | 70 |
| Adam-Dvorak1 | 9****1 | 63 |
| euronion | 4****n | 51 |
| Parisra | 1****a | 37 |
| github-actions[bot] | 4****] | 36 |
| LukasFrankenQ | l****n@e****k | 35 |
| Michael Lindner | m****r@p****e | 32 |
| Bobby Xiong | 3****g | 30 |
| Thomas Gilon | t****i@c****m | 26 |
| millingermarkus | m****r@c****e | 26 |
| Max Parzen | m****n@e****k | 26 |
| toniseibold | t****b@g****m | 21 |
| Thomas Gilon | t****n@o****g | 18 |
| ekatef | e****a@g****m | 18 |
| chrstphtrs | c****s@t****e | 17 |
| cpschau | 1****u | 16 |
| Jeroen Peters | h****s@g****m | 15 |
| and 66 more... | ||
Committer domains:
- kit.edu: 3
- openenergytransition.org: 3
- mpe.au.dk: 2
- tu-berlin.de: 2
- pm.me: 2
- ed.ac.uk: 2
- iai-esm003.iai.kit.edu: 2
- outlook.de: 1
- gmx.de: 1
- nworbmot.org: 1
- uit.no: 1
- posteo.de: 1
- climact.com: 1
- chalmers.se: 1
- ieg.fraunhofer.de: 1
- eng.au.dk: 1
- oth-regensburg.de: 1
- gmx.net: 1
- users.fias.science: 1
- inatech.uni-freiburg.de: 1
- boku.ac.at: 1
- pik-potsdam.de: 1
- tuhh.de: 1
- campus.tu-berlin.de: 1
- fe1.prime.net: 1
- witte.sh: 1
- d-fine.de: 1
- git.com: 1
- sms.ed.ac.uk: 1
- hotmail.de: 1
Issue and Pull Request metadata
Last synced: 10 days ago
Total issues: 1
Total pull requests: 8
Average time to close issues: N/A
Average time to close pull requests: 12 days
Total issue authors: 1
Total pull request authors: 2
Average comments per issue: 0.0
Average comments per pull request: 0.0
Merged pull request: 2
Bot issues: 0
Bot pull requests: 7
Past year issues: 1
Past year pull requests: 7
Past year average time to close issues: N/A
Past year average time to close pull requests: 15 days
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.0
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 7
Top Issue Authors
- yasirroni (1)
Top Pull Request Authors
- github-actions[bot] (7)
- cristobal-GC (1)
Top Issue Labels
Top Pull Request Labels
Score: 7.397561535524052