[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-08-05 08:46:28 +00:00
parent 69f51ec7d6
commit e0b5fe9048

View File

@ -2266,26 +2266,31 @@ def add_biomass(n, costs):
n.add("Carrier", "biogas") n.add("Carrier", "biogas")
n.add("Carrier", "solid biomass") n.add("Carrier", "solid biomass")
if (
if (options["municipal_solid_waste"] and not options["industry"] options["municipal_solid_waste"]
and cf_industry["waste_to_energy"] or cf_industry["waste_to_energy_cc"]): and not options["industry"]
logger.warning("Flag municipal_solid_waste can be only used with industry " and cf_industry["waste_to_energy"]
"sector waste to energy." or cf_industry["waste_to_energy_cc"]
"Setting municipal_solid_waste=False.") ):
logger.warning(
"Flag municipal_solid_waste can be only used with industry "
"sector waste to energy."
"Setting municipal_solid_waste=False."
)
options["municipal_solid_waste"] = False options["municipal_solid_waste"] = False
if options["municipal_solid_waste"]: if options["municipal_solid_waste"]:
n.add("Carrier", "municipal solid waste") n.add("Carrier", "municipal solid waste")
n.madd( n.madd(
"Bus", "Bus",
spatial.msw.nodes, spatial.msw.nodes,
location=spatial.msw.locations, location=spatial.msw.locations,
carrier="municipal solid waste", carrier="municipal solid waste",
) )
e_max_pu = pd.Series([1] * (len(n.snapshots) - 1) + [0], index=n.snapshots) e_max_pu = pd.Series([1] * (len(n.snapshots) - 1) + [0], index=n.snapshots)
n.madd( n.madd(
"Store", "Store",
@ -2297,7 +2302,7 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu, e_max_pu=e_max_pu,
e_initial=msw_biomass_potentials_spatial, e_initial=msw_biomass_potentials_spatial,
) )
n.madd( n.madd(
"Bus", "Bus",
spatial.gas.biogas, spatial.gas.biogas,
@ -2314,7 +2319,6 @@ def add_biomass(n, costs):
unit="MWh_LHV", unit="MWh_LHV",
) )
n.madd( n.madd(
"Store", "Store",
spatial.gas.biogas, spatial.gas.biogas,
@ -2382,8 +2386,6 @@ def add_biomass(n, costs):
* costs.at["solid biomass", "CO2 intensity"], * costs.at["solid biomass", "CO2 intensity"],
p_nom_extendable=True, p_nom_extendable=True,
) )
n.madd( n.madd(
"Link", "Link",
@ -2455,7 +2457,7 @@ def add_biomass(n, costs):
marginal_cost=biomass_transport.costs * biomass_transport.length.values, marginal_cost=biomass_transport.costs * biomass_transport.length.values,
carrier="solid biomass transport", carrier="solid biomass transport",
) )
if options["municipal_solid_waste"]: if options["municipal_solid_waste"]:
n.madd( n.madd(
"Link", "Link",
@ -2497,7 +2499,7 @@ def add_biomass(n, costs):
constant=biomass_potentials["solid biomass"].sum(), constant=biomass_potentials["solid biomass"].sum(),
type="operational_limit", type="operational_limit",
) )
if options["municipal_solid_waste"]: if options["municipal_solid_waste"]:
# Add municipal solid waste # Add municipal solid waste
n.madd( n.madd(