Skip to content

Enforce reproducibility & dashboard load in CI, add Python matrix and docs polish - #2

Merged
ethanbuckley merged 4 commits into
mainfrom
ci-hardening
Jul 10, 2026
Merged

Enforce reproducibility & dashboard load in CI, add Python matrix and docs polish#2
ethanbuckley merged 4 commits into
mainfrom
ci-hardening

Conversation

@ethanbuckley

Copy link
Copy Markdown
Owner

Note

Drafted by an LLM-based AI tool (Claude Code/Fable 5).

What & why

Two verification steps that were previously only run by hand are now enforced in CI, plus a Python-version matrix and a small docs/typing polish. No change to model behaviour: data/results.json is byte-for-byte unchanged and seiqr.py is untouched.

Changes

  • Reproducibility regression test (tests/test_reproducibility.py) — regenerates the results dict from the committed fixed seeds via run_experiments.run_all() and asserts it matches data/results.json. The stochastic CA curves are compared bit-for-bit (every transition is a PCG64 draw against a constant probability plus an exact integer infected-neighbour test, so they reproduce exactly across platforms and numpy versions); the solve_ivp-derived ode_validation block is compared to a 1e-6 relative tolerance; the non-deterministic speedup timings and generated_at timestamp are excluded.
  • Dashboard smoke test (tests/test_app.py) — a headless streamlit.testing.v1.AppTest runs app.py end-to-end (loading the results, rendering all three tabs, executing one live simulation) and asserts it finishes without an uncaught exception. This catches the class of breakage the use_container_width deprecation caused previously.
  • CI Python matrix — CI now runs on 3.10 / 3.11 / 3.12 (was 3.12 only), matching the declared target-version = "py310".
  • Docs & types — a dedicated ## Installation section in the README (de-duplicating the repeated pip install lines in "Running Locally"), a CITATION.cff so GitHub shows a "Cite this repository" button, and the two missing type hints flagged in ode_reference.py (foi, _interior_counts).

Verification

  • ruff check . clean; pytest -q43 passed locally (Python 3.13, numpy 2.4.6, scipy 1.17.1, streamlit 1.58.0).
  • Confirmed the reproducibility test is not vacuous: a one-cell perturbation fails the strict check and a 1% perturbation fails the tolerance check, while identical data passes.
  • Confirmed data/results.json is unmodified after running the suite.

🤖 Generated with Claude Code

ethanbuckley and others added 4 commits July 11, 2026 00:37
Regenerate the results dict from the committed fixed seeds and assert it matches data/results.json: the stochastic CA curves bit-for-bit, the solve_ivp-derived ode_validation block to a 1e-6 tolerance, excluding the non-deterministic speedup timings and generated_at. Add a headless streamlit AppTest that runs app.py end-to-end and asserts it loads without an uncaught exception (the class of breakage the use_container_width deprecation caused).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI ran only 3.12 though pyproject declares target-version py310; test the full supported range.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Factor the repeated pip install lines out of Running Locally into a single Installation section, and add a CITATION.cff so GitHub shows a Cite this repository button.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ethanbuckley
ethanbuckley merged commit bce91bf into main Jul 10, 2026
3 checks passed
@ethanbuckley
ethanbuckley deleted the ci-hardening branch July 11, 2026 00:16
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