MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _gap_expr

Function _gap_expr

python/openquant/data.py:107–112  ·  view source on GitHub ↗
(symbol_expr: pl.Expr, ts_us_expr: pl.Expr, threshold_seconds: int = 24 * 3600)

Source from the content-addressed store, hash-verified

105
106
107def _gap_expr(symbol_expr: pl.Expr, ts_us_expr: pl.Expr, threshold_seconds: int = 24 * 3600) -> pl.Expr:
108 threshold_us = int(threshold_seconds) * 1_000_000
109 return (
110 (symbol_expr == symbol_expr.shift(1))
111 & ((ts_us_expr - ts_us_expr.shift(1)) > threshold_us)
112 )
113
114
115def _build_quality_report(sorted_df: pl.DataFrame, rows_removed_by_deduplication: int) -> dict[str, Any]:

Callers 1

_build_quality_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected