The end code is really dangerous, we want to have it stop the simulation if we give it a mismatched time frame. And we should have some idea of the timeframe prior to runs
def value_from_param_timeseries_suf(
params, state, param_key, var_value # -> tuple[Any, Any]
):
time_series = params[param_key]
if state["timestep"] < len(time_series):
value = time_series[state["timestep"]]
else:
value = time_series[-1]
return value
The end code is really dangerous, we want to have it stop the simulation if we give it a mismatched time frame. And we should have some idea of the timeframe prior to runs