Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Tests live in `src/sp_validation/tests/` and import the full scientific stack,
so run them inside the container.
- Run all tests: `pytest` (collects from `src/sp_validation/tests`; coverage on by default)
- Skip the slow tests: `pytest -m "not slow"`
- Run a single test: `pytest src/sp_validation/tests/test_cosmology.py::test_function_name`
- Run a single test: `pytest src/sp_validation/tests/test_cosmo_val.py::test_function_name`

CI runs this same suite inside the freshly-built image before publishing it
(see `.github/workflows/deploy-image.yml`).
Expand Down Expand Up @@ -57,11 +57,13 @@ is the container (full scientific stack pre-built). For a local dev environment:
- **Healpy/HealSparse**: Sky map handling

### Cosmology Inference Pipeline (`cosmo_inference/`)
Run via `./pipeline.sh` with flags:
- `--pcf`: Calculate 2-point correlation functions
- `--covmat`: Calculate covariance matrix with CosmoCov
- `--inference`: Run CosmoSIS inference
- `--mcmc_process`: Analyze MCMC chains
Orchestrated through Snakemake, not a standalone driver; see
`cosmo_inference/README.md`. From the repository root:

```bash
snakemake --profile workflow/profiles/candide -s workflow/Snakefile \
inference_fiducial --configfile <run config>
```

### Configuration
Main configuration in `scripts/calibration/params.py` with parameters:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ toolchain (`autoconf`, `automake`, `libtool`, `pkg-config`) available.
```bash
pytest # full suite
pytest -m "not slow" # skip the slow tests
pytest src/sp_validation/tests/test_cosmology.py::test_name # a single test
pytest src/sp_validation/tests/test_cosmo_val.py::test_name # a single test
```

Tests live in `src/sp_validation/tests/`. The default options (configured in
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Validation of weak-lensing catalogues (galaxy and star shapes and other paramete
[![docs](https://img.shields.io/badge/docs-sphinx-blue)](https://cosmostat.github.io/sp_validation/)
[![CI](https://github.com/CosmoStat/sp_validation/actions/workflows/deploy-image.yml/badge.svg)](https://github.com/CosmoStat/sp_validation/actions/workflows/deploy-image.yml)
[![container](https://img.shields.io/badge/container-ghcr.io-2496ED?logo=docker&logoColor=white)](https://github.com/CosmoStat/sp_validation/pkgs/container/sp_validation)
[![python](https://img.shields.io/badge/python-3.11%2B-blue?logo=python&logoColor=white)](https://www.python.org/downloads/)
[![python](https://img.shields.io/badge/python-3.12%2B-blue?logo=python&logoColor=white)](https://www.python.org/downloads/)
[![license](https://img.shields.io/badge/license-MIT-blue)](https://github.com/CosmoStat/sp_validation/blob/develop/LICENCE.txt)
[![code style: ruff](https://img.shields.io/badge/code%20style-ruff-261230?logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff)
[![contribute](https://img.shields.io/badge/contribute-read-lightgrey)](https://github.com/CosmoStat/sp_validation/blob/develop/CONTRIBUTING.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ For a narrower install, ``.[test]`` adds only the test extras and ``.[docs]`` on

.. note::

``sp_validation`` requires Python 3.11 or newer and pulls in a large scientific stack: ``treecorr``, ``pyccl``, ``healpy``, ``pymaster``, and others.
``sp_validation`` requires Python 3.12 or newer and pulls in a large scientific stack: ``treecorr``, ``pyccl``, ``healpy``, ``pymaster``, and others.
A bare development install builds these from source, which is slow and platform-sensitive.
For most users the container is the more reliable path.
2 changes: 1 addition & 1 deletion papers/bmodes/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# compute workflow at ../../workflow/.

configfile: "config/config.yaml"
configfile: "/n17data/cdaley/unions/pure_eb/code/sp_validation/cosmo_val/cat_config.yaml"
configfile: "/n17data/cdaley/unions/code/sp_validation/cosmo_val/cat_config.yaml"

envvars:
"PYTHONUNBUFFERED",
Expand Down
10 changes: 5 additions & 5 deletions papers/bmodes/config/ecut_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DES-Y3 used e < 0.8 to remove stars.

### How versions flow through the pipeline

Everything is driven by `config["versions"]` in `workflow/config/config.yaml`. Adding a
Everything is driven by `config["versions"]` in `papers/bmodes/config/config.yaml`. Adding a
version there (plus its `cat_config.yaml` entry) makes it flow through all existing rules:
`xi`, `covariance`, `pure_eb_data_vector`, `cosebis_data_vector`, `cl_data_vector`.
The 2PCF and covariance are independent and can run in parallel.
Expand All @@ -43,7 +43,7 @@ Key resolution functions in `workflow/Snakefile`:
- `resolve_covariance_version()` — identity function (each version gets its own covariance)
- Wildcard constraint: `version=r"SP_v[\d.]+(_w_iv)?(_leak_corr)?"` — needs `_ecut\d+`

Version comparison rules in `workflow/rules/claims.smk` (lines 131, 271, 386) use
Version comparison rules in `papers/bmodes/rules/claims.smk` (lines 131, 271, 386) use
`VERSIONS_LEAK_CORR` for inputs and derive version lists from config in the scripts.
These should be parameterized to accept a version list via `snakemake.params`, so the
same rules serve both paper and ecut comparisons.
Expand Down Expand Up @@ -71,10 +71,10 @@ uncorrected columns can't be consistently filtered to guarantee the same rows.

| What | Where |
|------|-------|
| Workflow config | `workflow/config/config.yaml` (search `ecut`) |
| Catalog config | `code/sp_validation/cosmo_val/cat_config.yaml` (search `ecut07`) |
| Workflow config | `papers/bmodes/config/config.yaml` (search `ecut`) |
| Catalog config | `cosmo_val/cat_config.yaml` (search `ecut07`) |
| Pipeline orchestration | `workflow/Snakefile` (wildcard constraints, version resolution functions) |
| Version comparison rules | `workflow/rules/claims.smk` lines 131, 271, 386 |
| Version comparison rules | `papers/bmodes/rules/claims.smk` lines 131, 271, 386 |
| Version comparison scripts | `workflow/scripts/{pure_eb,cosebis,cl}_version_comparison.py` |
| Covariance params | `workflow/rules/covariance.smk` line 4 (`get_cat_params`) |

Expand Down
68 changes: 0 additions & 68 deletions papers/bmodes/scripts/run_cov_sweep.sh

This file was deleted.

2 changes: 1 addition & 1 deletion papers/bmodes/scripts/update_survey_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
memory usage.

Usage:
python workflow/scripts/update_survey_stats.py \
python papers/bmodes/scripts/update_survey_stats.py \
--mask-standard <path> --mask-starhalo <path>
"""

Expand Down
2 changes: 1 addition & 1 deletion papers/cosmo_val/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# isolation or as the whole suite via the default `cosmo_val_all` target.

configfile: "config/config.yaml"
configfile: "/n17data/cdaley/unions/pure_eb/code/sp_validation/cosmo_val/cat_config.yaml"
configfile: "/n17data/cdaley/unions/code/sp_validation/cosmo_val/cat_config.yaml"

envvars:
"PYTHONUNBUFFERED",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ glass = [
# Snakemake workflow and cross-validation runners are available.
workflow = [
"snakemake",
# run_2pcf_highres.py drives the MPI convergence run; the container ships
# OpenMPI under /opt/ompi so mpi4py builds against it.
# Optional MPI runners (the container ships OpenMPI at /opt/ompi, so mpi4py
# builds against it).
"mpi4py",
# CosmoSIS drives the cosmo_inference sampling step. Sdist-only, so this is a
# source build (~2 min) against the base image's gfortran/GSL/cfitsio/OpenMPI —
Expand Down
49 changes: 0 additions & 49 deletions workflow/rules/twopoint.smk
Original file line number Diff line number Diff line change
Expand Up @@ -24,55 +24,6 @@ rule xi:
"../scripts/run_2pcf.py"


# PARKED: xi_highres (high-resolution xi for COSEBIS integration). Not runnable
# as written -- the shell invokes run_2pcf_highres.py bare, but the script has
# required --cat-config and --out arguments. Revive it with those supplied.
#
# The MPI reasoning below is hard-won and must survive the revival:
#
# Exception to the profile-driven container model: this is multi-node MPI, one
# `apptainer exec` per rank. Snakemake's own container wrapping puts the
# *whole* shell command -- `mpiexec` included -- inside a single container
# instance, so only rank 0's node would run inside it; the other ranks,
# spawned by SLURM/PMI on their own nodes, would land bare on the host.
# `container: None` plus an explicit `mpiexec -n N apptainer exec ...`
# per-rank is therefore required.
# Snakemake's slurm-jobstep plugin deliberately does NOT prepend `srun` to a
# job carrying an `mpi` resource, which is what lets the rule's own launcher
# run on the host, outside the container.
# Because this rule builds its own apptainer call, reaching the source-cache
# copy of the script relies on our `--bind /home` rather than on Snakemake's
# automatic mount -- and on a concrete image file, since `apptainer exec`
# takes no `docker://` URI. Take that path from `resolve_image()[0]` rather
# than naming a second image path that can drift.
#
# rule xi_highres:
# container: None
# params:
# image=resolve_image()[0],
# input:
# script=workflow.source_path("../scripts/run_2pcf_highres.py"),
# output:
# txt=str(COSMO_VAL / f"{FIDUCIAL['version']}_xi_minsep={FIDUCIAL['min_sep_int']}_maxsep={FIDUCIAL['max_sep_int']}_nbins=10000_npatch=1.txt"),
# xi_plus=str(COSMO_VAL / f"xi_plus_{FIDUCIAL['version']}_minsep={FIDUCIAL['min_sep_int']}_maxsep={FIDUCIAL['max_sep_int']}_nbins=10000_npatch=1.fits"),
# xi_minus=str(COSMO_VAL / f"xi_minus_{FIDUCIAL['version']}_minsep={FIDUCIAL['min_sep_int']}_maxsep={FIDUCIAL['max_sep_int']}_nbins=10000_npatch=1.fits"),
# resources:
# tasks=30,
# cpus_per_task=12,
# nodes=6,
# mem_mb_per_cpu=2000,
# runtime=2880,
# slurm_extra="'--exclude=n17,n09,n36 --partition=pscomp'",
# mpi="/softs/openmpi/5.0.5-slurm-CentOS8/bin/mpiexec",
# shell:
# "{resources.mpi} -n {resources.tasks} "
# "apptainer exec "
# "--bind /home,/n09data,/n17data,/n23data1,/softs "
# "--env LD_LIBRARY_PATH=/softs/openmpi/5.0.5-slurm-CentOS8/lib "
# "{params.image} "
# "python {input.script} --cat-config <...> --out <...>"


rule rho_tau_stats:
output:
rho_stats=str(COSMO_VAL / "rho_tau_stats/rho_stats_{version}_minsep={min_sep}_maxsep={max_sep}_nbins={nbins}_npatch={npatch}.fits"),
Expand Down
Loading
Loading