Skip to content

Releases: imann128/tsauditor

v0.2.0: the data guard release

Choose a tag to compare

@imann128 imann128 released this 05 Jul 12:46

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 publish pd.Series or a fixed pd.Timedelta lag.
  • Domain-validity checks (VAL001 / VAL002). scan(df, constraints=...) verifies rules you declare: per-column bounds (a spread must be strictly positive, sentiment within [-1, 1]) and ordering relations like ("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 in report.last_fixes.
  • Data Health Scorereport.health_score(df): percent of numeric cells not implicated by a quality issue.
  • Exportreport.to_pdf(...) (needs the [pdf] extra) and report.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 finite float32 array for Google TimesFM. It adds no timesfm dependency 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 raise Invalid 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

Choose a tag to compare

@imann128 imann128 released this 17 Jun 09:58
2d5b80b

Profiler, anomaly, and leakage modules are implemented and tested (93 tests passing, CI across Python 3.9–3.14 on Linux, Windows, macOS).