ExtrapolateTime and integrate/interpolate/stack
Currently, ExtrapolateTime can't be usefully used with IntegrateTime or StackTime adapters. The problem is that with extrapolation, multiple pulls at the same (past) time are possible.
A solution could be to add the possibility to parameterize these adapters with a fixed time span (or pass it via metadata from downstream).
Illustrations
A depends on B, and B extrapolates from A:
A =O========O--------o
B =O===O===O===O===O---o
ab c d
B can't take from it's current time (d) or last time (c). It can choose between a) (own step before last time) and b) (A's step). In both cases, it would use the same incoming multiple times, and skip some data.
Again, A depends on B, and B extrapolates from A:
A =O===O===O---o
B =O========O--------o
a bc
B can't take from it's current time (c). It can choose between a) (own step) and b) (A's step).
Due to the smaller step of A, time integration would be feasible here. However, the delivered results would be inconsistent (repeated, different time span, ...).
Possible solutions
- Fixed interval for time integration adapters -> only a partial fix
- Fixed time offset that guarantees data availablility (
>= max(dt[self], dt[dependencies])
) - Allow only pulls for current time in circular/bi-directional couplings
- For components with a long time step that extrapolate from a much shorter time step (most critical):
- Get aggregate for fixed interval, ending at current time with a certain tolerance (+/- 1 short step)
- Fixed interval -> request parameter?
- ?
See !187 (merged) for implementation.
Possibilities for mHM <--> Formind coupling
Assuming 1y step for Formind 1d for mHM. Assuming 1y is not exactly 365d (i.e. no rendevouz at Jan 1st 0:00).
- Formind uses outdated data:
- Offset time to past by 1 Formind step + 1 mHM step
- --> Gets aggregated data for last year, offset by / +/- 1 day
- mHM uses outdated data, pull 12 slices at Jan 1st
- Pull for Formind's last push (should be between current time and next time)
- mHM uses outdated data, pull every step (adapter interpolates / adds seasonality)
- Offset time to past by 1y (Formind step) + 1 mHM step