DataFeed๏
DataFeed: the only object that hands out data during a run.
Everything a model sees while being evaluated flows through here, bound to the
simulation clock (asof). Availability rules live on the
Field; the feed enforces them:
actuals โ values stamped
tare served ifft + availability_lag <= asof;forecasts โ runs issued at
iare served iffi + availability_lag <= asof, and per valid_time the latest such run wins;statics โ always served.
With the feed as the sole gate, look-ahead leakage is impossible by construction rather than by runner discipline.
- class emflow.data.feed.DataFeed(dataset: Dataset)[source]๏
Bases:
objectPoint-in-time access to a
Dataset.- history(asof, name: str, window=None, strict=False) DataFrame[source]๏
Actual values of field
nameknowable atasof.For bitemporal fields (
knowledge_colset) the filter runs on the knowledge axis and, per measurement timestamp, the latest revision already knowable wins โ a backtest sees preliminary values exactly as a live participant did. The knowledge column is dropped from the returned frame.window(optional, anythingpd.Timedeltaaccepts) limits the result to the trailing window before the availability cutoff โ an efficiency knob, never a leakage one.strictexcludes the cutoff instant itself (<instead of<=). Training views use this so a training boundary placed exactly on the first scored target never serves it.
- forecasts(asof, name: str, columns=None) DataFrame[source]๏
Latest forecast run of field
nameknowable atasof.Returns a frame indexed by
valid_timewhere, for each valid_time, the value comes from the most recent run withissue_time + availability_lag <= asof. Anissue_timecolumn records which run each row came from.
- actuals_between(name: str, start, end, asof) DataFrame[source]๏
Actuals of
namein[start, end]โ only if knowable atasof.Used by environments to settle scores: returns the slice restricted to what the availability rule allows at
asof(so an env can only score an origin once its targets have actually arrived).
- class emflow.data.feed.TimeView(feed: DataFeed, asof, strict=False)[source]๏
Bases:
objectA
DataFeedfrozen at one clock time.This is the whole world a model gets to see: observations and training views are
TimeViews. There is deliberately no way to reach the underlying dataset or move the clock from here.- property fields๏