[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
afa5cc5014
commit
a9d0f295fb
@ -415,8 +415,8 @@ def calculate_supply_energy(n, label, supply_energy):
|
|||||||
|
|
||||||
def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
|
def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
|
||||||
"""
|
"""
|
||||||
Calculate the total energy supply/consumption of each component at the buses
|
Calculate the total energy supply/consumption of each component at the
|
||||||
aggregated by carrier and node.
|
buses aggregated by carrier and node.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bus_carriers = n.buses.carrier.unique()
|
bus_carriers = n.buses.carrier.unique()
|
||||||
@ -432,22 +432,27 @@ def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
s = (
|
s = (
|
||||||
pd.concat([
|
pd.concat(
|
||||||
|
[
|
||||||
(
|
(
|
||||||
c.pnl.p[items]
|
c.pnl.p[items]
|
||||||
.multiply(n.snapshot_weightings.generators, axis=0)
|
.multiply(n.snapshot_weightings.generators, axis=0)
|
||||||
.sum()
|
.sum()
|
||||||
.multiply(c.df.loc[items, "sign"])
|
.multiply(c.df.loc[items, "sign"])
|
||||||
),
|
),
|
||||||
c.df.loc[items][["bus", "carrier"]]
|
c.df.loc[items][["bus", "carrier"]],
|
||||||
], axis=1)
|
],
|
||||||
|
axis=1,
|
||||||
|
)
|
||||||
.groupby(by=["bus", "carrier"])
|
.groupby(by=["bus", "carrier"])
|
||||||
.sum()[0]
|
.sum()[0]
|
||||||
)
|
)
|
||||||
s = pd.concat([s], keys=[c.list_name])
|
s = pd.concat([s], keys=[c.list_name])
|
||||||
s = pd.concat([s], keys=[i])
|
s = pd.concat([s], keys=[i])
|
||||||
|
|
||||||
nodal_supply_energy = nodal_supply_energy.reindex(s.index.union(nodal_supply_energy.index))
|
nodal_supply_energy = nodal_supply_energy.reindex(
|
||||||
|
s.index.union(nodal_supply_energy.index)
|
||||||
|
)
|
||||||
nodal_supply_energy.loc[s.index, label] = s
|
nodal_supply_energy.loc[s.index, label] = s
|
||||||
|
|
||||||
for c in n.iterate_components(n.branch_components):
|
for c in n.iterate_components(n.branch_components):
|
||||||
@ -458,14 +463,18 @@ def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
s = (
|
s = (
|
||||||
pd.concat([
|
pd.concat(
|
||||||
|
[
|
||||||
(
|
(
|
||||||
(-1) * c.pnl["p" + end][items]
|
(-1)
|
||||||
|
* c.pnl["p" + end][items]
|
||||||
.multiply(n.snapshot_weightings.generators, axis=0)
|
.multiply(n.snapshot_weightings.generators, axis=0)
|
||||||
.sum()
|
.sum()
|
||||||
),
|
),
|
||||||
c.df.loc[items][["bus0", "carrier"]]
|
c.df.loc[items][["bus0", "carrier"]],
|
||||||
], axis=1)
|
],
|
||||||
|
axis=1,
|
||||||
|
)
|
||||||
.groupby(by=["bus0", "carrier"])
|
.groupby(by=["bus0", "carrier"])
|
||||||
.sum()[0]
|
.sum()[0]
|
||||||
)
|
)
|
||||||
|
@ -2907,7 +2907,9 @@ def add_industry(n, costs):
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
snakemake.config["industry"]["waste_to_energy"]
|
snakemake.config["industry"]["waste_to_energy"]
|
||||||
and options["regional_oil_demand"] # Should warn if regional_oil_demand is not true!!?
|
and options[
|
||||||
|
"regional_oil_demand"
|
||||||
|
] # Should warn if regional_oil_demand is not true!!?
|
||||||
):
|
):
|
||||||
|
|
||||||
n.madd(
|
n.madd(
|
||||||
@ -2957,7 +2959,7 @@ def add_industry(n, costs):
|
|||||||
* costs.at["waste CHP", "efficiency"],
|
* costs.at["waste CHP", "efficiency"],
|
||||||
marginal_cost=costs.at["waste CHP", "VOM"],
|
marginal_cost=costs.at["waste CHP", "VOM"],
|
||||||
efficiency=costs.at["waste CHP", "efficiency"],
|
efficiency=costs.at["waste CHP", "efficiency"],
|
||||||
efficiency2=costs.at['waste CHP', 'efficiency-heat'],
|
efficiency2=costs.at["waste CHP", "efficiency-heat"],
|
||||||
efficiency3=costs.at["oil", "CO2 intensity"],
|
efficiency3=costs.at["oil", "CO2 intensity"],
|
||||||
lifetime=costs.at["waste CHP", "lifetime"],
|
lifetime=costs.at["waste CHP", "lifetime"],
|
||||||
)
|
)
|
||||||
@ -2977,7 +2979,7 @@ def add_industry(n, costs):
|
|||||||
* costs.at["waste CHP CC", "efficiency"],
|
* costs.at["waste CHP CC", "efficiency"],
|
||||||
marginal_cost=costs.at["waste CHP CC", "VOM"],
|
marginal_cost=costs.at["waste CHP CC", "VOM"],
|
||||||
efficiency=costs.at["waste CHP CC", "efficiency"],
|
efficiency=costs.at["waste CHP CC", "efficiency"],
|
||||||
efficiency2=costs.at["waste CHP CC", 'efficiency-heat'],
|
efficiency2=costs.at["waste CHP CC", "efficiency-heat"],
|
||||||
efficiency3=costs.at["oil", "CO2 intensity"] * (1 - options["cc_fraction"]),
|
efficiency3=costs.at["oil", "CO2 intensity"] * (1 - options["cc_fraction"]),
|
||||||
efficiency4=costs.at["oil", "CO2 intensity"] * options["cc_fraction"],
|
efficiency4=costs.at["oil", "CO2 intensity"] * options["cc_fraction"],
|
||||||
lifetime=costs.at["waste CHP CC", "lifetime"],
|
lifetime=costs.at["waste CHP CC", "lifetime"],
|
||||||
|
Loading…
Reference in New Issue
Block a user