Skip to content

Visualizer.visualize_combined: accept quick_update kwarg - #1254

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/visualizer-combined-quick-update
May 5, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/visualizer-combined-quick-update

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

AnalysisFactor.visualize_combined forwards a quick_update keyword to the wrapped Analysis's Visualizer.visualize_combined, but the base signature on af.Visualizer.visualize_combined did not declare it. Any user Visualizer that did not override the method (or overrode it without **kwargs) crashed mid-search with:

TypeError: Visualizer.visualize_combined() got an unexpected keyword argument 'quick_update'

The crash only fires on graphical / joint-fit search paths whose periodic-update cadence calls visualize_combined with quick_update=True partway through a long Dynesty chain. Short runs that finish before the first periodic update silently dodge the bug.

Add quick_update: bool = False to the base signature and document that it is forwarded from the factor-graph dispatch so subclasses can branch on quick-update vs full-update plotting if they want. Default no-op behaviour is unchanged.

End-to-end discovered while running a real-data 20-cell-line GDSC2 graphical Hill-curve fit (scripts/cancer/graphical.py in the cosmology_and_cancer workspace), which crashed at the first periodic update. The fix unblocks workspace Visualizer overrides that follow the documented base signature.

API Changes

Tiny additive signature change on a single method. Visualizer.visualize_combined now declares quick_update: bool = False so callers may pass it (the factor-graph dispatch always does). Default no-op behaviour is preserved; subclasses that already override the method without **kwargs get unblocked. See full details below.

Test Plan

  • pytest test_autofit/analysis/test_visualizer_combined_kwargs.py — 3 new tests
  • pytest test_autofit/non_linear test_autofit/graphical test_autofit/analysis -q — 442 tests pass (no regressions)
  • End-to-end on scripts/cancer/graphical.py --sample=cancer_real__drug_1073 --total_datasets=20 (a 123-D joint Dynesty fit) — previously crashed at the first periodic update, now runs end-to-end (~2 min wall-clock).
Full API Changes (for automation & release notes)

Changed Signature

  • autofit.non_linear.analysis.visualize.Visualizer.visualize_combined(analyses, paths, instance, during_analysis, quick_update=False) — added trailing keyword argument quick_update with default False. Matches the call site in autofit.graphical.declarative.factor.analysis.AnalysisFactor.visualize_combined. Default no-op body is unchanged.

Migration

None required. Existing user Visualizer subclasses that override visualize_combined without **kwargs are now unblocked from a previously-silent crash on graphical / joint-fit search paths. Subclasses that want to branch on the quick-update path can opt in by accepting the new kwarg; otherwise the default value flows through.

🤖 Generated with Claude Code

``AnalysisFactor.visualize_combined`` forwards a ``quick_update``
keyword to the wrapped Analysis's ``Visualizer.visualize_combined``,
but the base signature on ``af.Visualizer.visualize_combined`` did not
declare it. Any user Visualizer that did not override the method (or
overrode it without ``**kwargs``) crashed mid-search with::

    TypeError: Visualizer.visualize_combined() got an unexpected
    keyword argument 'quick_update'

The crash only fired on graphical / joint-fit search paths whose
periodic-update cadence calls ``visualize_combined`` with
``quick_update=True`` partway through a long Dynesty chain. Short
runs that finished before the first periodic update silently dodged
it.

Add ``quick_update: bool = False`` to the base signature and document
that it is forwarded from the factor-graph dispatch so subclasses can
branch on quick-update vs full-update plotting if they want. Default
no-op behaviour is unchanged.

Adds three regression tests covering the signature, a direct call
with the kwarg, and an end-to-end ``AnalysisFactor.visualize_combined``
call path that previously crashed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 5, 2026
@Jammy2211
Jammy2211 merged commit 892722a into main May 5, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/visualizer-combined-quick-update branch May 5, 2026 17:42
@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