Merge pull request #721 from PyPSA/hotmaps-fallback-field

industry distribution: use EPRTR as fallback if ETS missing
This commit is contained in:
Fabian Neumann 2023-08-14 14:55:17 +02:00 committed by GitHub
commit 1a60dcb734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,8 @@ Upcoming Release
* Updated Global Energy Monitor LNG terminal data to March 2023 version.
* For industry distribution, use EPRTR as fallback if ETS data is not available.
PyPSA-Eur 0.8.1 (27th July 2023)
================================

View File

@ -115,7 +115,9 @@ def build_nodal_distribution_key(hotmaps, regions, countries):
facilities = hotmaps.query("country == @country and Subsector == @sector")
if not facilities.empty:
emissions = facilities["Emissions_ETS_2014"]
emissions = facilities["Emissions_ETS_2014"].fillna(
hotmaps["Emissions_EPRTR_2014"]
)
if emissions.sum() == 0:
key = pd.Series(1 / len(facilities), facilities.index)
else: