Skip to content

fix: let MockResult accept and forward samples_summary - #569

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/autofit-mock-ones-parameters-bug-sv303m
Aug 13, 2026
Merged

fix: let MockResult accept and forward samples_summary#569
Jammy2211 merged 1 commit into
mainfrom
claude/autofit-mock-ones-parameters-bug-sv303m

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Problem

ag.m.MockResult subclasses af.m.MockResult but omits samples_summary from its signature, so it is never forwarded to super():

ag.m.MockResult(model=model, samples=samples, samples_summary=samples.summary())
TypeError: MockResult.__init__() got an unexpected keyword argument 'samples_summary'

Callers therefore could not supply a summary at all through this subclass, and were silently forced onto the parent's placeholder summary. That placeholder filled every parameter with 1.0, which is an invalid ell_comps — the failure fixed in PyAutoFit#1471.

Change

Add samples_summary to the signature and forward it to super().__init__. One line each way; no behaviour change for existing callers, which pass None by omission exactly as before.

al.m.MockResult is this class (re-exported by PyAutoLens, not a second subclass), so PyAutoLens is covered by the same change — no separate fix needed there.

Tests

Suite Result
test_autogalaxy 1081 passed, 0 failed
test_autolens 518 passed, 1 failed (pre-existing, unrelated)
7 aggregator integration scripts 7/7 pass

The pre-existing PyAutoLens failure is potential_correction/test_iterative_interferometer.py::test__solve_joint_optimization__identity_damping_finite; it reproduces without this change.

Related

Depends on PyAutoFit#1471 for the placeholder-value fix itself. Merge that one first.


Generated by Claude Code

The subclass omitted samples_summary from its signature, so
ag.m.MockResult(..., samples_summary=...) raised TypeError and callers
could not avoid the parent's placeholder summary. Forward it to super().

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqpBSWF2JDx4L9g1YCQk67
@Jammy2211
Jammy2211 merged commit ee0f471 into main Aug 13, 2026
3 checks passed
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.

2 participants