Repository navigation
fix: persist SparseTerms phase_centre through the dataset.fits round trip (streaming P5) - #643
Merged
Merged
Conversation
…trip (streaming P5 review) - interferometer_hdu_list_from appends the (y, x) phase centre (arcsec) to the lossless SPARSE_TERMS_SCALARS HDU (NaN when not recorded) and writes PHCENTY / PHCENTX header cards when recorded. - _sparse_terms_from reloads it; files written before this change (5-entry scalars, no cards) reload it as None. Previously reloaded shifted terms carried phase_centre=None and summed silently with unshifted ones. - Tests: on-disk round trip of (0.7, -1.3) with the sum against unshifted terms raising; unrecorded and pre-existing-file cases reload None. Refs PyAutoLabs/PyAutoArray#600 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
|
Workspace PR: PyAutoLabs/autolens_workspace#582 (array-free datacube example; merges after this PR under the library-first gate). |
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
Streaming visibilities phase 5 companion (epic
streaming-visibilities, Discussion https://github.com/orgs/PyAutoLabs/discussions/13; issue PyAutoLabs/PyAutoArray#600). The PyAutoArray PR addsSparseTerms.phase_centreprovenance (chunk-by-chunk phase-centre shifts insparse_terms_from_chunks/Interferometer.from_stream) and refuses to sum terms with different recorded phase centres. This PR makes that provenance survive thedataset.fitsround trip: without it, terms accumulated with a shift reloaded withphase_centre=Noneand could be summed with unshifted terms silently (Codex review finding F1, reproduced:(0.7, -1.3)→None, sum succeeded; after the fix the sum raises).PyAutoLens imports this writer and loader from autogalaxy, so it needs no change. Requires the PyAutoArray companion PR (same branch name).
API Changes
Persistence only. The
SPARSE_TERMS_SCALARSHDU written byinterferometer_hdu_list_fromgains two trailing float64 entries,phase_centre_y/phase_centre_x(NaN when not recorded), withPHCENTY/PHCENTXheader cards when recorded; the aggregator loader rebuildsSparseTerms.phase_centrefrom them. Files written before this change load unchanged withphase_centre=None.See full details below.
Test Plan
Nonewith the other scalars intact.test_autogalaxy: 1307 passed (main: 1305).Full API Changes (for automation & release notes)
Changed Behaviour
autogalaxy.interferometer.model.analysis.interferometer_hdu_list_from—SPARSE_TERMS_SCALARSHDU has 7 entries (was 5):..., phase_centre_y, phase_centre_x(NaN = not recorded); header cardsPHCENTY/PHCENTXwritten when recorded.SPARSE_TERMS_SCALARS_ORDERandSPARSE_TERMS_HEADER_KEYSgain the two keys.autogalaxy.aggregator.interferometer._interferometer_from— rebuildsaa.SparseTerms(phase_centre=…); older files →None.Heart RED development override (human-authorized, 2026-10-01)
Shipped under the AUTONOMY.md "Human override for Heart RED (development only)". Live human authorization in the CLI session (Fable 5.1), quoted: "Yes: library now, workspace when its run passes" for task
streaming-p5-cubes-phase-centre(PyAutoLabs/PyAutoArray#600). Exact RED reasons at ship time (pyauto-heart readiness):None relate to this branch. Branch gates passed: test_autoarray 1917, test_autogalaxy 1307; Codex review 5 findings (3 introduced → fixed + red-checked, 2 pre-existing → filed). Scope: push + PR-open only. Merge requires a separate human
/prmwith every required check green; not a release; no claim that Heart is healthy.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code