Skip to content

Skip linear mosaic targets in ImagingChunkedHandler - #413

Open
thomaswilliamsastro wants to merge 1 commit into
masterfrom
chunked-imaging-skip-mosaics
Open

thomaswilliamsastro wants to merge 1 commit into
masterfrom
chunked-imaging-skip-mosaics

Conversation

@thomaswilliamsastro

Copy link
Copy Markdown
Collaborator

Closes #350.

ImagingChunkedHandler crashed when given a linear mosaic target, since there's no MS to read. The standard ImagingHandler skips these gracefully.

  • Check is_target_linmos near the top of __init__. For a mosaic, log a warning, set skip_target = True, chunk_params = {}, nchunks = 0, and return before anything touches the MS. Loops over range(nchunks) (as in the example script) then just do nothing.
  • run_imaging and task_complete_gather_into_cubes return early with a warning when skip_target is set.
  • New CASA-marked test tests/test_handlerImagingChunked.py, which builds minimal keys with a mosaic target and checks the handler skips it. It passes with the fix and fails on the old code (TypeError: cannot unpack non-iterable NoneType object during cell/imsize setup).

Note: a missing MS for a non-mosaic target still crashes; the standard handler skips that case too, but it's out of scope here.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.63%. Comparing base (a2bf09e) to head (ed7ccf2).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #413      +/-   ##
==========================================
+ Coverage    7.96%   12.63%   +4.67%     
==========================================
  Files          42       43       +1     
  Lines       16631    16696      +65     
  Branches     3982     3986       +4     
==========================================
+ Hits         1324     2110     +786     
+ Misses      15284    14352     -932     
- Partials       23      234     +211     
Components Coverage Δ
casa 4.94% <ø> (ø)
handler 14.58% <75.00%> (+8.28%) ⬆️
spectral-cube 10.16% <ø> (ø)
utils 20.38% <ø> (+6.79%) ⬆️

Mosaic targets have no MS of their own, so ImagingChunkedHandler crashed
on init. Check for a linmos target up front, log a warning, and make
run_imaging and task_complete_gather_into_cubes no-ops, matching the
behaviour of the standard ImagingHandler.

Closes #350

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thomaswilliamsastro
thomaswilliamsastro force-pushed the chunked-imaging-skip-mosaics branch from cf2841a to ed7ccf2 Compare October 21, 2026 08:05
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.

ImagingChunkedHandler should be mosaic-aware

1 participant