test: lock down WeakDataset json round-trip (paired with PyAutoArray fix)#555
Merged
Conversation
Regression test for the failure mode that surfaced in PR #525 — al.from_json on a serialised WeakDataset previously crashed with: TypeError: VectorYX2DIrregular.__init__() missing 1 required positional argument: 'values' The library-side fix lives in PyAutoArray (a `values` property on VectorYX2DIrregular). This test asserts the full simulator → write → load path, including subclass preservation — loaded.shear_yx returns as ShearYX2DIrregular, not the base class — plus matching shear values, grid positions, and noise map. Refs issue #554. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Workspace PR: PyAutoLabs/autolens_workspace#212 |
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
Adds a regression test that exercises the full
al.output_to_json→al.from_jsonround-trip forWeakDataset. The original failure (surfaced in PR #525 / workspace #188) was aTypeError: VectorYX2DIrregular.__init__() missing 1 required positional argument: 'values'raised insidedictable.from_dict. The library-side fix lives in PyAutoArray; this PR locks down the end-to-end behaviour at theWeakDatasetlevel, including subclass preservation (loaded.shear_yxcomes back asShearYX2DIrregular, not the base class).Paired with: PyAutoLabs/PyAutoArray#342
Closes #554.
API Changes
None — test-only change. See full details below.
Test Plan
test_autolens/weak/test_dataset.py::test__weak_dataset__json_round_trippasses locallytest_autolens/weak/suite passes locally (27 tests)Full API Changes (for automation & release notes)
None — test-only change.
🤖 Generated with Claude Code