Skip to content

Commit

Permalink
Merge branch 'pypsa-meets-earth:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
virio-andreyana authored Jan 23, 2025
2 parents 8a49a55 + 3d31fa1 commit 7ae215a
Show file tree
Hide file tree
Showing 18 changed files with 752 additions and 577 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
env_file: envs/linux-pinned.yaml
- os: macos
env_file: envs/macos-pinned.yaml
# - os: windows
# env_file: envs/windows-pinned.yaml
- os: windows
env_file: envs/windows-pinned.yaml

defaults:
run:
Expand Down
43 changes: 43 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ by
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pypsa-meets-earth/pypsa-earth/main.svg)](https://results.pre-commit.ci/latest/github/pypsa-meets-earth/pypsa-earth/main)
[![Discord](https://img.shields.io/discord/911692131440148490?logo=discord)](https://discord.gg/AnuJBk23FU)
[![Google Drive](https://img.shields.io/badge/Google%20Drive-4285F4?style=flat&logo=googledrive&logoColor=white)](https://drive.google.com/drive/folders/13Z8Y9zgsh5IZaDNkkRyo1wkoMgbdUxT5?usp=sharing)
[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.apenergy.2023.121096-blue)](https://doi.org/10.1016/j.apenergy.2023.121096)


**PyPSA-Earth: A Global Sector-Coupled Open-Source Multi-Energy System Model**

Expand Down Expand Up @@ -121,10 +123,10 @@ There are multiple ways to get involved and learn more about our work:

## 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.4.1, which is the last version before the repo `pypsa-earth-sec` was merged, the following command can be used:
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 repo `pypsa-earth-sec` was merged, the following command can be used:

```bash
git checkout v0.4.1
git checkout v0.6.0
```
After checking out the tag, the model can be run as usual. Please make sure to install the required packages for the respective version.

Expand Down
12 changes: 8 additions & 4 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from _helpers import (
get_last_commit_message,
check_config_version,
copy_default_files,
BASE_DIR,
)
from build_demand_profiles import get_load_paths_gegis
from retrieve_databundle_light import datafiles_retrivedatabundle
Expand Down Expand Up @@ -554,6 +555,7 @@ rule add_electricity:

rule simplify_network:
params:
aggregation_strategies=config["cluster_options"]["aggregation_strategies"],
renewable=config["renewable"],
crs=config["crs"],
cluster_options=config["cluster_options"],
Expand Down Expand Up @@ -599,6 +601,7 @@ if config["augmented_line_connection"].get("add_to_snakefile", False) == True:

rule cluster_network:
params:
aggregation_strategies=config["cluster_options"]["aggregation_strategies"],
build_shape_options=config["build_shape_options"],
electricity=config["electricity"],
costs=config["costs"],
Expand Down Expand Up @@ -684,6 +687,7 @@ if config["augmented_line_connection"].get("add_to_snakefile", False) == False:

rule cluster_network:
params:
aggregation_strategies=config["cluster_options"]["aggregation_strategies"],
build_shape_options=config["build_shape_options"],
electricity=config["electricity"],
costs=config["costs"],
Expand Down Expand Up @@ -814,7 +818,7 @@ if config["monte_carlo"]["options"].get("add_to_snakefile", False) == False:
solving=config["solving"],
augmented_line_connection=config["augmented_line_connection"],
input:
overrides="data/override_component_attrs",
overrides=BASE_DIR + "/data/override_component_attrs",
network="networks/" + RDIR + "elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
output:
"results/" + RDIR + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
Expand Down Expand Up @@ -881,7 +885,7 @@ if config["monte_carlo"]["options"].get("add_to_snakefile", False) == True:
solving=config["solving"],
augmented_line_connection=config["augmented_line_connection"],
input:
overrides="data/override_component_attrs",
overrides=BASE_DIR + "/data/override_component_attrs",
network="networks/"
+ RDIR
+ "elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_{unc}.nc",
Expand Down Expand Up @@ -1625,7 +1629,7 @@ if config["foresight"] == "overnight":
solving=config["solving"],
augmented_line_connection=config["augmented_line_connection"],
input:
overrides="data/override_component_attrs",
overrides=BASE_DIR + "/data/override_component_attrs",
# network=RESDIR
# + "prenetworks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_{sopts}_{planning_horizons}_{discountrate}.nc",
network=RESDIR
Expand Down Expand Up @@ -2091,7 +2095,7 @@ if config["foresight"] == "myopic":
"co2_sequestration_potential", 200
),
input:
overrides="data/override_component_attrs",
overrides=BASE_DIR + "/data/override_component_attrs",
network=RESDIR
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sopts}_{planning_horizons}_{discountrate}_{demand}_{h2export}export.nc",
costs=CDIR + "costs_{planning_horizons}.csv",
Expand Down
3 changes: 2 additions & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ cluster_options:
remove_stubs_across_borders: true
p_threshold_drop_isolated: 20 # [MW] isolated buses are being discarded if bus mean power is below the specified threshold
p_threshold_merge_isolated: 300 # [MW] isolated buses are being merged into a single isolated bus if a bus mean power is below the specified threshold
s_threshold_fetch_isolated: 0.05 # [-] a share of the national load for merging an isolated network into a backbone network
s_threshold_fetch_isolated: false # [-] a share of the national load for merging an isolated network into a backbone network
cluster_network:
algorithm: kmeans
feature: solar+onwind-time
Expand All @@ -98,6 +98,7 @@ cluster_options:
p_nom_max: sum
p_nom_min: sum
p_min_pu: mean
p_max_pu: weighted_average
marginal_cost: mean
committable: any
ramp_limit_up: max
Expand Down
11 changes: 10 additions & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ This part of documentation collects descriptive release notes to capture the mai

* Add a function to calculate length-based efficiencies and apply it to the H2 pipelines. `PR #1192 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1192>`__

* Support of Linopy for Power and Sector-Coupled Modelling and latest PyPSA version `PR #1172 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1172>`__

* Update workflow to geopandas >= 1.0 `PR #1276 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1276>`__

**Minor Changes and bug-fixing**

* Align structure of the components with consistency checks in the updated PyPSA version `PR #1315 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1315>`__

* Prevent computation of powerplantmatching if replace option is selected for custom_powerplants `PR #1281 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1281>`__

* Fix overlapping bus regions when alternative clustering is selected `PR #1287 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1287>`__
Expand All @@ -31,7 +37,9 @@ This part of documentation collects descriptive release notes to capture the mai

* Fix lossy bidirectional links, especially H2 pipelines, which would sometimes gain H2 instead of losing it. `PR #1192 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1192>`__

* Fix the need for administrative rights on Windows by changing all shadow directory settings for Windows in the Snakefile `PR #1295 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1295>`__
* Fix the need for administrative rights on Windows by changing all shadow directory settings for Windows in the Snakefile `PR #1295 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1295>`__ and `PR #1301 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1301>`__

* Add CITATION.cff to guide users on how cite PyPSA-Earth. Insert the DOI badge in the README linking to the very first PyPSA-Earth paper. `PR #1316 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1316>`__

PyPSA-Earth 0.6.0
=================
Expand Down Expand Up @@ -158,6 +166,7 @@ PyPSA-Earth 0.4.0

* Add an option to use csv format for custom demand imports. `PR #995 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/995>`__


**Minor Changes and bug-fixing**

* Minor bug-fixing to run the cluster wildcard min `PR #1019 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1019>`__
Expand Down
11 changes: 6 additions & 5 deletions envs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
- pip
- mamba # esp for windows build

- pypsa>=0.24, <0.25
- pypsa>=0.25
# - atlite>=0.2.4 # until https://github.com/PyPSA/atlite/issues/244 is not merged
- dask
# currently the packages are being installed with pip
# need to move back to conda once the issues will be resolved
Expand All @@ -28,13 +29,14 @@ dependencies:
- memory_profiler
- ruamel.yaml<=0.17.26
- pytables
- pyscipopt # added to compy with the quadratic objective requirement of the clustering script
- lxml
- numpy
# starting from 1.3.5 numpoly requires numpy>2.0 which leads to issues
- numpoly<=1.3.4
- pandas
- geopandas>=0.11.0, <=0.14.3
- fiona!=1.8.22, <1.10.0
- geopandas>=1
- fiona>=1.10
- xarray>=2023.11.0, <2023.12.0
- netcdf4
- networkx
Expand All @@ -49,6 +51,7 @@ dependencies:
- pyogrio
- numba
- py7zr
- tsam>=1.1.0

# Keep in conda environment when calling ipython
- ipython
Expand Down Expand Up @@ -80,11 +83,9 @@ dependencies:

# Default solver for tests (required for CI)
- glpk
- ipopt
- gurobi

- pip:
- git+https://github.com/davide-f/google-drive-downloader@master # google drive with fix for virus scan
- tsam>=1.1.0
- chaospy # lastest version only available on pip
- fake_useragent
Loading

0 comments on commit 7ae215a

Please sign in to comment.