fix: Handle missing geothermal potential data in non-EU 27#1617
fix: Handle missing geothermal potential data in non-EU 27#1617
Conversation
amos-schledorn
left a comment
There was a problem hiding this comment.
Looks great! I just have two stylistic comments.
| heat_source_power = heat_potentials_in_onshore_regions_aggregated * scaling_factor | ||
|
|
||
| non_covered_regions = regions_onshore.index.difference(heat_source_power.index) | ||
| if not non_covered_regions.empty: |
There was a problem hiding this comment.
This looks a little error-prone: In case of a bug, where the user only intends to fill values for UK but the heat-potential calculation is faulty, this would set all potentials to zero rather than throwing an error. Shouldn't we make the check explicitly for UK-only?
amos-schledorn
left a comment
There was a problem hiding this comment.
Thanks for the changes! I think we should handle the country list more elegantly but I'd suggest doing this globally (see #1620 ).
There was a problem hiding this comment.
Fine for me, but I think a plain warning without any configuration option, just handling of the reindex without raising ValueErrors would have been more than sufficient.
logger.warning(
f"The onshore regions outside EU 27 ({non_covered_regions.to_list()}) have no heat source power. Filling with zeros."
)| limited_heat_sources: | ||
| geothermal: | ||
| constant_temperature_celsius: 65 | ||
| ignore_missing_regions: false |
There was a problem hiding this comment.
| ignore_missing_regions: false | |
| ignore_missing_regions: true |
The default should be more lenient, I would say. Otherwise, the standard config will fail, wouldn't it?
Changes proposed in this Pull Request
This PR implements two ways to deal with the missing geothermal potential data for countries outside the EU 27 in the dataset of Manz et al. that was integrated into the workflow in #1516. The error was occurring when including geothermal as heat source for direct utilisation and heat pumps in district heating using the config parameter
sector: heat_pump_sources: urban_central:. The user can choose to ignore the missing data by assuming 0 potentials in the non-EU-27 countries by setting the parametersector: district_heating: limited_heat_sources: geothermal: ignore_missing_regionstotrue. Otherwise, an error is thrown in the rulebuild_geothermal_heat_potential.Checklist
envs/environment.yaml.config/config.default.yaml.doc/configtables/*.csv.doc/data_sources.rst.doc/release_notes.rstis added.