Repository navigation
TRACES v2.0.0: traces_ts package, v1 bug fixes, autocorrelation-aware statistics, uv/CI - #1
Merged
Merged
Conversation
…ironment - PEP 621 metadata (distribution traces-ts, import traces_ts; 'traces' is taken on PyPI) - Works with uv sync or pip install -e . in any venv; environment.yml now just installs the package - Drop the Anaconda 'defaults' channel, add ruff/pytest/nbmake dev group Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes v1 defects: - CCF optimal lag is now restricted to +/-max_lag (v1 reported lags of 11-12 with max_lag=10) - One lag sign convention everywhere: positive lag means series_1 leads series_2 - CCF is normalized so CCF(0) equals Pearson r (v1 values were r * (n-1)) - Time column defaults to the first column instead of a hard-coded 'Time' - Explicit missing-value policy (raise/drop/interpolate) instead of silent NaN results - Method-performance legend no longer shows '(count, method)' artifacts Statistical safeguards (on by default, AnalysisConfig.classic() turns them off): - Autocorrelation-adjusted p-values via effective sample size (Pyper & Peterman 1998) - Benjamini-Hochberg FDR correction across pairs - AR pre-whitening before lag detection, Bonferroni band across searched lags - 'none' relationship type and min_correlation gate; evidence score documented Adds CSV input, detrending options, CSV/Excel/Markdown export, figure export and a 'traces analyze' command-line interface. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Single (Box-Jenkins) pre-whitening filtered both series with series_1's AR model, so detection depended on pair order and flagged spurious lags on the smooth sample data. Each series is now filtered with its own AR model and the CCF band uses the effective sample size of the residuals. Simulated false-positive rate: 0.5-7.6%, power for a true 3-step lead: 84-93%. Relationship matrix now shows 'none' pairs in grey, trims the empty row/column and labels lags relative to the row series. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…of traces_ts Configuration, loading, correlations, lead/lag, classification and export now call the package instead of redefining the pipeline in each cell. Adds a v1-style (classic) vs v2 comparison and removes the duplicated README/guide cells. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tests Python 3.11-3.14 on Linux plus Windows and macOS, and the lowest supported dependency versions (seaborn floor raised to 0.13.2 for pandas 2.2 compatibility). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ITATION.cff - Formulae now cover effective sample size, FDR, pre-whitening, bands, classification and evidence score, with references and limitations - Operational and Component Flexibility guides describe the notebook, CLI and Python API - Example outputs are regenerated from real runs by scripts/generate_examples.py, replacing hand-written step outputs that did not match the code Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two years after v1.0.0, a full modernization of TRACES ahead of a v2.0.0 release: the analysis moves from notebook cells into a tested
traces_tspackage, several v1 calculation bugs are fixed, and the default significance tests now account for autocorrelation. Results differ from v1;AnalysisConfig.classic()/traces analyze --classicgive v1-style statistics.What changed
Environment
pyproject.toml+uv.lock; works withuv syncorpip install -e .in any venv (verified by installing the built wheel in a plain pip venv)environment.ymlis conda-forge only and just installs the packagetraces-ts, importtraces_ts(tracesis already taken on PyPI)v1 bugs fixed
max_lag(v1 reported lags of 11-12 withmax_lag=10)series_1leadsr x (n-1), e.g. 50.9); CCF(0) now equals Pearson rTimecolumn; first column is now the time column as documentedraise/drop/interpolate(count, method)legend labels in the method-performance plotStatistics (on by default)
nonerelationship type; documentedevidence_scorereplaces the old confidence scoreFeatures
traces analyzeCLI: CSV, Excel (results/summary/config sheets), Markdown report, figuresnone/linear/difference)Quality
CITATION.cffscripts/generate_examples.py(the old hand-writtenstep*.txtoutputs did not match the code)Why the statistics changed
Simulated independent series, n = 52, alpha = 0.05 (1,000 pairs each):
A true 3-step lead is detected 84-93% of the time with the correct sign 98% of the time.
Sample dataset A1 (relationship-type counts):
Reviewer notes
series_1,relationship_type,evidence_score,ccf_peak_lag, ...); see the migration table inCHANGELOG.mddetrend="difference". Documented under Limitations indocs/Formulae.mdv2.0.0and publish a GitHub release from the CHANGELOGTest plan
uv run pytest(58 passed)uv run pytest --nbmake notebooksuv run ruff check .anduv run ruff format --check .uv build, wheel installed in a plain pip venv,traces analyzeon dataset B1🤖 Generated with Claude Code