Repository navigation
refactor: search hygiene and dead code (search-extensibility A0b) - #1672
Merged
Merged
Conversation
…card/thin) and dedupe log_process_state - Delete NonLinearSearch.make_sneakier_pool and the now-orphaned SneakierPool with its FunctionCache helpers. - Delete the unread NonLinearSearch.iterations attribute (the updater owns the count). - Delete the unused discard/thin/chain computation in Zeus._fit. - Keep one log_process_state, a module function in updater.py used by both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ns_per_full_update - Drawer guards its timer (None under NullPaths) and builds samples from the search_internal argument when given, so a default-paths fit completes. - Nautilus call_search computes the effective update interval locally and passes it to iterations_from instead of assigning to self. - AbstractNest defaults number_of_cores to 1, matching every concrete search. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- NonLinearSearch logs a WARNING naming each unknown constructor kwarg captured in self.kwargs (never raises); save_all_samples and the search.json-recorded initial_values/inplace are known. - samples_from falls back to samples.csv only on FileNotFoundError or NotImplementedError (no longer AttributeError), logging the fallback at WARNING. - plot_start_point outputs only the analysis visuals (plot_search=False): the search has no samples yet, which the AttributeError catch used to hide (an empty Emcee backend). - SettingsSearch.search_dict_for(search_cls) drops use_jax_vmap for searches whose __init__ does not accept it; search_dict keeps its shape. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ions once - SearchUpdater.update passes its converted samples to visualize, which no longer converts them a second time for plot_results. - Emcee.samples_via_internal_from computes the auto-correlation times once and shares them with the burn-in, samples_info_from and SamplesMCMC. - Unit test: every Emcee update computes the auto-correlations exactly once. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
search.json records the inverse_mass_matrix kind string ('none' by default),
which both constructors rejected. The constructors now accept the serialised
kinds: 'none' maps back to None, and 'array'/'result' (a seed whose values were
not saved) are accepted on load and raise a clear error only at fit time.
Identifiers are unchanged; the ROUND_TRIP_XFAIL strict xfails are removed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
AbstractNest described a removed auto-terminate-when-stuck feature; the base apply_test_mode claimed the base __init__ calls it, but each search calls its own. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Move-only: the tests now sit beside the other MLE search tests, matching autofit/non_linear/search/mle/. The empty optimize/ package is removed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 15, 2026
samlange04
pushed a commit
to samlange04/PyAutoFit
that referenced
this pull request
Oct 16, 2026
DynestyStatic never consumed these; since A0b (PyAutoLabs#1672) they log an unknown-keyword warning. Refs PyAutoLabs#1693 Co-Authored-By: Claude Opus 5.5 <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
Phase A0b of the search-extensibility epic (PyAutoFit#1670): dead code out of the non-linear search layer, the latent bugs survey 01 §8 named, and the two repairs the A0a(i) conformance suite carried as strict xfails. Seven commits, the test-directory move last and move-only. Shipped under the human's 2026-10-08
--autolaunch; tier judge, so merge is a human/prm.make_sneakier_pool,SneakierPooland itsFunctionCachehelpers (no users anywhere in the workspace), the unreadNonLinearSearch.iterations, Zeus's unuseddiscard/thin/chain;_log_process_stateis one module function.NullPaths(timer guard) and honours itssearch_internalargument; Nautilus no longer mutatesiterations_per_full_update;AbstractNestdefaultsnumber_of_cores=1.samples_fromfalls back only on(FileNotFoundError, NotImplementedError)and logs it.SearchUpdater.updateconverts samples once and passes them tovisualize; Emcee computes autocorrelation once per conversion (unit test counts exactly one).inverse_mass_matrixkind strings their ownsearch.jsonwrites ("none"→None;"array"/"result"load but raise at fit time with a clear message).ROUND_TRIP_XFAILdeleted; golden identifiers unchanged (BlackJAXNUTS2a6f5217…, SMC3baa494f…).AbstractNestandapply_test_modedocstrings fixed.Two things for the reviewer (the plan did not settle them; both are reversible by reverting one commit):
SettingsSearch.search_dictkeeps its shape: about 223 workspace and pipeline call sites splat it intoaf.Nautilus(...), so filteringuse_jax_vmapthere would have changed a public property. A newsearch_dict_for(search_cls)filters by signature instead. Splatting the plainsearch_dictinto a non-Nautilus search now warns aboutuse_jax_vmap; no call site does that today.samples_fromexcept exposed thatplot_start_pointasked an empty Emcee backend for samples and relied on the swallowedAttributeError. The start-point visualisation now passesplot_search=Falseand outputs only the analysis visuals; at that point there were never samples to plot, so the output set for fresh runs is unchanged.The new kwarg warning also caught real typos outside this repo, filed as a Mind follow-up:
auto_correlations_settings=in autofit_workspacesearches/mcmc.pyand workspace_testEmcee.py/Zeus.py(settings silently ignored until now),nlive=toDynestyDynamicinsearches/nest.py, anddynamic_delta/deltaintest_autofit/graphical/hierarchical/test_optimise.py.API Changes
Removed dead parallel helpers and the unread
iterationsattribute; addedSettingsSearch.search_dict_for,updater.log_process_state, and optional arguments onSearchUpdater.visualize/Emcee.samples_info_from/Nautilus.iterations_from. Behaviour: unknown search kwargs warn;AttributeErrorinsidesamples_via_internal_fromnow propagates instead of silently falling back tosamples.csv;AbstractNest.number_of_coresdefaults to 1 (wasNone). No downstream library (PyAutoLens/PyAutoGalaxy/PyAutoArray/PyAutoCTI) references any removed symbol (grep over their packages is empty).See full details below.
Test Plan
pytest test_autofit -x: 3073 passed, 2 skipped, 3 xfailed (only the threeCONFIG_MUTATION_XFAILcases, A3)unittest-nojaxemulated (meta_path finder hiding jax/jaxlib/blackjax/optax/prodigyopt):test_autofit/non_linear915 passed, 37 skipped, 3 xfailedsearches/{mcmc,nest,mle}.pyand autofit_workspace_testsearches/{Emcee,Zeus,DynestyStatic,Nautilus,LBFGS,Drawer}.pyunderPYAUTO_TEST_MODE=1: all exit 0grep -rn make_sneakier_pool autofit/empty; newtest__fit_with_default_null_pathsfails on main, passes hereFull API Changes (for automation & release notes)
Removed
NonLinearSearch.make_sneakier_pool— no callersautofit.non_linear.parallel.SneakierPool(and fromparallel/__init__),parallel/sneaky.pyFunctionCache,initializer,fitness_cache,prior_transform_cache— only used by the removed poolNonLinearSearch.iterations— never read;SearchUpdaterowns_iterationsNonLinearSearch._log_process_state,SearchUpdater._log_process_state— replaced byupdater.log_process_state()Added
autofit.non_linear.search.updater.log_process_state()SettingsSearch.search_dict_for(search_cls)— settings filtered to whatsearch_cls.__init__acceptsNonLinearSearch._known_kwargs— kwargs never reported as unknown (save_all_samples,initial_values,inplace)autofit.non_linear.search.mcmc.blackjax.chains.SERIALISED_KINDS,inverse_mass_matrix_spec_fromSearchUpdater.visualize(samples=, plot_search=),perform_visualization(plot_search=),Emcee.samples_info_from(auto_correlations=),Nautilus.iterations_from(iterations_per_full_update=)Migration
search.make_sneakier_pool(fitness)→ After: no replacement (dead path)af.SomeSearch(**settings_search.search_dict)for a non-Nautilus search → After:af.SomeSearch(**settings_search.search_dict_for(af.SomeSearch))to avoid theuse_jax_vmapwarningBlackJAXNUTS/SMCreloaded fromsearch.jsonwithinverse_mass_matrix="array"/"result"now raise at fit time naming the fix (pass the original seed)Validation checklist (--auto run — plan was not pre-approved)
release validation incomplete: no rehearsal for current sourceGenerated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code