[codex] Improve MS discovery diagnostics#23
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 missingFIELD, non-directoryFIELD, andFIELDopen failures (including exception type/message). - Add regression tests covering valid MS discovery, missing
FIELD, unreadableFIELD, filtered MS names, and non-directoryFIELD.
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.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mosaic_day.find_valid_ms()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 wasRuntimeError: casatools is not installed in this environment..., so the oldno FIELD tablewarning was misleading.Validation
PYTHONPATH=/workspace python3 -m pytest tests/test_mosaic_day_ms_discovery.py tests/test_batch_pipeline_dry_run_quarantine.py -qruff check scripts/mosaic_day.py tests/test_mosaic_day_ms_discovery.pyruff format --check scripts/mosaic_day.py tests/test_mosaic_day_ms_discovery.pyunreadable FIELD table: RuntimeError: casatools is not installed...Note:
tests/test_calibration_viability.pyis not present on the currentorigin/mainbase for this isolated #22 PR.Closes #22