Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d31a6f6
deps: py3.12 floor + SACC/blinding stack (sacc, firecrown, smokescreen)
cailmdaley Jul 9, 2026
1d4826c
deps: firecrown pip-import fixes (numpy<2.5 cap, NumCosmo patch script)
cailmdaley Jul 10, 2026
6050be0
feat(sacc_io): SACC read/write for the standard data-product layout
cailmdaley Jul 10, 2026
66bbbc0
fix(sacc_io): enforce ascending grids; readers in insertion order
cailmdaley Jul 10, 2026
2f4a8a8
feat(cosmo_val): SACC writers for the born-as-SACC data products
cailmdaley Jul 10, 2026
18ec7ff
feat(twopoint): SACC → 2pt-FITS converter, byte-compatible with cosmo…
cailmdaley Jul 10, 2026
f9b1d12
feat(one_covariance): SACC <-> OneCovariance file-format glue
cailmdaley Jul 10, 2026
c631418
fix(cosmo_val): tau covariance block derived from CovTauTh write-side
cailmdaley Jul 10, 2026
483961f
feat(cosmo_val): define pseudo_cl_to_sacc_part, complete pseudo-Cl SA…
cailmdaley Jul 10, 2026
95e150f
feat(cosmo_val): SACC part writers on cosebis / pure_eb / psf_systema…
cailmdaley Jul 10, 2026
ae03ea6
feat(workflow): born-as-SACC scripts (coarse/fine xi, pseudo-Cl, asse…
cailmdaley Jul 10, 2026
700a885
fix(twopoint): fail fast on tomographic/ξ-less SACC; pin covariance g…
cailmdaley Jul 10, 2026
91f5d43
test(pseudo_cl): fixture carries shear.redshift_path like the real ca…
cailmdaley Jul 10, 2026
dd474b3
WIP(workflow): born-as-SACC rule wiring - UNVERIFIED, interrupted mid…
cailmdaley Jul 10, 2026
02d9cf3
test(pseudo_cl): read the born-as-SACC part in the end-to-end catalog…
cailmdaley Jul 10, 2026
0f4a6f2
fix(workflow): wire the assemble_sacc rule and the per-statistic SACC…
cailmdaley Jul 10, 2026
99db96e
test(assemble_sacc): integration test for the assemble_sacc.py script…
cailmdaley Jul 10, 2026
9afaeaa
fix(workflow): resolve xi_highres script path from the running checkout
cailmdaley Jul 10, 2026
00460d8
fix(workflow): assemble the analysis file from the tagged pseudo-Cl +…
cailmdaley Jul 10, 2026
2d1747b
test(workflow): dry-run guard uses sys.executable, drops SNAKEMAKE_PR…
cailmdaley Jul 10, 2026
a592bb8
docs(inference): mark inference_prep inputs pre-SACC, migration defer…
cailmdaley Jul 10, 2026
60b74c6
fix(pseudo_cl): born-at-declared-name kills the cross-rule pseudo-Cl …
cailmdaley Jul 10, 2026
e0519c8
fix(workflow): assemble fails loudly by default on the placeholder ξ …
cailmdaley Jul 10, 2026
6a5df5b
test(workflow): dry-run guard covers the cosmo_val assemble DAG
cailmdaley Jul 10, 2026
3561b36
fix(bmodes): drop removed save_fits kwarg from run_xi_sweep's run_2pc…
cailmdaley Jul 10, 2026
149a50c
fix(assemble_sacc): validate expected parts, no silent statistic drop
cailmdaley Jul 10, 2026
c37bdcb
Merge branch 'feat/sacc-3-2pt-converter' into feat/sacc-7-sacc-like
cailmdaley Jul 10, 2026
df87be6
feat(sacc_like): sp_validation shim over CosmoSIS SaccClLikelihood
cailmdaley Jul 10, 2026
1b05bf7
feat(inference): sacc_like ini template + config generator
cailmdaley Jul 10, 2026
5d12350
feat(inference): rewire inference_prep to consume the assembled SACC
cailmdaley Jul 10, 2026
db28602
fix(sacc_like): keep self.sacc_data in arcmin so save_theory writes a…
cailmdaley Jul 10, 2026
becfeb2
fix(inference): bind ini templates as inference_prep inputs, not params
cailmdaley Jul 10, 2026
151d997
fix(sacc_like): defer cosmosis import so bare module import needs no …
cailmdaley Jul 10, 2026
64b2b5f
feat: SACC → 2pt-FITS converter + OneCovariance file-format glue
cailmdaley Jul 16, 2026
1ccd04f
Merge remote-tracking branch 'origin/feat/sacc-2-sacc-io' into feat/s…
cailmdaley Jul 18, 2026
b007ed1
twopoint_convert: filter covariance selections by grid tag; guard emp…
cailmdaley Jul 18, 2026
3e4fd7d
refactor: merge twopoint_convert + one_covariance_io into sacc_interop
cailmdaley Jul 19, 2026
33f0321
refactor: fold sacc_interop into sacc_io — one SACC module
cailmdaley Jul 20, 2026
df6a590
Merge remote-tracking branch 'origin/feat/sacc-3-2pt-converter' into …
cailmdaley Jul 20, 2026
06b24c6
fix(Dockerfile): copy source before the blinding-extra editable install
cailmdaley Jul 20, 2026
67db676
fix: reconcile pr7-lineage SACC callers with guarded sacc_io API
cailmdaley Jul 20, 2026
0443bc7
Merge branch 'feat/sacc-4-cosmo-val-sacc' into feat/sacc-7-sacc-like
cailmdaley Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
- name: Import smoke test
run: docker run --rm ${{ steps.meta.outputs.tags }} python -c "import sp_validation"

# The fast suite doesn't import the blinding stack, so a broken
# firecrown/smokescreen install would otherwise ship green. Prove the
# image can actually load it (sacc + patched firecrown + smokescreen).
- name: Blinding-stack import smoke test
run: docker run --rm ${{ steps.meta.outputs.tags }} python -c "import sacc; import firecrown.likelihood; import smokescreen"

# Run the fast test suite against the freshly-built image *before*
# pushing, so a failing suite blocks publication. The image carries the
# full stack and the test files (COPY . + editable install), so this
Expand Down
27 changes: 24 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,28 @@ COPY pyproject.toml uv.lock /sp_validation/
RUN uv sync --frozen --inexact --no-install-project \
--extra test --extra glass --extra workflow

# Install sp_validation itself (editable) into the same venv; deps are already
# satisfied by the sync above.
# Full source in place before the blinding-extra install below: it is an
# editable install of the project itself and needs uv-overrides.txt and
# scripts/patch_firecrown.py from the tree.
COPY . /sp_validation
RUN uv pip install --no-deps -e .

# The [blinding] extra (SACC/Smokescreen blinding stack: firecrown + smokescreen)
# is not in uv.lock — firecrown is not on PyPI and declares conda-forge-only /
# unused sampler connectors as hard deps, so it needs the override file (see
# uv-overrides.txt for the full story). Installed as a separate pass on top of
# the locked sync.
RUN uv pip install --no-cache-dir --overrides uv-overrides.txt -e '.[blinding]'

# Same uv gotcha as the cs_util upgrade above (astral-sh/uv #8410): if the base
# image / locked sync already carries a numpy that violates the [blinding]
# extra's `numpy<2.5` cap (firecrown 1.15.1 breaks on numpy 2.5 at import), the
# editable install won't move it. Request the bound explicitly so the image is
# deterministic either way; numpy 2.4.x is ABI-compatible with the compiled
# stack (verified: pyccl/camb/treecorr/healpy/pymaster + fast suite).
RUN uv pip install --no-cache-dir 'numpy>=2.2,<2.5'

# firecrown is distributed for conda-forge (where NumCosmo always exists) and
# hits NumCosmo at import time in a pip env, on paths unrelated to our use.
# This patches the installed tree (surgical, pinned-version-checked, loud on
# mismatch) and verifies `import firecrown.likelihood; import smokescreen`.
RUN python scripts/patch_firecrown.py
108 changes: 108 additions & 0 deletions cosmo_inference/cosmosis_config/cosmosis_pipeline_A_ia.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#parameters used elsewhere in this file
[DEFAULT]
COSMOSIS_DIR = /n23data1/n06data/lgoh/scratch/cosmosis-standard-library_lisa


[pipeline]
modules = consistency sample_S8 camb load_nz_fits photoz_bias linear_alignment projection add_intrinsic 2pt_shear shear_m_bias 2pt_like
likelihoods = 2pt_like
extra_output = cosmological_parameters/omega_lambda cosmological_parameters/S_8 cosmological_parameters/sigma_8 cosmological_parameters/omega_m
timing = T
debug = T

[runtime]
sampler = polychord
verbosity = debug

[polychord]
live_points = 192
feedback = 3
resume = T
base_dir = %(SCRATCH)s/polychord

[test]

[output]
format = text
lock = F

[consistency]
file = %(COSMOSIS_DIR)s/utility/consistency/consistency_interface.py
verbose = F

[sample_S8]
file = %(COSMOSIS_DIR)s/utility/sample_sigma8/sample_S8.py

[camb]
file = %(COSMOSIS_DIR)s/boltzmann/camb/camb_interface.py
mode=power
lmax=2508
feedback=0
do_reionization=F
kmin=1e-5
kmax=20.0
nk=200
zmax=5.0
zmax_background=5.0
nz_background=500
halofit_version=mead2020_feedback
nonlinear=pk
neutrino_hierarchy=normal
kmax_extrapolate = 500.0

[load_nz_fits]
file = %(COSMOSIS_DIR)s/number_density/load_nz_fits/load_nz_fits.py
nz_file =%(FITS_FILE)s
data_sets = SOURCE

[photoz_bias]
file = %(COSMOSIS_DIR)s/number_density/photoz_bias/photoz_bias.py
mode = additive
sample = nz_source
bias_section = nofz_shifts
interpolation = cubic
output_deltaz_section_name = delta_z_out

[linear_alignment]
file = %(COSMOSIS_DIR)s/intrinsic_alignments/la_model/linear_alignments_interface_znla.py
method = bk_corrected

[projection]
file = %(COSMOSIS_DIR)s/structure/projection/project_2d.py
ell_min_logspaced = 1.0
ell_max_logspaced = 25000.0
n_ell_logspaced = 400
shear-shear = source-source
shear-intrinsic = source-source
intrinsic-intrinsic = source-source
get_kernel_peaks = F
verbose = F

[add_intrinsic]
file = %(COSMOSIS_DIR)s/shear/add_intrinsic/add_intrinsic.py
shear-shear=T
position-shear=F
perbin=F

[2pt_shear]
file = %(COSMOSIS_DIR)s/shear/cl_to_xi_nicaea/nicaea_interface.so
corr_type = 0 ; shear_cl -> shear_xi

[shear_m_bias]
file = %(COSMOSIS_DIR)s/shear/shear_bias/shear_m_bias.py
m_per_bin = True
; Despite the parameter name, this can operate on xi as well as C_ell.
cl_section = shear_xi_plus shear_xi_minus
verbose = F

[2pt_like]
file = %(COSMOSIS_DIR)s/likelihood/2pt/2pt_like.py
data_file=%(FITS_FILE)s
gaussian_covariance=F
covmat_name=COVMAT
cut_zeros=F
data_sets=XI_PLUS XI_MINUS
like_name=2pt_like

angle_range_XI_PLUS_1_1= 10.0 200.0
angle_range_XI_MINUS_1_1= 20.0 200.0
110 changes: 110 additions & 0 deletions cosmo_inference/cosmosis_config/cosmosis_pipeline_A_ia_sacc.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#parameters used elsewhere in this file
[DEFAULT]
COSMOSIS_DIR = /n23data1/n06data/lgoh/scratch/cosmosis-standard-library_lisa


[pipeline]
modules = consistency sample_S8 camb load_nz_sacc photoz_bias linear_alignment projection add_intrinsic 2pt_shear shear_m_bias sacc_like
likelihoods = 2pt_like
extra_output = cosmological_parameters/omega_lambda cosmological_parameters/S_8 cosmological_parameters/sigma_8 cosmological_parameters/omega_m
timing = T
debug = T

[runtime]
sampler = polychord
verbosity = debug

[polychord]
live_points = 192
feedback = 3
resume = T
base_dir = %(SCRATCH)s/polychord

[test]

[output]
format = text
lock = F

[consistency]
file = %(COSMOSIS_DIR)s/utility/consistency/consistency_interface.py
verbose = F

[sample_S8]
file = %(COSMOSIS_DIR)s/utility/sample_sigma8/sample_S8.py

[camb]
file = %(COSMOSIS_DIR)s/boltzmann/camb/camb_interface.py
mode=power
lmax=2508
feedback=0
do_reionization=F
kmin=1e-5
kmax=20.0
nk=200
zmax=5.0
zmax_background=5.0
nz_background=500
halofit_version=mead2020_feedback
nonlinear=pk
neutrino_hierarchy=normal
kmax_extrapolate = 500.0

[load_nz_sacc]
file = %(COSMOSIS_DIR)s/number_density/load_nz_sacc/load_nz_sacc.py
nz_file = %(SACC_FILE)s
data_sets = source

[photoz_bias]
file = %(COSMOSIS_DIR)s/number_density/photoz_bias/photoz_bias.py
mode = additive
sample = nz_source
bias_section = nofz_shifts
interpolation = cubic
output_deltaz_section_name = delta_z_out

[linear_alignment]
file = %(COSMOSIS_DIR)s/intrinsic_alignments/la_model/linear_alignments_interface_znla.py
method = bk_corrected

[projection]
file = %(COSMOSIS_DIR)s/structure/projection/project_2d.py
ell_min_logspaced = 1.0
ell_max_logspaced = 25000.0
n_ell_logspaced = 400
shear-shear = source-source
shear-intrinsic = source-source
intrinsic-intrinsic = source-source
get_kernel_peaks = F
verbose = F

[add_intrinsic]
file = %(COSMOSIS_DIR)s/shear/add_intrinsic/add_intrinsic.py
shear-shear=T
position-shear=F
perbin=F

[2pt_shear]
file = %(COSMOSIS_DIR)s/shear/cl_to_xi_nicaea/nicaea_interface.so
corr_type = 0 ; shear_cl -> shear_xi

[shear_m_bias]
file = %(COSMOSIS_DIR)s/shear/shear_bias/shear_m_bias.py
m_per_bin = True
; Despite the parameter name, this can operate on xi as well as C_ell.
cl_section = shear_xi_plus shear_xi_minus
verbose = F

; Native SACC likelihood via the sp_validation shim (arcmin->rad + ordering
; guard over CosmoSIS's SaccClLikelihood). data_sets/angle ranges use the SACC
; grammar (full data-type names + tracer pairs). like_name=2pt_like keeps the
; block keys identical to the 2pt_like path so chain post-processing is unchanged.
[sacc_like]
file = %(SP_VALIDATION_MODULES)s/sacc_like_unions.py
csl_dir = %(COSMOSIS_DIR)s
data_file = %(SACC_FILE)s
data_sets = galaxy_shear_xi_plus galaxy_shear_xi_minus
like_name = 2pt_like

angle_range_galaxy_shear_xi_plus_source_0_source_0 = 10.0 200.0
angle_range_galaxy_shear_xi_minus_source_0_source_0 = 20.0 200.0
5 changes: 4 additions & 1 deletion papers/cosmo_val/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,14 @@ harmonic:
binning: powspace
nbins: 32

# Cosmological inference data-product locations (dormant subsystem).
# Cosmological inference data-product locations + tooling.
inference:
chains_dir: "/n09data/guerrini/output_chains"
glass_mock_data_dir: "/n09data/guerrini/glass_mock_v1.4.6/results"
glass_mock_chains_dir: "/n09data/guerrini/glass_mock_chains"
# CosmoSIS Standard Library checkout — fills COSMOSIS_DIR in the generated
# pipeline inis (the module `file =` paths and the sacc_like shim's csl_dir).
csl_dir: "/n23data1/n06data/lgoh/scratch/cosmosis-standard-library_lisa"

cosebis:
theta_min: 1.0
Expand Down
41 changes: 38 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ authors = [
]
license = {text = "MIT"}
readme = "README.md"
# 3.12 floor: cosmo-numba (a hard dependency below) requires >=3.12, and the
# production container is Python 3.12 (shapepipe base image). Keeping the floor
# in sync with the container is what makes `uv lock` resolvable.
# 3.12 floor: Smokescreen 1.5.6 (and firecrown v1.15) require it, as does
# cosmo-numba (a hard dependency below); the container base (shapepipe:develop)
# is already python:3.12-slim-bookworm, so this aligns pyproject with the
# actual runtime and keeps `uv lock` resolvable.
requires-python = ">=3.12"
classifiers = [
"License :: OSI Approved :: MIT License",
Expand Down Expand Up @@ -164,6 +165,40 @@ workflow = [
# published or resolvable (no public repo found) — left undeclared pending
# its source. Same for `unions_wl` (scripts/check_footprint.py).
]
# Data-vector blinding (PRD #241 §3-§5): Smokescreen applies the Muir et al.
# shift d → d + t(hidden) − t(fid), with firecrown + CCL as the theory engine
# (only compute_theory_vector is used; sampling stays with CosmoSIS). The blind
# must be exactly recomputable from the seed at unblinding time, so the whole
# theory stack is pinned exactly, as a set. Smokescreen 1.5.6 + firecrown v1.15
# both set the python floor (>=3.12).
#
# firecrown is not on PyPI and declares conda-forge-only / unused sampler
# connectors as hard deps, so installing this extra requires the dependency
# override file: `uv pip install --overrides uv-overrides.txt -e '.[blinding]'`
# (see uv-overrides.txt; the Dockerfile does this for the container).
# After installing this extra, run `python scripts/patch_firecrown.py` — it
# makes pip-installed firecrown importable without NumCosmo (conda-forge-only);
# see that script's docstring for the full story.
blinding = [
"firecrown @ git+https://github.com/LSSTDESC/firecrown.git@v1.15.1",
"smokescreen==1.5.6",
"pyccl==3.3.4",
# firecrown 1.15.1 subclasses npt.NDArray (DataVector); numpy 2.5 turned
# npt.NDArray into a non-subclassable typing alias, breaking firecrown at
# import. firecrown's own env caps numpy<2.4; 2.4.3 is verified against
# the full compiled stack (pyccl/camb/treecorr/healpy/pymaster) + the
# sp_validation fast suite.
"numpy>=2.2,<2.5",
]
# Native SACC inference likelihood (PR 7, sp_validation.sacc_like_unions). The
# shim subclasses CosmoSIS's SaccClLikelihood; this pins the engine. Both engine
# module files are pure-python (no CAMB / compiled CSL), so the equality tests
# (tests/test_sacc_like.py) run with just this extra + a CosmoSIS Standard
# Library checkout, located via the CSL_DIR env var:
# git clone --depth 1 https://github.com/joezuntz/cosmosis-standard-library CSL
# CSL_DIR=/path/to/CSL pytest ... test_sacc_like.py
# Inert in CI (its Dockerfile installs only [test,glass,blinding]).
cosmosis = ["cosmosis>=3.25"]
develop = ["sp_validation[test,docs]"]

[tool.pytest.ini_options]
Expand Down
Loading
Loading