BlockScience / aztec-gddt

Aztec Granular Design Digital Twin
Apache License 2.0
10 stars 0 forks source link

Remove the ability to have out of bound time series in value_from_param_timeseries_suf #276

Closed SeanMcOwen closed 2 months ago

SeanMcOwen commented 2 months ago

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
jackhack00 commented 2 months ago

agreed

SeanMcOwen commented 2 months ago

Completed with assertions and changes to the functions when I moved to L1