Skip to content

Consolidate cosmology into cs_util (single home for the collaboration's cosmology primitives) #75

Description

@cailmdaley

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

  1. 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.
  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_theoget_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions