Skip to content

fix: JAX weak fits visualize (#614); mixed factor graphs under the default setup - #896

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-r6d-prerelease-fixes
Nov 26, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-r6d-prerelease-fixes

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #895 and #614 together with the PyAutoFit and PyAutoGalaxy PRs on branch feature/likelihood-lifecycle-r6d-prerelease-fixes. Merge order: Fit → Galaxy → Lens.

  • Weak-lensing visualization crashes on JAX path: fit.shear_yx lacks .grid #614, JAX weak visualization: AnalysisWeak.fit_for_visualization(instance) builds FitWeak(..., xp=np), so the plotters receive a structured ShearYX2DIrregular (on the JAX path FitWeak.model_shear was a raw array → 'ArrayImpl' object has no attribute 'grid'). The log likelihood is unchanged and the plotter is not special-cased. ResultWeak.max_log_likelihood_fit crashed the same way and now uses the same fit. This lets AnalysisWeak keep the R6 setup="auto" default (which picks JAX).
  • Mixed factor graphs: tests that default-constructed imaging + interferometer and imaging + point graphs pass modify_before_fit and evaluate the likelihood (the adoption lives in PyAutoFit/PyAutoGalaxy); explicit disagreement still raises.

API Changes

al.AnalysisWeak.fit_for_visualization and ResultWeak.max_log_likelihood_fit return a NumPy FitWeak on every backend.
See full details below.

Test Plan

  • Every new test failed in a control run without the source change and passes with it
  • Suites with JAX (serial): PyAutoFit 4399, PyAutoGalaxy 1685, PyAutoLens 1182 passed
  • No-JAX leg reproduced as CI (venv, [optional] extras, jax family uninstalled): PyAutoFit 4072, PyAutoGalaxy 1601, PyAutoLens 1114 passed, 0 failed
  • End-to-end in test mode: autolens_workspace weak/modeling.py on the default (JAX) setup, and multi_dataset/features/imaging_and_interferometer/modeling.py + imaging_and_point_source/modeling.py with every use_jax=True removed — all exit 0
  • Heart dev-ship readiness: GREEN; pyauto-heart smoke --affected-by PyAutoFit against the task worktree: 8/8 workspaces passed
  • New test_autolens/weak/model/test_visualizer_weak.py (2, importorskip("jax"); control reproduced the Weak-lensing visualization crashes on JAX path: fit.shear_yx lacks .grid #614 crash)
  • New test_autolens/analysis/test_factor_graph_default_setup.py (3; all failed on control)
Full API Changes (for automation & release notes)

Changed

  • AnalysisWeak.fit_for_visualization(instance) → NumPy FitWeak regardless of backend.
  • ResultWeak.max_log_likelihood_fit → built with fit_for_visualization.

Fixed

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…fault setup

Part of #895.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Nov 26, 2026
@Jammy2211
Jammy2211 merged commit e318465 into main Nov 26, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/likelihood-lifecycle-r6d-prerelease-fixes branch November 26, 2026 12:39
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.

fix: R6 pre-release — JAX weak visualization (#614) and mixed factor graphs under setup="auto"

1 participant