Skip to content

Replace -e/--exclusive flag with NUMBER_LIST (#746)#748

Merged
cailmdaley merged 2 commits into
ngmix_v2.0from
refactor/number-list-replaces-exclusive
Jun 11, 2026
Merged

Replace -e/--exclusive flag with NUMBER_LIST (#746)#748
cailmdaley merged 2 commits into
ngmix_v2.0from
refactor/number-list-replaces-exclusive

Conversation

@cailmdaley

Copy link
Copy Markdown
Contributor

Implements #746: the -e/--exclusive input-ID flag is retired; NUMBER_LIST is now the one mechanism for restricting a run to given IDs. Targets ngmix_v2.0 so it rides #741 to develop (the v2.0 canfar scripts diverged from develop, so this is the conflict-free base).

Pipeline

  • -e/--exclusive removed from args.py, with its plumbing through run.py, FileHandler, and JobHandler (where it was stored but never used)
  • NUMBER_LIST entries are now validated against the input file numbers actually found on disk — preserving -e's early failure on a typo'd ID: the run aborts at start-up with a clear message instead of when a module first tries to open non-existent files
  • unit tests: subset passes, typo raises, scan path without NUMBER_LIST unchanged

Canfar chain — script-level -e options are unchanged (one ID per headless job remains the orchestration interface); what changes is how they realize it:

  • job_sp_canfar.bash, job_sp_canfar_v2.0.bash, init_run_exclusive_canfar.sh write NUMBER_LIST into a per-job config copy (set_config_number_list: insert-or-replace under [FILE]; ID transformed to numbering-scheme form, leading dash + dots→dashes — exactly the transform -e did internally)
  • side benefit: the processed ID now lands in the config that shapepipe copies into the run's log directory — better provenance than a CLI flag that vanishes

Verified: full test suite (61 passed) in the ngmix v2.0 container against this branch; set_config_number_list smoke-tested against config_tile_Uz.ini (insert), an already-set config (replace), and a [FILE]-followed-by-comment edge case.

Closes #746.

🤖 Generated with Claude Code

cailmdaley and others added 2 commits June 11, 2026 22:52
The exclusive input-ID flag and the NUMBER_LIST config option converged
in FileHandler._format_process_list and did the same thing for a single
ID; NUMBER_LIST is now the one mechanism.

Pipeline:
- remove -e/--exclusive from args.py and its plumbing through run.py,
  FileHandler, and JobHandler (where it was stored but never used)
- NUMBER_LIST entries are now validated against the input file numbers
  found on disk, preserving -e's early failure on a wrong ID: the run
  aborts at start-up instead of when a module first opens files
- unit tests for the validation (subset passes, typo raises, no-list
  scan path unchanged)

Canfar chain (script-level -e options are unchanged; one ID per
headless job remains the interface):
- job_sp_canfar.bash, job_sp_canfar_v2.0.bash, and
  init_run_exclusive_canfar.sh write NUMBER_LIST into a per-job config
  copy (set_config_number_list: insert-or-replace under [FILE], ID in
  numbering-scheme form: leading dash, dots->dashes) instead of passing
  -e to shapepipe_run. Side benefit: the processed ID is recorded in
  the config copied to the run's log directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review hardening: set_config_number_list now verifies the key landed in
the config copy and aborts otherwise — a config with no NUMBER_LIST line
and no bare [FILE] header would previously install an unmodified copy
and silently process every image. Also fix init_run_exclusive_canfar.sh's
missing-ID guard, which tested an unset variable and never fired.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cailmdaley cailmdaley merged commit 5a51dd6 into ngmix_v2.0 Jun 11, 2026
2 checks passed
@cailmdaley cailmdaley mentioned this pull request Jun 11, 2026
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