numeraire.core.data.VintagedBlock#

class numeraire.core.data.VintagedBlock(table: DataFrame, *, series: list[str] | None = None, name: str | None = None, ref_col: str = 'ref_date', vintage_col: str = 'vintage')[source]#

Bases: object

A vintaged (point-in-time) block: a (ref_date x vintage) panel resolved by asof.

Built from a tidy table [ref_date, vintage, <series...>] (e.g. what a FRED-MD build yields). asof(t) returns the real-time edge: among rows whose vintage timestamp is at or before t (vintage <= t), the most recent ref_date’s value taken from its latest available vintage. Availability is a plain timestamp comparison — a release stamped on a given day becomes visible on that day and not before — so revisions are respected (an earlier vintage’s number is used until a later one is released) and no future vintage leaks in.

Availability is read straight off the vintage column, which must already carry the true release timestamp (the data provider’s job). To model a more conservative real-time cut — e.g. a feed that arrives some time after its stamped release — shift the vintage column before building the block:

table = table.assign(vintage=table["vintage"] + pd.DateOffset(months=1))
block = VintagedBlock(table)
__init__(table: DataFrame, *, series: list[str] | None = None, name: str | None = None, ref_col: str = 'ref_date', vintage_col: str = 'vintage') None[source]#

Methods

__init__(table, *[, series, name, ref_col, ...])

asof(t)

Real-time vector at t: latest ref_date's value from its latest available vintage.

is_ready(t)

Whether any vintage is available at t (False before the first release timestamp).

truncate(end)

A copy holding only vintages released by end (vintage <= end).

Attributes

names

Feature (series) names of this block.

property names: list[str]#

Feature (series) names of this block.

is_ready(t: object) bool[source]#

Whether any vintage is available at t (False before the first release timestamp).

asof(t: object) NDArray[float64][source]#

Real-time vector at t: latest ref_date’s value from its latest available vintage.

truncate(end: object) VintagedBlock[source]#

A copy holding only vintages released by end (vintage <= end).