Merge pull request #874 from PyPSA/future-warnings
eliminate a few future warnings
This commit is contained in:
commit
2f5f260c18
@ -521,9 +521,7 @@ def calculate_weighted_prices(n, label, weighted_prices):
|
|||||||
|
|
||||||
if not names.empty:
|
if not names.empty:
|
||||||
load += (
|
load += (
|
||||||
n.links_t.p0[names]
|
n.links_t.p0[names].T.groupby(n.links.loc[names, "bus0"]).sum().T
|
||||||
.groupby(n.links.loc[names, "bus0"], axis=1)
|
|
||||||
.sum()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add H2 Store when charging
|
# Add H2 Store when charging
|
||||||
@ -563,11 +561,10 @@ def calculate_market_values(n, label, market_values):
|
|||||||
|
|
||||||
dispatch = (
|
dispatch = (
|
||||||
n.generators_t.p[gens]
|
n.generators_t.p[gens]
|
||||||
.groupby(n.generators.loc[gens, "bus"], axis=1)
|
.T.groupby(n.generators.loc[gens, "bus"])
|
||||||
.sum()
|
.sum()
|
||||||
.reindex(columns=buses, fill_value=0.0)
|
.T.reindex(columns=buses, fill_value=0.0)
|
||||||
)
|
)
|
||||||
|
|
||||||
revenue = dispatch * n.buses_t.marginal_price[buses]
|
revenue = dispatch * n.buses_t.marginal_price[buses]
|
||||||
|
|
||||||
market_values.at[tech, label] = revenue.sum().sum() / dispatch.sum().sum()
|
market_values.at[tech, label] = revenue.sum().sum() / dispatch.sum().sum()
|
||||||
@ -586,9 +583,9 @@ def calculate_market_values(n, label, market_values):
|
|||||||
|
|
||||||
dispatch = (
|
dispatch = (
|
||||||
n.links_t["p" + i][links]
|
n.links_t["p" + i][links]
|
||||||
.groupby(n.links.loc[links, "bus" + i], axis=1)
|
.T.groupby(n.links.loc[links, "bus" + i])
|
||||||
.sum()
|
.sum()
|
||||||
.reindex(columns=buses, fill_value=0.0)
|
.T.reindex(columns=buses, fill_value=0.0)
|
||||||
)
|
)
|
||||||
|
|
||||||
revenue = dispatch * n.buses_t.marginal_price[buses]
|
revenue = dispatch * n.buses_t.marginal_price[buses]
|
||||||
|
@ -154,7 +154,7 @@ def plot_costs():
|
|||||||
|
|
||||||
df = df.drop(to_drop)
|
df = df.drop(to_drop)
|
||||||
|
|
||||||
logger.info(f"Total system cost of {round(df.sum()[0])} EUR billion per year")
|
logger.info(f"Total system cost of {round(df.sum().iloc[0])} EUR billion per year")
|
||||||
|
|
||||||
new_index = preferred_order.intersection(df.index).append(
|
new_index = preferred_order.intersection(df.index).append(
|
||||||
df.index.difference(preferred_order)
|
df.index.difference(preferred_order)
|
||||||
@ -214,7 +214,7 @@ def plot_energy():
|
|||||||
|
|
||||||
df = df.drop(to_drop)
|
df = df.drop(to_drop)
|
||||||
|
|
||||||
logger.info(f"Total energy of {round(df.sum()[0])} TWh/a")
|
logger.info(f"Total energy of {round(df.sum().iloc[0])} TWh/a")
|
||||||
|
|
||||||
if df.empty:
|
if df.empty:
|
||||||
fig, ax = plt.subplots(figsize=(12, 8))
|
fig, ax = plt.subplots(figsize=(12, 8))
|
||||||
@ -304,7 +304,9 @@ def plot_balances():
|
|||||||
|
|
||||||
df = df.drop(to_drop)
|
df = df.drop(to_drop)
|
||||||
|
|
||||||
logger.debug(f"Total energy balance for {v} of {round(df.sum()[0],2)} {units}")
|
logger.debug(
|
||||||
|
f"Total energy balance for {v} of {round(df.sum().iloc[0],2)} {units}"
|
||||||
|
)
|
||||||
|
|
||||||
if df.empty:
|
if df.empty:
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user