Skip to content

feat: shared_analysis_state feature example for FactorGraphModel shared state#69

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/analysis-shared-state
Jun 7, 2026
Merged

feat: shared_analysis_state feature example for FactorGraphModel shared state#69
Jammy2211 merged 1 commit into
mainfrom
feature/analysis-shared-state

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Adds a feature example demonstrating the FactorGraphModel cross-factor shared-state mechanism (PyAutoFit #1308) on the 1D Gaussian toy. When the entire model is shared across a graph's factors the model data is identical for every factor, so the example opts into share_model_data=True and the model data is computed once per likelihood evaluation and reused, instead of being rebuilt by each factor. This is the 1D analog of the lensing datacube that motivated the feature.

Scripts Changed

  • scripts/features/shared_analysis_state.py — new feature tutorial: builds a fully-shared 3-Gaussian factor graph, opts into Analysis.share_model_data / shared_state_from, and explains when sharing is valid (contrasting with graphical_models.py, which shares only centre).
  • scripts/features/README.md — added an entry for the new example.

Upstream PR

PyAutoLabs/PyAutoFit#1308

Test Plan

  • Tutorial runs end-to-end under PYAUTO_TEST_MODE=1

🤖 Generated with Claude Code

…ed state

Add a feature tutorial demonstrating the cross-factor shared-state mechanism
(PyAutoFit #1308) on the 1D Gaussian toy, plus a features/README.md entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jun 1, 2026
@Jammy2211 Jammy2211 merged commit 4c4f33d into main Jun 7, 2026
6 checks passed
@Jammy2211 Jammy2211 deleted the feature/analysis-shared-state branch June 7, 2026 20:07
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