[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] 2023-12-04 11:20:38 +00:00
parent f3fcd43eef
commit 92ccb517f3
3 changed files with 7 additions and 6 deletions

View File

@ -29,7 +29,7 @@ countries: ['BE']
snapshots: snapshots:
start: "2013-03-01" start: "2013-03-01"
end: "2013-03-08" end: "2013-03-08"
sector: sector:
central_heat_vent: true central_heat_vent: true

View File

@ -44,7 +44,7 @@ electricity:
sector: sector:
min_part_load_fischer_tropsch: 0 min_part_load_fischer_tropsch: 0
min_part_load_methanolisation: 0 min_part_load_methanolisation: 0
atlite: atlite:
default_cutout: be-03-2013-era5 default_cutout: be-03-2013-era5
cutouts: cutouts:

View File

@ -30,13 +30,14 @@ opt_name = {"Store": "e", "Line": "s", "Transformer": "s"}
def reindex_columns(df, cols): def reindex_columns(df, cols):
investments = cols.levels[3] investments = cols.levels[3]
if len(cols.names)!=len(df.columns.levels): if len(cols.names) != len(df.columns.levels):
df = pd.concat([df] * len(investments), axis=1) df = pd.concat([df] * len(investments), axis=1)
df.columns = cols df.columns = cols
df = df.reindex(cols, axis=1) df = df.reindex(cols, axis=1)
return df return df
def calculate_costs(n, label, costs): def calculate_costs(n, label, costs):
investments = n.investment_periods investments = n.investment_periods
cols = pd.MultiIndex.from_product( cols = pd.MultiIndex.from_product(
@ -48,7 +49,7 @@ def calculate_costs(n, label, costs):
], ],
names=costs.columns.names[:3] + ["year"], names=costs.columns.names[:3] + ["year"],
) )
costs = reindex_columns(costs, cols) costs = reindex_columns(costs, cols)
for c in n.iterate_components( for c in n.iterate_components(