Skip to content

Calibration fail-fast, pipeline_config_dir, jobs cap, response docs (imsims A/B campaign)#285

Draft
cailmdaley wants to merge 4 commits into
developfrom
imsims-ab-fixes
Draft

Calibration fail-fast, pipeline_config_dir, jobs cap, response docs (imsims A/B campaign)#285
cailmdaley wants to merge 4 commits into
developfrom
imsims-ab-fixes

Conversation

@cailmdaley

Copy link
Copy Markdown
Collaborator

Closes #284

Four small fixes from the A/B characterization campaign (shapepipe#813), one commit each:

  • pipeline_config_dir (cherry-pick from the campaign branch): optional run-config key pointing the ShapePipe pipeline stage at a per-run config tree; unset ⇒ byte-exact prior behaviour. This is what let every config-only A/B arm run without forking the shared worktree.
  • Fail fast on empty metacal selection: metacal._masking_gal now raises a named error ("0 objects survive the metacal selection … upstream shape measurement likely failed wholesale") instead of letting a 0-row frame die three layers down in pandas.
  • snakemake ≥ 9 jobs cap: docstring corrected and the candide profile gains jobs: 100, so the documented profile-only invocation works again (9.16.3 hard-requires a job cap).
  • Document global-response calibration: one Notes block on get_calibrated_quantities stating that a single run-averaged R is applied to every object (per-object responses exist but are only consumed as means).

Reviewer call intentionally left open: none here — the debatable piece (RuntimeError on wholesale failure) lives in the shapepipe sibling PR.

— Claude (Fable), on behalf of Cail.

🤖 Generated with Claude Code

https://claude.ai/code/session_019dA9sas4vvNBcNKRmi973L

cailmdaley and others added 4 commits July 17, 2026 15:15
The ShapePipe pipeline stage's ngmix ini (which owns METACAL_PSF) is
resolved from the shapepipe worktree's example/cfis_image_sims via
run_job's self-computed config_dir, so nothing in the run config could
select a different ini -- an A/B on the metacal reconvolution PSF needed
a separate worktree per arm.

Add an optional operational key `pipeline_config_dir`. When set it is
passed to run_job as `-c DIR`, redirecting the pipeline stage's whole
ShapePipe config tree (ngmix ini included) at a per-arm copy; when empty
(the default) no `-c` is passed and run_job self-computes exactly as
before, so runs predating this key reproduce bit-exact. Merge/final_cat
still read the top-level cfis symlink (config_dir), untouched.

Candidate upstream PR for the image-sims orchestration branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XSWPiisH6y7NFFbjHqthuC
An empty no-shear selection (every object failing the flag/SNR/size
cuts, typically because upstream shape measurement failed wholesale)
previously propagated a 0-row catalogue all the way to get_w_des,
where pandas died with the opaque "cannot set a frame with no defined
index". Raise at the point emptiness is first knowable -- the end of
metacal._masking_gal -- naming the actual condition.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019dA9sas4vvNBcNKRmi973L
The Snakefile docstring claimed no -j is needed because "the slurm
executor sets the job cap"; snakemake 9.16.3 in fact refuses to run
without an explicit --jobs. Pair the doc correction with jobs: 100 in
the candide profile so the promise (no -j on the command line) becomes
true again rather than merely corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019dA9sas4vvNBcNKRmi973L
The design choice was implicit, spread across metacal.R construction,
get_calibrate_e_from_cat's np.mean loop and get_quantities_binned's
per-bin means; state it once on the function every calibration
consumer flows through.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019dA9sas4vvNBcNKRmi973L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calibration robustness + image-sims workflow fixes from the A/B campaign

1 participant