Skip to content

fix: Handle missing geothermal potential data in non-EU 27#1617

Merged
fneum merged 5 commits intomasterfrom
missing_geothermal_data
Apr 3, 2025
Merged

fix: Handle missing geothermal potential data in non-EU 27#1617
fneum merged 5 commits intomasterfrom
missing_geothermal_data

Conversation

@cpschau
Copy link
Copy Markdown
Contributor

@cpschau cpschau commented Mar 28, 2025

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 parameter sector: district_heating: limited_heat_sources: geothermal: ignore_missing_regions to true. Otherwise, an error is thrown in the rule build_geothermal_heat_potential.

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

@cpschau cpschau requested a review from amos-schledorn March 28, 2025 16:32
@cpschau cpschau changed the title Missing geothermal data fix: Handle missing geothermal data Mar 28, 2025
@cpschau cpschau changed the title fix: Handle missing geothermal data fix: Handle missing geothermal potential data in GB Mar 28, 2025
Copy link
Copy Markdown
Contributor

@amos-schledorn amos-schledorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@cpschau cpschau requested a review from amos-schledorn March 31, 2025 08:15
@cpschau cpschau changed the title fix: Handle missing geothermal potential data in GB fix: Handle missing geothermal potential data in non-EU 27 Mar 31, 2025
@cpschau cpschau requested a review from fneum March 31, 2025 08:26
Copy link
Copy Markdown
Contributor

@amos-schledorn amos-schledorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I think we should handle the country list more elegantly but I'd suggest doing this globally (see #1620 ).

Copy link
Copy Markdown
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

@fneum fneum merged commit b5e7ada into master Apr 3, 2025
10 of 12 checks passed
@fneum fneum deleted the missing_geothermal_data branch April 3, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants