Skip to content

chore: post-merge hardening, coverage, and 2.1.0#22

Merged
dsfulf merged 1 commit into
mainfrom
chore/post-merge-hardening
Jul 9, 2026
Merged

chore: post-merge hardening, coverage, and 2.1.0#22
dsfulf merged 1 commit into
mainfrom
chore/post-merge-hardening

Conversation

@dsfulf

@dsfulf dsfulf commented Jul 9, 2026

Copy link
Copy Markdown
Member

Follow-up to #20 (SE gamma fix) and #21 (n_grid), landing changes that weren't part of either contributor PR.

Hardening

  • n_grid guard_integrate_with now raises ValueError for n_grid < 2 (a degenerate grid), validated before the empty-t early return.
  • Docstringsn_grid is documented on the public cum() and the sibling volume methods (interval_vol, monthly_vol, monthly_vol_equiv), which previously claimed kwargs were "currently unused, reserved for future use." monthly_vol_equiv now threads **kwargs through its prepend call, matching interval_vol.

Tests

  • Cover the n_grid < 2 guard and the SE small-n gamma-overflow fallback path (the parametrized SE regression only exercised n ∈ [0.3, 0.8], i.e. the closed-form branch).

Error analysis

  • docs/numerical_integration.rst + integration_validation.py gain an n_grid convergence characterization (second-order; 10,000 → ~2e-6, 2,000 → ~5e-5 worst-case relative error), a note on the SE small-n fallback, and a print_ngrid_convergence() helper so the table is reproducible. Accuracy is governed by n_grid, not the density of the requested t array.

Coverage

  • Upload coverage to Coveralls via coverallsapp/github-action@v2 (ubuntu/3.12 cell). pytest now writes coverage.lcov. The upload step is continue-on-error because the test matrix is a required check on main — a Coveralls outage must not block merges. coverage/coveralls can be re-added as a required check once it reports.

Version

  • Bump 2.0.02.1.0. The SE fix is flagged in the version history as a breaking numerical change (EUR/cum for any SE fit with n ≠ 0.5 now differ — understated up to ~64% at n=0.3, overstated ~10% for n > 0.5).

Verified locally: ruff clean, mypy clean, 39 tests pass.

Follow-up to #20 (SE gamma fix) and #21 (n_grid), landing changes that
weren't part of either contributor PR:

- base.py: n_grid < 2 now raises ValueError (was a degenerate grid);
  validated before the empty-t early return. Document n_grid on cum()
  and the sibling volume methods (were stale "currently unused"); pass
  **kwargs through monthly_vol_equiv's prepend for consistency.
- test/test_perf.py: add coverage for the n_grid guard and the SE
  small-n gamma-overflow fallback path.
- docs/versions.rst: 2.1.0 entry (SE fix flagged as a breaking numerical
  change; n_grid; THM cleanup).
- docs/numerical_integration.rst + integration_validation.py: n_grid
  convergence analysis (second-order; 10k -> ~2e-6, 2000 -> ~5e-5),
  SE small-n fallback note, print_ngrid_convergence().
- ci.yml + pyproject.toml + .gitignore: upload coverage to Coveralls via
  coverallsapp/github-action (ubuntu/3.12 cell, continue-on-error).
- Bump version 2.0.0 -> 2.1.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dsfulf dsfulf merged commit 3c08e09 into main Jul 9, 2026
14 checks passed
@dsfulf dsfulf deleted the chore/post-merge-hardening branch July 9, 2026 19:55
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