Skip to content

fix: AnalysisInterferometer.__init__ kwargs passthrough#500

Merged
Jammy2211 merged 1 commit intomainfrom
feature/autolens-interferometer-jax-viz
May 8, 2026
Merged

fix: AnalysisInterferometer.__init__ kwargs passthrough#500
Jammy2211 merged 1 commit intomainfrom
feature/autolens-interferometer-jax-viz

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

PyAutoLens AnalysisInterferometer.__init__ defined its own explicit signature without **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:

This PR adds **kwargs to the parameter list and forwards it in the super().__init__() call. AnalysisDataset (the parent) already accepts and forwards **kwargs, so this just plugs the gap in the subclass override. Compare ag.AnalysisImaging which has had **kwargs passthrough all along.

Discovered while drafting interferometer/visualization_jax.py and interferometer/modeling_visualization_jit.py for 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 **kwargs passthrough — strictly additive. Any caller that previously worked is unaffected. New: callers can now pass use_jax_for_visualization=True (or any other kwarg accepted by the autofit base Analysis) without TypeError.

See full details below.

Test Plan

  • pytest test_autolens/imaging/ test_autolens/interferometer/ test_autolens/analysis/ — all pass
  • python 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.png produced
Full API Changes (for automation & release notes)

Changed Signature

  • al.AnalysisInterferometer.__init__ now accepts **kwargs and forwards them to super().__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 **kwargs passthrough). 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

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.
@Jammy2211
Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace_test#87

@Jammy2211 Jammy2211 merged commit aa12ec1 into main May 8, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/autolens-interferometer-jax-viz branch May 8, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant