Skip to content

fix: mixed-dataset factor graphs crash combined visualization - #587

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/weak-strong-lensing
Jul 9, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/weak-strong-lensing

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

The first mixed-dataset FactorGraphModel (AnalysisImaging + AnalysisWeak, built by the weak series' combined strong+weak example) crashed during on-the-fly visualization: PyAutoFit routes every factor's analysis into the lead factor's Visualizer.visualize_combined, and the imaging/interferometer implementations assumed all analyses were their own type (AttributeError: 'FitWeak' object has no attribute 'data'). Both now filter to their own Analysis type before building fits and return early (before plotter construction) when none remain; every factor still visualizes its own fit individually. Surfaced by autolens_workspace#247.

API Changes

None — internal fix to visualization behaviour under mixed factor graphs.

Test Plan

  • New regression test: VisualizerImaging.visualize_combined with only non-imaging analyses returns without touching paths.
  • Full test_autolens/ suite: 357 passed.
  • End-to-end: the combined strong+weak modeling.py joint Nautilus fit runs to completion (previously crashed at the first combined-visualization call).

Validation checklist (--auto run)

  • Effective level: supervised · scope extension recorded on autolens_workspace#247 · review human sign-off on Feature/tracer contour #247 · Heart YELLOW (acknowledged set)
  • Human: ship approved on autolens_workspace#247
  • Human: merge before the companion workspace PR

🤖 Generated with Claude Code

A mixed-dataset FactorGraphModel (e.g. AnalysisImaging + AnalysisWeak, the
weak series' combined strong+weak example) routes every factor's analysis into
the lead factor's Visualizer.visualize_combined, which previously treated all
of them as its own type (AttributeError: 'FitWeak' object has no attribute
'data'). VisualizerImaging / VisualizerInterferometer now filter to their own
Analysis type before building fits, returning early (before plotter
construction) when none remain; every factor still visualizes its own fit
individually. First mixed-type graph exercised this path.

Surfaced by the combined strong+weak example (autolens_workspace#247).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 9, 2026
@Jammy2211
Jammy2211 merged commit 21bea02 into main Jul 9, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/weak-strong-lensing branch July 9, 2026 11:43
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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.

1 participant