Skip to content

Time Release Rules

Canonical import path: alphaforge.time.release_rules. alphaforge.pit.release_rules remains as a compatibility shim.

alphaforge.time.release_rules

Release schedule rules for publication and availability semantics.

These rules model expected public release timing for a reference-period observation. They are an expectation layer: realized PIT timestamps always take precedence when available from source data.

CalendarDay dataclass

Bases: ReleaseRule

Published on a specific calendar day of the anchor month.

CustomRule dataclass

Bases: ReleaseRule

Free-text description for schedules that are not yet modeled.

FixedLagMonths dataclass

Bases: ReleaseRule

Published a fixed number of months after the observation month.

NthBusinessDay dataclass

Bases: ReleaseRule

Published on the n-th US business day of an anchor month.

NthWeekday dataclass

Bases: ReleaseRule

Published on the n-th occurrence of a weekday in the anchor month.

QuarterlyRelease dataclass

Bases: ReleaseRule

GDP-style multi-release schedule.

ReleaseRule dataclass

Bases: ABC

Base class for publication schedule rules.

expected_release_date(obs_date: date, release_number: int | None = None) -> date abstractmethod

Return the expected publication date for an observation date.

from_dict(payload: dict[str, Any]) -> 'ReleaseRule' staticmethod

Reconstruct a rule from a YAML-style mapping.

to_dict() -> dict[str, Any]

Serialize the rule to a YAML-friendly mapping.

WeeklyRelease dataclass

Bases: ReleaseRule

Weekly series released on a fixed weekday after a lag.