Skip to content

Commit

Permalink
Fix negative district heating progress (#1168)
Browse files Browse the repository at this point in the history
* impose minimum district heating progress of 0

* update release_notes

* update configtables
  • Loading branch information
amos-schledorn authored Jul 19, 2024
1 parent 3fba8da commit 8fe5921
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/configtables/sector.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ biomass,--,"{true, false}",Flag to include biomass sector.
industry,--,"{true, false}",Flag to include industry sector.
agriculture,--,"{true, false}",Flag to include agriculture sector.
district_heating,--,,`prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_
-- potential,--,float,maximum fraction of urban demand which can be supplied by district heating
-- potential,--,float,maximum fraction of urban demand which can be supplied by district heating. Ignored where below current fraction.
-- progress,--,Dictionary with planning horizons as keys., Increase of today's district heating demand to potential maximum district heating share. Progress = 0 means today's district heating share. Progress = 1 means maximum fraction of urban demand is supplied by district heating
-- district_heating_loss,--,float,Share increase in district heat demand in urban central due to heat losses
cluster_heat_buses,--,"{true, false}",Cluster residential and service heat buses in `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_ to one to save memory.
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Upcoming Release

* Bugfix: Correctly read in threshold capacity below which to remove components from previous planning horizons in :mod:`add_brownfield`.

* Bugfix: Impose minimum value of zero for district heating progress between current and future market share in :mod:`build_district_heat_share`.

PyPSA-Eur 0.11.0 (25th May 2024)
=====================================

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_district_heat_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
urban_fraction = pd.concat([urban_fraction, dist_fraction_node], axis=1).max(axis=1)

# difference of max potential and today's share of district heating
diff = (urban_fraction * central_fraction) - dist_fraction_node
diff = ((urban_fraction * central_fraction) - dist_fraction_node).clip(lower=0)
progress = get(
snakemake.config["sector"]["district_heating"]["progress"], investment_year
)
Expand Down

0 comments on commit 8fe5921

Please sign in to comment.