Fix handling of activity years and life time of technologies in the tutorials
Secondly, as observed in the follow-up discussions on the last capacity building workshop, when we add parameters where the index includes both vintage and activity years, then in the past we have just added activity years that stretch the entire model horizon, irrespective of the lifetime of the technology. This definitely needs to be fixed as this causes too much confusion for new users.
Originally posted by @OFR-IIASA in https://github.com/iiasa/message_ix/issues/502#issuecomment-908102971
@LauWien I added a small bit of code for the Indian colleagues in a tutorial. Please find the snippet below:
for tec, val in costs.items():
for y in scenario.par('technical_lifetime',
filters={'node_loc': country,
'technology': tec})['year_vtg'].tolist():
year_act = scenario.years_active(node=country, tec=tec, yr_vtg=y)
df = make_df(base_fix_cost,
technology=tec,
value=val,
year_vtg=y,
year_act=year_act)
scenario.add_par('fix_cost', df)
Perfect, thank you!
I think this issue is relevant beyond tutorials. While trying to add data frames for new technologies in the global model using make_df , the year_act and year_vtg are not mapped according to technical_lifetime