Correctly carry over time-varying data between investment periods

Previously, time-varying data in each "next" investment period was set
to the default values, implying capacity factors of 1 for renewable
generators for example.
This commit is contained in:
Koen van Greevenbroek 2024-02-01 14:46:13 +00:00
parent 25a24f5552
commit de384c7cf6

View File

@ -199,8 +199,13 @@ def concat_networks(years):
pnl[k].loc[pnl_year.index, pnl_year.columns] = pnl_year
else:
# this is to avoid adding multiple times assets with
# infinite lifetime as ror
# For components that aren't new, we just extend
# time-varying data from the previous investment
# period.
if i > 0:
pnl[k].loc[(year,)] = pnl[k].loc[(years[i - 1],)].values
# Now, add time-varying data for new components.
cols = pnl_year.columns.difference(pnl[k].columns)
pnl[k] = pd.concat([pnl[k], pnl_year[cols]], axis=1)