fix deprecation warnings

This commit is contained in:
martacki 2023-12-21 09:37:13 +01:00
parent f77f84af6a
commit 4d63a3f21b

20
scripts/prepare_sector_network.py Normal file → Executable file
View File

@ -425,7 +425,7 @@ def update_wind_solar_costs(n, costs):
logger.info(
"Added connection cost of {:0.0f}-{:0.0f} Eur/MW/a to {}".format(
connection_cost[0].min(), connection_cost[0].max(), tech
connection_cost.min(), connection_cost.max(), tech
)
)
@ -1630,7 +1630,7 @@ def build_heat_demand(n):
electric_nodes = n.loads.index[n.loads.carrier == "electricity"]
n.loads_t.p_set[electric_nodes] = (
n.loads_t.p_set[electric_nodes]
- electric_heat_supply.groupby(level=1, axis=1).sum()[electric_nodes]
- electric_heat_supply.T.groupby(level=1).sum().T[electric_nodes]
)
return heat_demand
@ -1722,16 +1722,16 @@ def add_heat(n, costs):
if sector in name:
heat_load = (
heat_demand[[sector + " water", sector + " space"]]
.groupby(level=1, axis=1)
.sum()[nodes[name]]
heat_demand[[sector + " water", sector + " space"]].T
.groupby(level=1)
.sum().T[nodes[name]]
.multiply(factor)
)
if name == "urban central":
heat_load = (
heat_demand.groupby(level=1, axis=1)
.sum()[nodes[name]]
heat_demand.T.groupby(level=1)
.sum().T[nodes[name]]
.multiply(
factor * (1 + options["district_heating"]["district_heating_loss"])
)
@ -1977,7 +1977,7 @@ def add_heat(n, costs):
)
w_space["tot"] = (
heat_demand_r["services space"] + heat_demand_r["residential space"]
) / heat_demand_r.groupby(level=[1], axis=1).sum()
) / heat_demand_r.T.groupby(level=[1]).sum().T
for name in n.loads[
n.loads.carrier.isin([x + " heat" for x in heat_systems])
@ -2039,7 +2039,7 @@ def add_heat(n, costs):
strengths = strengths.drop(s)
# reindex normed time profile of space heat demand back to hourly resolution
space_pu = space_pu.reindex(index=heat_demand.index).fillna(method="ffill")
space_pu = space_pu.reindex(index=heat_demand.index).ffill()
# add for each retrofitting strength a generator with heat generation profile following the profile of the heat demand
for strength in strengths:
@ -3210,7 +3210,7 @@ def cluster_heat_buses(n):
),
inplace=True,
)
pnl[k] = pnl[k].groupby(level=0, axis=1).agg(agg[k], **agg_group_kwargs)
pnl[k] = pnl[k].T.groupby(level=0).agg(agg[k], **agg_group_kwargs).T
# remove unclustered assets of service/residential
to_drop = c.df.index.difference(df.index)