numeraire.testing.check_no_lookahead#

numeraire.testing.check_no_lookahead(estimator: Any, view_factory: Callable[[], Any]) None[source]#

to_weights / expected_returns up to t are invariant to mutating data after t.

Both multi-date extraction surfaces (a weight stream and a priced cross-section) are handed a view spanning data after t and must window internally, so a leak — using post-t data for a <= t row — shows up here as a changed row when the future is perturbed. to_forecast is not probed: the engine only ever passes forecast() a prefix-truncated view.window(origin), so a forecast at origin d <= t cannot see post-t data and a perturbation probe could never fail — a forecast leak instead surfaces in the zoo’s engine ≡ vectorized equality test (module docstring).