refactor: extract SearchUpdater class from NonLinearSearch#1207
Merged
refactor: extract SearchUpdater class from NonLinearSearch#1207
Conversation
Move perform_update and perform_visualization logic into a new SearchUpdater class (autofit/non_linear/search/updater.py), separating sample persistence, latent variable computation, visualization, profiling, and summary output into focused methods. The search class retains thin delegators for backward compatibility. Closes #1205 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract
perform_updateandperform_visualizationlogic fromNonLinearSearchinto a newSearchUpdaterclass (autofit/non_linear/search/updater.py). Each output concern — sample persistence, latent variable computation, visualization, profiling, and summary output — is now its own focused method. The search class retains thin delegators for full backward compatibility.Closes #1205. Follow-up to #1003.
API Changes
None — internal changes only. All public methods (
perform_update,perform_visualization) retain their existing signatures and behavior. No subclass call sites changed.Test Plan
pytest test_autofit -x)Full API Changes (for automation & release notes)
Added
autofit.non_linear.search.updater.SearchUpdater— new internal class (not part of public API)Internal Refactoring
NonLinearSearch.perform_update— body extracted toSearchUpdater.update(), method now delegatesNonLinearSearch.perform_visualization— body extracted toSearchUpdater.visualize(), method now delegatesNonLinearSearch._updater— new lazy property that constructsSearchUpdaterNonLinearSearch._log_process_state— duplicated intoSearchUpdater(both static, no coupling)Migration
No migration needed — no public API changes.
🤖 Generated with Claude Code