maybe_adjust_cost_and_potentials: cover all flags

This commit is contained in:
Fabian Neumann 2024-01-10 16:17:16 +01:00
parent 799ed06940
commit 725a0ef8c0

View File

@ -3346,7 +3346,7 @@ def remove_h2_network(n):
def maybe_adjust_costs_and_potentials(n, opts):
for o in opts:
flags = ["+e", "+p", "+m"]
flags = ["+e", "+p", "+m", "+c"]
if all(flag not in o for flag in flags):
continue
oo = o.split("+")
@ -3361,7 +3361,12 @@ def maybe_adjust_costs_and_potentials(n, opts):
suptechs = map(lambda c: c.split("-", 2)[0], carrier_list)
if oo[0].startswith(tuple(suptechs)):
carrier = oo[0]
attr_lookup = {"p": "p_nom_max", "e": "e_nom_max", "c": "capital_cost"}
attr_lookup = {
"p": "p_nom_max",
"e": "e_nom_max",
"c": "capital_cost",
"m": "marginal_cost",
}
attr = attr_lookup[oo[1][0]]
factor = float(oo[1][1:])
# beware if factor is 0 and p_nom_max is np.inf, 0*np.inf is nan