Skip to content

Finish the exposure PSF run-dir rename (exp_psf fails on develop) - #888

Merged
cailmdaley merged 1 commit into
developfrom
fix/exp-psf-run-name
Sep 12, 2026
Merged

cailmdaley merged 1 commit into
developfrom
fix/exp-psf-run-name

Conversation

@cailmdaley

@cailmdaley cailmdaley commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Hotfix: every exp_psf job fails on develop

Two PRs that were developed in parallel disagree on the name of the exposure-PSF run directory. #847 (external healsparse masks) added a setools INPUT_DIR that reads run_sp_exp_SxSePsfPi; #852 (the Snakemake workflow) renamed that directory to run_sp_exp_SxSePsf. Both were right on their own branch, git merged them without conflict, and no campaign ran the combined tree before #852 was merged — the last one (smk-g6) predates the cross-merge. The first run on develop (smk-g7) fails every exp_psf job with Invalid INPUT_DIR (…/run_sp_exp_SxSePsfPi/mask_query_runner/output), and retries fail with Directory …/run_sp_exp_SxSePsf already exists, because completeness.STAGE_DIR["exp_psf"] — which the retry uses to reset the unit — also still carried the old name.

Fix. The four remaining consumers now agree on run_sp_exp_SxSePsf: setools' INPUT_DIR in config_exp_psfex.ini, completeness.STAGE_DIR, and two docstrings.

Test. tests/unit/test_workflow_run_names.py asserts that every run directory is named once per config and that every chained INPUT_DIR, both PSF configs, and completeness.STAGE_DIR agree. It fails on the pre-fix tree with both production errors, so a future parallel rename cannot merge silently.

Note: completeness.py is hashed into every rule's params, so merging this invalidates the rerun state of in-flight campaigns. Cheap — prepare uses RETRIEVE=symlink.

— Fable on behalf of Cail

🤖 Generated with Claude Code

98bc085 renamed the exposure PSF stage's run dir from run_sp_exp_SxSePsfPi to
run_sp_exp_SxSePsf, so that config_exp_psfex.ini and config_exp_mccd.ini write
one path and nothing downstream of exp_psf has to branch on `psf:`. It updated
the one INPUT_DIR that existed at the time and left every other copy of the
name behind. The mask_query merge then reintroduced a stale one: the chain grew
a module between sextractor and setools, and setools' INPUT_DIR came across
from the healsparse branch still spelling the old name.

smk-g7 lost all 127 exposures to it, in two different voices:

  ERROR: Invalid INPUT_DIR (.../run_sp_exp_SxSePsfPi/mask_query_runner/output)

on the first attempt -- mask_query had in fact run and written all 40
sexcat_ext files, into run_sp_exp_SxSePsf, where setools was not looking -- and
then, on every retry:

  ERROR: Directory .../run_sp_exp_SxSePsf already exists.

which is the SAME bug wearing the STAGE_DIR hat. unit_pre clears the stage's
run dir before each attempt precisely so a retry starts clean, and it takes the
directory's name from completeness.STAGE_DIR. That entry was stale too, so the
rm -rf had been clearing a directory nobody writes and the real one accumulated
until ShapePipe refused it.

So the retry cleanup needed no new mechanism; it needed the name it already
had. Fixing STAGE_DIR fixes both the clearing and the counting.

tests/unit/test_workflow_run_names.py holds the invariant that made this
possible to get wrong: a run directory is named once in a config and then
referred to by things that must find it, and nothing checked that they agreed.
It asserts the agreement statically, and fails on the pre-fix tree with both of
the errors above named in its messages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbnPCyzuDNTgkg715pHhar
(cherry picked from commit e9e8564d7aa9b9034c49406bd96852df7ba44525)
@cailmdaley
cailmdaley merged commit 14ce409 into develop Sep 12, 2026
2 checks passed
@cailmdaley
cailmdaley deleted the fix/exp-psf-run-name branch September 12, 2026 11:24
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.

1 participant