Skip to content

Migrate CCM SPIs to pyEDM 2.x; drop setuptools<81 pin; require Python>=3.10 - #102

Open
benfulcher wants to merge 2 commits into
fix-cifrom
edm2-migration
Open

benfulcher wants to merge 2 commits into
fix-cifrom
edm2-migration

Conversation

@benfulcher

Copy link
Copy Markdown
Collaborator

Closes #100. Stacked on #99. The base is fix-ci; retarget it to main once #99 is merged.

Changes

  • pyspi/statistics/causal.py: the CCM SPIs are ported to the pyEDM 2.x API.
    • EmbedDimension is replaced by a small _embed_dimension helper that loops pyEDM.Simplex over E=1..10. pyEDM 2.x's EmbedDimension always starts a multiprocessing Pool, which crashes under the spawn start method (macOS, Windows, and Python ≥3.14 on Linux) in scripts without a __main__ guard. It also now requires target and defaults to showPlot=True.
    • CCM is called with an explicit list of library sizes. 2.x parses a 3-element spec ambiguously.
    • CCM runs with parallel=False.
    • The output columns are selected by name (src:targ/targ:src) instead of by position.
    • The existing E=None behaviour (CCM with E=None always uses E=10 (max of E column, not argmax of rho) #101) is kept as it is, so this PR stays numerically neutral apart from sampling noise.
  • setup.py/requirements.txt: pyEDM==1.15.2.0 + setuptools<81 becomes pyEDM>=2.5.7,<3. pyEDM 2.x no longer imports pkg_resources, so the setuptools pin from Fix failing CI: pkg_resources (pyEDM) and pandas 3 CalculatorFrame columns #99 goes.
  • Python ≥3.10: this is pyEDM 2.x's minimum. The requires-python, the CI matrix (3.10–3.12), the README badge and the conda example are updated. 3.8 and 3.9 are past end of life.

Numerical impact

pyEDM 2.x rewrote the library subsampling and its RNG, so seed=42 no longer reproduces 1.x values bit-for-bit.

  • Test scope: all 9 CCM SPIs, comparing 1.15.2.0 with 2.5.7, on cml7, coupled logistic maps (N=300, 600) and seeded Gaussian noise.
  • Size of the differences: the typical max |Δ| per SPI is ~0.003, and the largest single value is 0.025 (cml7, E=1, max).
  • Why this is sampling noise: it is the same size as changing the seed within 1.x (~0.028). With 3000 samples the two versions agree to ~0.002.
  • Tests: the benchmark tests pass unchanged. 293 tests passed locally on Python 3.11 with pyEDM 2.5.7, both on numpy 1.26 and on numpy 2.4.
  • Release note: CCM values change slightly; there is no change in expectation.

Follow-ups (not in this PR)

🤖 Generated with Claude Code

benfulcher and others added 2 commits September 30, 2026 22:58
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant