Why
The UNIONS weak-lensing code re-implements cosmology in more than one place. cs_util.cosmo already holds the tested primitives (get_cosmo_default, sigma_crit*, xipm_theo) and is imported by shear_psf_leakage, while sp_validation's src/sp_validation/cosmology.py carries a richer, better-documented superset — a flexible Planck18-default get_cosmo, the get_theo_c_ell / c_ell_to_xi / get_theo_xi theory-curve chain, and CCL↔CAMB↔CosmoCov converters.
Per a conversation with Martin, the fix is to make cs_util the single home for these primitives: the library defines the cosmology, the analysis repos use it, and dependency arrows point analysis → library (never the reverse). This is the less-breaking direction, since cs_util.cosmo already exists and is imported downstream.
Plan — two development PRs
- cs_util — merge
sp_validation.cosmology into cs_util.cosmo, additive (no existing symbol changes, so shear_psf_leakage is unaffected), plus the ported tests; version bump 0.2.1 → 0.2.2.
- sp_validation — delete
cosmology.py, repoint its importers to cs_util.cosmo, bump the cs_util pin to >=0.2.2. Sequencing: this one can only go green once cs_util 0.2.2 is released (sp_validation installs cs_util from PyPI), so: merge PR 1 → cut 0.2.2 → PR 2.
Deferred cleanup (tracked in the sub-issue)
Unify the two theory-ξ± APIs (xipm_theo → get_theo_xi); retire the outdated get_cosmo_default toward Planck18; fix shear_psf_leakage's theory overplot, which today uses the old WMAP-ish default rather than Planck18; and decide whether sp_validation/cosmo_inference/'s inline CCL recipe should point at the one cs_util home.
— Claude on behalf of Cail
Why
The UNIONS weak-lensing code re-implements cosmology in more than one place.
cs_util.cosmoalready holds the tested primitives (get_cosmo_default,sigma_crit*,xipm_theo) and is imported byshear_psf_leakage, whilesp_validation'ssrc/sp_validation/cosmology.pycarries a richer, better-documented superset — a flexible Planck18-defaultget_cosmo, theget_theo_c_ell/c_ell_to_xi/get_theo_xitheory-curve chain, and CCL↔CAMB↔CosmoCov converters.Per a conversation with Martin, the fix is to make
cs_utilthe single home for these primitives: the library defines the cosmology, the analysis repos use it, and dependency arrows point analysis → library (never the reverse). This is the less-breaking direction, sincecs_util.cosmoalready exists and is imported downstream.Plan — two development PRs
sp_validation.cosmologyintocs_util.cosmo, additive (no existing symbol changes, soshear_psf_leakageis unaffected), plus the ported tests; version bump0.2.1 → 0.2.2.cosmology.py, repoint its importers tocs_util.cosmo, bump thecs_utilpin to>=0.2.2. Sequencing: this one can only go green once cs_util0.2.2is released (sp_validation installs cs_util from PyPI), so: merge PR 1 → cut 0.2.2 → PR 2.Deferred cleanup (tracked in the sub-issue)
Unify the two theory-ξ± APIs (
xipm_theo→get_theo_xi); retire the outdatedget_cosmo_defaulttoward Planck18; fixshear_psf_leakage's theory overplot, which today uses the old WMAP-ish default rather than Planck18; and decide whethersp_validation/cosmo_inference/'s inline CCL recipe should point at the one cs_util home.— Claude on behalf of Cail