Repository navigation
searches: UltraNest and PySwarms subclass NonLinearSearch (A4 companion) - #33
Merged
Merged
Conversation
Move the developer-tier UltraNest (WEIGHTED) and PySwarms (POINT) searches off the deprecated AbstractNest / AbstractMLE family bases onto NonLinearSearch with declared posterior kinds and test_mode_budget, replacing the apply_test_mode overrides. PySwarms draws its start points from initializer_rng(self) so seed= reproduces them. Refs PyAutoLabs/PyAutoBrain#520 Co-Authored-By: Claude Fable 5.1 <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
Companion to PyAutoFit A4 (PyAutoLabs/PyAutoFit#1687, merged): the developer-tier UltraNest and PySwarms searches move off the deprecated
AbstractNest/AbstractMLEfamily bases, per the "Companion changes required" text of #1687.UltraNest(NonLinearSearch):samples_cls = SamplesNest,posterior_kind = WEIGHTED,produces_evidence = True,test_mode_budget = {"max_iters": 1, "max_ncalls": 1}, initializer viaWEIGHTED.nested_initializer_for.AbstractPySwarms(NonLinearSearch):posterior_kind = POINT,test_mode_budget = {"iters": 1}, clipper viaPOINT.clipper_for, initializer viaPOINT.initializer_for, andrng=initializer_rng(self)on its start-point draw soseed=reproduces them.is_test_mode()tails andapply_test_modeoverrides are removed (the post-init hook appliestest_mode_budget).globe.py/local.pyunchanged.This repo has no CI — the evidence is the local fit proof below.
Refs PyAutoLabs/PyAutoBrain#520 (closed by PyAutoLabs/PyAutoBrain#522)
Scripts Changed
searches/ultranest/search.py— NonLinearSearch + WEIGHTED kind + test_mode_budgetsearches/pyswarms/abstract.py— NonLinearSearch + POINT kind + test_mode_budget + seeded initializer rng (CRLF endings preserved)Upstream PR
PyAutoLabs/PyAutoFit#1687 (merged)
Witness results
searches.ultranest.search,searches.pyswarms.globe,searches.pyswarms.localimport cleanly underpython -W error::FutureWarning(on main both warn: "subclasses AbstractNest/AbstractMLE, which is deprecated").-W error::FutureWarning: PySwarmsGlobal and PySwarmsLocal FIT OK at PYAUTO_TEST_MODE=1 and =2 (budgetiters=1,ClipperNone,InitializerBall); UltraNest FIT OK at PYAUTO_TEST_MODE=2 (budgetmax_iters=1, max_ncalls=1,InitializerPrior). UltraNest at TEST_MODE=1 hitsImportError: numpy.core.multiarray failed to importfrom ultranest's compiledmlfriendsextension; main fails identically (numpy ABI of the local ultranest build, not this change).autofit_workspace_test/scripts/graphical/analytic_gaussian.pywithaf.DynestyStatic(seed=): PARITY: PASS (41/41) (18/18 + 23/23), run twice, parity tables identical.skills/sampler_pipeline/reference.mdno longer names a family base,apply_test_modeoris_test_mode.Test Plan
python -W error::FutureWarning -c "import ...")Validation checklist (--auto run — plan was not pre-approved)
pytest tests/1258 passed; autofit_workspace_test / autofit_workspace_developer have no test dir (n/a) · smoke autofit_workspace_testsmoke_tests.txt15/15 PASS on the branch (incl. graphical/analytic_gaussian.py); the six Heart workspaces are not downstream of these repos (no library change) · review CLEAN (independent review agent; every Witness claim basis-cited, UltraNest TEST_MODE=1 env caveat stated) · Heart STALE ("release validation incomplete: no rehearsal for current source")🤖 Generated with Claude Code