Skip to content

Commit

Permalink
Merge branch 'main' into restore_geopandas_version
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-f authored Dec 23, 2024
2 parents d5cc2e8 + 236e0d0 commit 5ff7ac0
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
on:
schedule:
- cron: "0 5 * * 0"
- cron: "0 5 1 * *"
workflow_dispatch:

jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
if: ${{ github.repository_owner == 'pypsa-meets-earth' && github.ref == 'refs/heads/main'}}
steps:
- name: Contribute List
uses: akhilmhdh/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-pinned-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:

jobs:
update-pinned-environment:
if: ${{ github.ref == 'refs/heads/main' }}
# the update is always needed for env changes in main and sometimes for other branches
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
name: Update pinned envs
runs-on: ${{ matrix.os }}-latest
strategy:
Expand Down
43 changes: 39 additions & 4 deletions configs/bundle_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ databundles:
category: data
destination: "data"
urls:
zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_tutorial_NGBJ.zip?download=1
gdrive: https://drive.google.com/file/d/1Vb1ISjhy7iwTTZYeezGd6S4nLt-EDGme/view?usp=drive_link
zenodo: https://sandbox.zenodo.org/records/145504/files/bundle_tutorial_NGBJ_with_gadmlike.zip?download=1
gdrive: https://drive.google.com/file/d/12K03Epx3O9o-IQLh9afzCQyT-nMKWM3P/view?usp=drive_link
output:
- data/gebco/GEBCO_2021_TID.nc
- data/copernicus/PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif
- data/gadm/gadm41_NGA/gadm41_NGA.gpkg # needed in build_shapes
- data/gadm/gadm41_BEN/gadm41_BEN.gpkg # needed in build_shapes
- data/gadm/gadm36_NGA/gadm36_NGA.gpkg # needed in sector-coupled model
- data/gadm/gadm36_BEN/gadm36_BEN.gpkg # needed in sector-coupled model

# tutorial bundle specific for Botswana only
bundle_tutorial_BW:
Expand All @@ -49,11 +53,13 @@ databundles:
category: data
destination: "data"
urls:
zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_tutorial_BW.zip?download=1
gdrive: https://drive.google.com/file/d/19IXvTD8gVSzgTInL85ta7QjaNI8ZPCCY/view?usp=drive_link
zenodo: https://sandbox.zenodo.org/records/145504/files/bundle_tutorial_BW_with_gadmlike.zip?download=1
gdrive: https://drive.google.com/file/d/1YbbYGs1NsSsZYqNX1g1Jo-iJzt5m-81c/view?usp=drive_link
output:
- data/gebco/GEBCO_2021_TID.nc
- data/copernicus/PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif
- data/gadm/gadm41_BWA/gadm41_BWA.gpkg # needed in build_shapes
- data/gadm/gadm36_BWA/gadm36_BWA.gpkg # needed in sector-coupled model

# tutorial bundle specific for Morocco only
bundle_tutorial_MA:
Expand Down Expand Up @@ -364,3 +370,32 @@ databundles:
urls:
protectedplanet: https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{month:s}{year:d}_Public_shp.zip
output: [data/landcover/world_protected_areas/*]

# Backup tutorial bundles with no gadm-like data; for reference:
# https://github.com/pypsa-meets-earth/pypsa-earth/issues/1258
#
# # tutorial bundle specific for Nigeria and Benin only, without gadm-like data
# bundle_tutorial_NGBJ:
# countries: [NG, BJ]
# tutorial: true
# category: data
# destination: "data"
# urls:
# zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_tutorial_NGBJ.zip?download=1
# gdrive: https://drive.google.com/file/d/1Vb1ISjhy7iwTTZYeezGd6S4nLt-EDGme/view?usp=drive_link
# output:
# - data/gebco/GEBCO_2021_TID.nc
# - data/copernicus/PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif

# # tutorial bundle specific for Botswana only, without gadm-like data
# bundle_tutorial_BW:
# countries: [BW]
# tutorial: true
# category: data
# destination: "data"
# urls:
# zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_tutorial_BW.zip?download=1
# gdrive: https://drive.google.com/file/d/19IXvTD8gVSzgTInL85ta7QjaNI8ZPCCY/view?usp=drive_link
# output:
# - data/gebco/GEBCO_2021_TID.nc
# - data/copernicus/PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif
3 changes: 3 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ This part of documentation collects descriptive release notes to capture the mai

**Minor Changes and bug-fixing**

* Added electricity bus to Fischer-Tropsch in prepare_sector_network.py `PR #1226 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1226>`__

* Update BW, NG and BJ tutorial databundles to include gadm-like sources from geoboundaries `PR #1257 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1257>`__


PyPSA-Earth 0.5.0
Expand Down
5 changes: 3 additions & 2 deletions scripts/prepare_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def set_line_nom_max(n, s_nom_max_set=np.inf, p_nom_max_set=np.inf):
clusters="4",
ll="c1",
opts="Co2L-4H",
configfile="test/config.sector.yaml",
)

configure_logging(snakemake)
Expand Down Expand Up @@ -372,10 +373,10 @@ def set_line_nom_max(n, s_nom_max_set=np.inf, p_nom_max_set=np.inf):
co2limit = co2limit * float(m[0])
logger.info("Setting CO2 limit according to emission base year.")
elif len(m) > 0:
co2limit = float(m[0]) * snakemake.params.electricity["co2base"]
co2limit = float(m[0]) * float(snakemake.params.electricity["co2base"])
logger.info("Setting CO2 limit according to wildcard value.")
else:
co2limit = snakemake.params.electricity["co2limit"]
co2limit = float(snakemake.params.electricity["co2limit"])
logger.info("Setting CO2 limit according to config value.")
add_co2limit(n, co2limit, Nyears)
break
Expand Down
3 changes: 3 additions & 0 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def H2_liquid_fossil_conversions(n, costs):
bus0=spatial.nodes + " H2",
bus1=spatial.oil.nodes,
bus2=spatial.co2.nodes,
bus3=spatial.nodes,
carrier="Fischer-Tropsch",
efficiency=costs.at["Fischer-Tropsch", "efficiency"],
capital_cost=costs.at["Fischer-Tropsch", "fixed"]
Expand All @@ -178,6 +179,8 @@ def H2_liquid_fossil_conversions(n, costs):
], # Use efficiency to convert from EUR/MW_FT/a to EUR/MW_H2/a
efficiency2=-costs.at["oil", "CO2 intensity"]
* costs.at["Fischer-Tropsch", "efficiency"],
efficiency3=-costs.at["Fischer-Tropsch", "electricity-input"]
/ costs.at["Fischer-Tropsch", "hydrogen-input"],
p_nom_extendable=True,
p_min_pu=options.get("min_part_load_fischer_tropsch", 0),
lifetime=costs.at["Fischer-Tropsch", "lifetime"],
Expand Down

0 comments on commit 5ff7ac0

Please sign in to comment.