Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 5, 2024
1 parent 69f51ec commit e0b5fe9
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2266,26 +2266,31 @@ def add_biomass(n, costs):

n.add("Carrier", "biogas")
n.add("Carrier", "solid biomass")


if (options["municipal_solid_waste"] and not options["industry"]
and cf_industry["waste_to_energy"] or cf_industry["waste_to_energy_cc"]):
logger.warning("Flag municipal_solid_waste can be only used with industry "
"sector waste to energy."
"Setting municipal_solid_waste=False.")

if (
options["municipal_solid_waste"]
and not options["industry"]
and cf_industry["waste_to_energy"]
or cf_industry["waste_to_energy_cc"]
):
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

if options["municipal_solid_waste"]:

n.add("Carrier", "municipal solid waste")

n.madd(
"Bus",
spatial.msw.nodes,
location=spatial.msw.locations,
carrier="municipal solid waste",
)

e_max_pu = pd.Series([1] * (len(n.snapshots) - 1) + [0], index=n.snapshots)
n.madd(
"Store",
Expand All @@ -2297,7 +2302,7 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
e_initial=msw_biomass_potentials_spatial,
)

n.madd(
"Bus",
spatial.gas.biogas,
Expand All @@ -2314,7 +2319,6 @@ def add_biomass(n, costs):
unit="MWh_LHV",
)


n.madd(
"Store",
spatial.gas.biogas,
Expand Down Expand Up @@ -2382,8 +2386,6 @@ def add_biomass(n, costs):
* costs.at["solid biomass", "CO2 intensity"],
p_nom_extendable=True,
)



n.madd(
"Link",
Expand Down Expand Up @@ -2455,7 +2457,7 @@ def add_biomass(n, costs):
marginal_cost=biomass_transport.costs * biomass_transport.length.values,
carrier="solid biomass transport",
)

if options["municipal_solid_waste"]:
n.madd(
"Link",
Expand Down Expand Up @@ -2497,7 +2499,7 @@ def add_biomass(n, costs):
constant=biomass_potentials["solid biomass"].sum(),
type="operational_limit",
)

if options["municipal_solid_waste"]:
# Add municipal solid waste
n.madd(
Expand Down

0 comments on commit e0b5fe9

Please sign in to comment.