Releases: imann128/tsauditor
Releases · imann128/tsauditor
Release list
v0.2.0: the data guard release
tsauditor 0.2.0 — the data guard release
A major, fully backward-compatible feature release. tsauditor moves from a leakage
detector toward a complete data guard: it now catches point-in-time and validity
flaws, repairs them on a copy, scores data health, exports formal reports, and hands
clean arrays straight to forecasting models.
Upgrade: pip install -U tsauditor
New checks
- As-of / point-in-time leakage (LEK004, CRITICAL).
scan(df, available_at=...)flags a feature used before it was actually published — the classic macro / sentiment / earnings trap. Opt-in: declare a per-row publishpd.Seriesor a fixedpd.Timedeltalag. - Domain-validity checks (VAL001 / VAL002).
scan(df, constraints=...)verifies rules you declare: per-columnbounds(a spread must be strictly positive, sentiment within [-1, 1]) and orderingrelationslike("bid", "ask")to catch a crossed book.
Repair and workflow
tsa.fix(df, ...): one-shot scan-and-repair returning(clean_df, report). The original is never touched, and the target label is never repaired.GuardReport.apply_fixes(...): report-driven repair on a copy (clip/NaN outliers and contextual spikes, impute missing clusters, opt-in leakage-column drop), with a full change log inreport.last_fixes.- Data Health Score —
report.health_score(df): percent of numeric cells not implicated by a quality issue. - Export —
report.to_pdf(...)(needs the[pdf]extra) andreport.to_json(...)with an optional before/after health delta.
Integrations and scale
- TimesFM adapter :
tsa.adapters.to_timesfm(df, target_col=...)audits, repairs, and returns a finitefloat32array for Google TimesFM. It adds notimesfmdependency and raises rather than emit a NaN. - polars input (
[polars]extra) and joblib / pickle support for parallel per-symbol universe audits. - Performance : LEK002 cross-correlation is ~12x faster on wide frames (rank-once), and
scan(run_stationarity=False)skips the ADF hot spot for a much faster sweep.
Fixes
scan()/fix()no longer crash on a constant numeric column. The ADF stationarity check now skips zero-variance columns instead of letting statsmodels raiseInvalid input, x is constant, and guards other numerical failures so one column can never abort the whole audit.- ANO003 contextual-spike self-masking fixed (rolling stats now exclude the current point), plus assorted robustness fixes.
Examples and docs
- New runnable notebooks: the OGDC leakage case, "beyond price and direction" (validity on real volume / RSI / OHLC), the TimesFM adapter, and a dependency-free "validation vs general profiling" comparison. Install everything to run them with
pip install -e ".[dev,examples]". - Refreshed README (now with a "not just price and direction" section), wiki pages, and CHANGELOG.
Tested: 164 tests passing, CI across Python 3.9–3.14 on Linux, Windows, and macOS.
0.1.2
Profiler, anomaly, and leakage modules are implemented and tested (93 tests passing, CI across Python 3.9–3.14 on Linux, Windows, macOS).