fix: AnalysisInterferometer.__init__ kwargs passthrough#500
Merged
Conversation
AnalysisInterferometer's explicit __init__ omitted **kwargs, so any kwarg not in its named-parameter list (notably use_jax_for_visualization from the autofit base Analysis) raised TypeError instead of being forwarded to super. This left use_jax_for_visualization=True silently unusable on al.AnalysisInterferometer despite: - the interferometer visualizer dispatching via fit_for_visualization (visualizer.py:96, 209, since #443) - AnalysisInterferometer having full pytree registration via _register_fit_interferometer_pytrees Compare ag.AnalysisImaging which has had **kwargs passthrough all along. AnalysisDataset (the parent) already accepts and forwards **kwargs, so this just plugs the gap in the subclass override. Discovered while drafting interferometer/visualization_jax.py and modeling_visualization_jit.py for autolens_workspace_test (Phase 1A of the JAX visualization roadmap). The workspace_test scripts follow in PyAutoLabs/autolens_workspace_test#86 sibling PR.
This was referenced May 8, 2026
Closed
Collaborator
Author
|
Workspace PR: PyAutoLabs/autolens_workspace_test#87 |
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
PyAutoLens
AnalysisInterferometer.__init__defined its own explicit signature without**kwargs, so any kwarg not in its named-parameter list (notablyuse_jax_for_visualizationfrom the autofit baseAnalysis) raisedTypeErrorinstead of being forwarded to super.This left
use_jax_for_visualization=Truesilently unusable onal.AnalysisInterferometerdespite:fit_for_visualization(autolens/interferometer/model/visualizer.py:96, 209, since feat: route visualizer fit construction through fit_for_visualization #443)AnalysisInterferometerhaving full pytree registration via_register_fit_interferometer_pytreesThis PR adds
**kwargsto the parameter list and forwards it in thesuper().__init__()call.AnalysisDataset(the parent) already accepts and forwards**kwargs, so this just plugs the gap in the subclass override. Compareag.AnalysisImagingwhich has had**kwargspassthrough all along.Discovered while drafting
interferometer/visualization_jax.pyandinterferometer/modeling_visualization_jit.pyfor autolens_workspace_test (Phase 1A of the JAX visualization roadmap). The workspace_test scripts ship as a sibling PR on autolens_workspace_test, linked to PyAutoLabs/autolens_workspace_test#86.API Changes
al.AnalysisInterferometer.__init__gains a**kwargspassthrough — strictly additive. Any caller that previously worked is unaffected. New: callers can now passuse_jax_for_visualization=True(or any other kwarg accepted by the autofit baseAnalysis) withoutTypeError.See full details below.
Test Plan
pytest test_autolens/imaging/ test_autolens/interferometer/ test_autolens/analysis/— all passpython autolens_workspace_test/scripts/interferometer/visualization_jax.py(with JAX enabled) —PILOT SUCCEEDED — JAX-backed interferometer visualization produced fit.png/tracer.png.python autolens_workspace_test/scripts/interferometer/modeling_visualization_jit.py(with JAX enabled) — JIT cache fires during Nautilus,fit.pngproducedFull API Changes (for automation & release notes)
Changed Signature
al.AnalysisInterferometer.__init__now accepts**kwargsand forwards them tosuper().__init__(). Strictly additive — no existing call site is affected.Migration
None required. Callers that previously passed only the named arguments continue to work.
Follow-ups not in this PR
al.AnalysisPoint.__init__— same gap (no**kwargspassthrough). Deferred to Phase 1B of the JAX visualization roadmap (PyAutoPrompt/issued/jax_viz_point_source_coverage.md).ag.AnalysisInterferometer.__init__— same gap. Deferred to Phase 1C (PyAutoPrompt/autogalaxy_workspace_test/jax_viz_dataset_coverage.md).🤖 Generated with Claude Code