Skip to content

[codex] Improve MS discovery diagnostics#23

Merged
jakobtfaber-2 merged 1 commit into
mainfrom
codex/diagnose-ms-field-discovery
Apr 30, 2026
Merged

[codex] Improve MS discovery diagnostics#23
jakobtfaber-2 merged 1 commit into
mainfrom
codex/diagnose-ms-field-discovery

Conversation

@jakobtfaber-2
Copy link
Copy Markdown
Contributor

Summary

  • distinguish missing FIELD subtables from unreadable FIELD tables in mosaic_day.find_valid_ms()
  • include the adapter exception type/message when FIELD exists but cannot be opened
  • add mocked regression coverage for valid, missing, unreadable, non-directory, and filtered MS discovery cases

Root cause

Issue #22 was reproducible because staged MS paths had FIELD/ directories, but the table adapter could not open them in this environment. The swallowed exception was RuntimeError: casatools is not installed in this environment..., so the old no FIELD table warning was misleading.

Validation

  • PYTHONPATH=/workspace python3 -m pytest tests/test_mosaic_day_ms_discovery.py tests/test_batch_pipeline_dry_run_quarantine.py -q
  • ruff check scripts/mosaic_day.py tests/test_mosaic_day_ms_discovery.py
  • ruff format --check scripts/mosaic_day.py tests/test_mosaic_day_ms_discovery.py
  • Diagnose dry-run valid-MS discovery reporting zero despite staged FIELD directories #22 dry-run command exits 0 and reports unreadable FIELD table: RuntimeError: casatools is not installed...

Note: tests/test_calibration_viability.py is not present on the current origin/main base for this isolated #22 PR.

Closes #22

Copilot AI review requested due to automatic review settings April 30, 2026 04:32
@jakobtfaber-2 jakobtfaber-2 merged commit 2a1e66a into main Apr 30, 2026
3 checks passed
@jakobtfaber-2 jakobtfaber-2 deleted the codex/diagnose-ms-field-discovery branch April 30, 2026 04:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Measurement Set (MS) discovery diagnostics used by scripts/batch_pipeline.py --dry-run via scripts/mosaic_day.py, so operators can distinguish a genuinely missing FIELD subtable from cases where FIELD exists but cannot be opened (e.g., missing CASA tooling).

Changes:

  • Update mosaic_day.find_valid_ms() to separately detect missing FIELD, non-directory FIELD, and FIELD open failures (including exception type/message).
  • Add regression tests covering valid MS discovery, missing FIELD, unreadable FIELD, filtered MS names, and non-directory FIELD.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/mosaic_day.py Improves MS discovery warnings by checking FIELD existence/type and logging adapter exceptions when FIELD can’t be opened.
tests/test_mosaic_day_ms_discovery.py Adds mocked tests to ensure the new discovery diagnostics and filtering behavior are exercised in CI without CASA.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Diagnose dry-run valid-MS discovery reporting zero despite staged FIELD directories

3 participants