Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 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
3abb566
sacc_io: guard merge() against inconsistent theta grids
cailmdaley Jul 18, 2026
2da8c10
sacc_io: extend merge guard to ell grids and bandpower windows; tag p…
cailmdaley Jul 18, 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
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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@ docker run --rm -it ghcr.io/cosmostat/sp_validation:develop python -c "import sp

We do not currently build images for Apple Silicon/arm64; however the amd64 images should work on these systems, albeit with reduced performance.

## Local Installation

Requires Python ≥ 3.12 (the floor is set by the blinding stack; the container
already runs 3.12). With [uv](https://docs.astral.sh/uv/):

```bash
uv venv --python 3.12
uv pip install -e '.[test]'
```

To also install the data-vector blinding stack (Smokescreen + firecrown, PRD
[#241](https://github.com/CosmoStat/sp_validation/issues/241)), pass the
dependency-override file — firecrown is not pip-resolvable without it (see
`uv-overrides.txt` for why):

```bash
uv pip install --overrides uv-overrides.txt -e '.[test,blinding]'
python scripts/patch_firecrown.py # make pip-installed firecrown importable without NumCosmo
```



## Flow chart
Expand Down
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
10 changes: 7 additions & 3 deletions papers/bmodes/scripts/run_xi_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Loops the [non-fiducial version list](sweep_versions.nonfiducial_versions) and
runs the same ``run_2pcf.run_2pcf`` compute the fiducial two_point recipes call,
once per version, writing every version's ξ± text dump (+ ξ+/ξ- FITS) into one
lc ``{output}`` dir under run_2pcf's native, already-canonical name
once per version, writing every version's ξ± text dump into one lc ``{output}``
dir under run_2pcf's native, already-canonical name
``{ver}_xi_minsep={min}_maxsep={max}_nbins={nbins}_npatch={npatch}.txt`` — the
exact pattern ``cosebis_version_comparison._xi_integration`` reconstructs.

Expand Down Expand Up @@ -72,11 +72,15 @@ def _from_cli(argv=None):
versions = a.versions or nonfiducial_versions(config)
for ver in versions:
for grid in a.grids:
# The sweep consumes only the .txt dump (cosebis_version_comparison
# reconstructs it by binning). run_2pcf is born-as-SACC, so give its
# coarse part a grid-qualified name — the default {ver}_xi_coarse.sacc
# carries no binning, so the two grids per version would collide.
run_2pcf(
ver=ver,
cat_config=a.cat_config,
output_dir=a.out,
save_fits=True,
sacc_out=os.path.join(a.out, f"{ver}_xi_coarse_{grid}.sacc"),
**GRIDS[grid],
)

Expand Down
5 changes: 4 additions & 1 deletion papers/cosmo_val/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,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
Loading
Loading