Skip to content

ngmix_runner: expand MEGACAM_FLIP before reading it as a boolean - #988

Open
cailmdaley wants to merge 2 commits into
feat/im-sims-mccdfrom
fix/ngmix-megacam-flip-expand
Open

cailmdaley wants to merge 2 commits into
feat/im-sims-mccdfrom
fix/ngmix-megacam-flip-expand

Conversation

@cailmdaley

@cailmdaley cailmdaley commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude Opus on behalf of Cail.

ngmix_runner reads MEGACAM_FLIP with plain getboolean. The cfis ngmix ini sets MEGACAM_FLIP = ${SP_MEGACAM_FLIP:-True}, so the parser gets that literal string, and every tile_ngmix chunk fails with Not a boolean about 26 minutes in. This has been the case on feat/im-sims-mccd since 85e0900, so image-sim runs on the current tip fail at ngmix.

Changes:

  • ngmix_runner.py now reads the option with getexpandedboolean, which expands the variable before converting it.
  • CustomParser.getexpandedboolean now returns fallback when the option or section is absent, the same way getboolean does. Before this change it passed the fallback through the env-var expander, and a bool fallback raised TypeError. Without this second fix, the one-line change above would break every config that has no MEGACAM_FLIP line, because ngmix_runner passes fallback=True.
  • New test test_custom_parser_expanded_boolean_fallback covers an absent option, an absent section, no fallback (raises NoOptionError), and an expanded value that overrides the fallback.

Testing: I ran tests/module/test_pipeline.py (17 passed) in shapepipe_im_sims-runtime.sif on a candide compute node, with this branch's src first on the path.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JK7o9Dv6PXjWdodP6mhNQL

cailmdaley and others added 2 commits October 29, 2026 05:25
The cfis ngmix ini sets MEGACAM_FLIP = ${SP_MEGACAM_FLIP:-True}; plain
getboolean sees the literal and every tile_ngmix chunk fails with
'Not a boolean'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JK7o9J2jMWQK4dkZkL9WLv
getexpanded passed the fallback through the env-var expander, so a bool
fallback raised TypeError where getboolean returns it. ngmix_runner reads
MEGACAM_FLIP with fallback=True, so configs without that line broke.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JK7o9H9kWBd294QyzLNrxc

This branch has not been deployed

No deployments
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