Skip to content

Commit

Permalink
Fix issue with hydrogen markets: too loose filter criteria led to sel…
Browse files Browse the repository at this point in the history
…ect other H2 suppliers.
  • Loading branch information
romainsacchi committed Jun 28, 2024
1 parent 0c97f30 commit 6dc8c8c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Binary file modified premise/data/additional_inventories/lci-buses.xlsx
Binary file not shown.
Binary file modified premise/data/additional_inventories/lci-pass_cars.xlsx
Binary file not shown.
Binary file modified premise/data/additional_inventories/lci-trucks.xlsx
Binary file not shown.
9 changes: 3 additions & 6 deletions premise/fuels.py
Original file line number Diff line number Diff line change
Expand Up @@ -2248,16 +2248,14 @@ def generate_regional_fuel_market(
string = ""

# if the sum is zero, we need to select a provider
if (
if np.isclose(
self.iam_fuel_markets.sel(region=region, variables=prod_vars)
.interp(year=self.year)
.sum(dim=["variables"])
== 0
, 0, atol=1e-3
):
if "hydrogen" in dataset["name"].lower():
prod_vars = [
"hydrogen, from natural gas",
]
prod_vars = ["hydrogen, from natural gas",]

sum_share = 0
for prod_var in prod_vars:
Expand All @@ -2266,7 +2264,6 @@ def generate_regional_fuel_market(
prod_var, tuple(vars_map[fuel_category]), region, period
)
sum_share += share

else:
share = 1.0
sum_share = 1.0
Expand Down
10 changes: 8 additions & 2 deletions premise/iam_variables_mapping/fuels_variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,10 @@ hydrogen, from natural gas:
remind: Tech|Hydrogen|Gas|w/o CC|Efficiency
ecoinvent_aliases:
fltr: hydrogen production, steam methane reforming
mask:
name:
- biomethane
- CCS

hydrogen, from natural gas, with CCS:
lhv: 120
Expand All @@ -647,8 +651,10 @@ hydrogen, from biogas:
co2: 0
biogenic_share: 1
ecoinvent_aliases:
fltr:
- hydrogen production, steam methane reforming, from biomethane
fltr: hydrogen production, steam methane reforming, from biomethane
mask:
name:
- CCS

hydrogen, from biogas, with CCS:
lhv: 120
Expand Down
2 changes: 1 addition & 1 deletion premise/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def select_multiple_suppliers(
ws.get_many(
subset or self.database,
ws.either(
*[ws.contains("name", sup) for sup in possible_names]
*[ws.equals("name", sup) for sup in possible_names]
),
(
ws.either(
Expand Down

0 comments on commit 6dc8c8c

Please sign in to comment.