Skip to content

refactor(cosmo_val): tighten the mixin modules (behavior-preserving cleanup)#208

Merged
cailmdaley merged 1 commit into
refactor/cosmo-val-packagefrom
refactor/cosmo-val-cleanup
Jun 20, 2026
Merged

refactor(cosmo_val): tighten the mixin modules (behavior-preserving cleanup)#208
cailmdaley merged 1 commit into
refactor/cosmo-val-packagefrom
refactor/cosmo-val-cleanup

Conversation

@cailmdaley

Copy link
Copy Markdown
Collaborator

What

A cleanup pass over the freshly-split cosmo_val/ package — dead code, duplication, and verbose constructs tightened across all seven modules. −62 lines net, no functionality change. Each module's diff was checked by an independent reviewer that reverted anything not provably behavior-preserving, and the whole thing is gated on the value-drift suite staying green.

Representative changes:

  • Dead-variable removals (fig, _ = plt.subplots()plt.subplots() where the handle was unused).
  • .append() loops → list comprehensions; if/else assignment → ternary; yaml.load(f.read()) → stream.
  • A wrong assertion message corrected (noise_bias_method printed "analytical" while the check uses "analytic").
  • Import hoisting and local-name tidy.

What it deliberately did not touch

Public method names and signatures (every call site is unchanged), and the numerical internals of the diagnostics the value-drift suite does not pin (rho/tau, leakage, 2PCF, aperture-mass) — those got only unambiguously-safe edits.

Verification

ruff check src/sp_validation clean. The value-drift suite (test_cosmo_val.py, test_b_modes.py) stays green in the fresh sandbox — every scientific pin holds.

Stacked on #207. Draft for review.

— Claude on behalf of Cail

…eserving)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cailmdaley cailmdaley merged commit 969a4bc into refactor/cosmo-val-package Jun 20, 2026
3 checks passed
@cailmdaley cailmdaley deleted the refactor/cosmo-val-cleanup branch June 20, 2026 23:00
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