From 4ab1f89e12558fe4aa724071810329ca55812dd2 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Sun, 12 Apr 2026 20:37:23 +0100 Subject: [PATCH] refactor: remove per-search YAML config files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These YAML files (nest.yaml, mcmc.yaml, mle.yaml) are no longer read by PyAutoFit — all search parameters now have explicit Python defaults in each search class's __init__. Keeping them would be dead config. Co-Authored-By: Claude Opus 4.6 --- config/non_linear/mcmc.yaml | 63 ------------------------- config/non_linear/mle.yaml | 45 ------------------ config/non_linear/nest.yaml | 91 ------------------------------------- 3 files changed, 199 deletions(-) delete mode 100644 config/non_linear/mcmc.yaml delete mode 100644 config/non_linear/mle.yaml delete mode 100644 config/non_linear/nest.yaml diff --git a/config/non_linear/mcmc.yaml b/config/non_linear/mcmc.yaml deleted file mode 100644 index 94459ee08..000000000 --- a/config/non_linear/mcmc.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Configuration files that customize the default behaviour of non-linear searches. - -# **PyAutoFit** supports the following MCMC algorithms: - -# - Emcee: https://github.com/dfm/emcee / https://emcee.readthedocs.io/en/stable/ -# - Zeus: https://github.com/minaskar/zeus / https://zeus-mcmc.readthedocs.io/en/latest/ - -# Settings in the [search] and [run] entries are specific to each nested algorithm and should be determined by -# consulting that MCMC method's own readthedocs. - -Emcee: - run: - nsteps: 2000 - search: - nwalkers: 50 - auto_correlations: - change_threshold: 0.01 # The threshold value by which if the change in auto_correlations is below sampling will be terminated early. - check_for_convergence: true # Whether the auto-correlation lengths of the Emcee samples are checked to determine the stopping criteria. If `True`, Emcee may stop before nsteps are performed. - check_size: 100 # The length of the samples used to check the auto-correlation lengths (from the latest sample backwards). - required_length: 50 # The length an auto_correlation chain must be for it to be used to evaluate whether its change threshold is sufficiently small to terminate sampling early. - initialize: # The method used to generate where walkers are initialized in parameter space {prior | ball}. - method: ball # priors: samples are initialized by randomly drawing from each parameter's prior. ball: samples are initialized by randomly drawing unit values from a narrow uniform distribution. - ball_lower_limit: 0.49 # The lower limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - ball_upper_limit: 0.51 # The upper limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - printing: - silence: false # If True, the default print output of the non-linear search is silcened and not printed by the Python interpreter. - iterations_per_full_update: 500 # Non-linear search iterations between every full update, which outputs all visuals and result fits (e.g. model.result, search.summary), this exits the search and can be slow. - iterations_per_quick_update: 500 # Non-linear search iterations between every quick update, which just displays the maximum likelihood model fit. - remove_state_files_at_end: true # Whether to remove the savestate of the seach (e.g. the Emcee hdf5 file) at the end to save hard-disk space (results are still stored as PyAutoFit pickles and loadable). -Zeus: - run: - check_walkers: true - light_mode: false - maxiter: 10000 - maxsteps: 10000 - mu: 1.0 - nsteps: 2000 - patience: 5 - shuffle_ensemble: true - tolerance: 0.05 - tune: true - vectorize: false - search: - nwalkers: 50 - auto_correlations: - change_threshold: 0.01 # The threshold value by which if the change in auto_correlations is below sampling will be terminated early. - check_for_convergence: true # Whether the auto-correlation lengths of the Emcee samples are checked to determine the stopping criteria. If `True`, Emcee may stop before nsteps are performed. - check_size: 100 # The length of the samples used to check the auto-correlation lengths (from the latest sample backwards). - required_length: 50 # The length an auto_correlation chain must be for it to be used to evaluate whether its change threshold is sufficiently small to terminate sampling early. - initialize: # The method used to generate where walkers are initialized in parameter space {prior | ball}. - method: ball # priors: samples are initialized by randomly drawing from each parameter's prior. ball: samples are initialized by randomly drawing unit values from a narrow uniform distribution. - ball_lower_limit: 0.49 # The lower limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - ball_upper_limit: 0.51 # The upper limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - printing: - silence: false # If True, the default print output of the non-linear search is silenced and not printed by the Python interpreter. - - iterations_per_full_update: 500 # Non-linear search iterations between every full update, which outputs all visuals and result fits (e.g. model.result, search.summary), this exits the search and can be slow. - iterations_per_quick_update: 500 # Non-linear search iterations between every quick update, which just displays the maximum likelihood model fit. - remove_state_files_at_end: true # Whether to remove the savestate of the seach (e.g. the Emcee hdf5 file) at the end to save hard-disk space (results are still stored as PyAutoFit pickles and loadable). \ No newline at end of file diff --git a/config/non_linear/mle.yaml b/config/non_linear/mle.yaml deleted file mode 100644 index 2cc331c7f..000000000 --- a/config/non_linear/mle.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Configuration files that customize the default behaviour of non-linear searches. - -# **PyAutoFit** supports the following maximum likelihood estimator (MLE) algorithms: - -# Settings in the [search], [run] and [options] entries are specific to each nested algorithm and should be -# determined by consulting that method's own readthedocs. - -LBFGS: - search: - tol: null - options: - disp: false - eps: 1.0e-08 - ftol: 2.220446049250313e-09 - gtol: 1.0e-05 - iprint: -1.0 - maxcor: 10 - maxfun: 15000 - maxiter: 15000 - maxls: 20 - initialize: # The method used to generate where walkers are initialized in parameter space {prior | ball}. - method: ball # priors: samples are initialized by randomly drawing from each parameter's prior. ball: samples are initialized by randomly drawing unit values from a narrow uniform distribution. - ball_lower_limit: 0.49 # The lower limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - ball_upper_limit: 0.51 # The upper limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - printing: - silence: false # If True, the default print output of the non-linear search is silcened and not printed by the Python interpreter. - iterations_per_full_update: 500 # Non-linear search iterations between every full update, which outputs all visuals and result fits (e.g. model.result, search.summary), this exits the search and can be slow. - iterations_per_quick_update: 500 # Non-linear search iterations between every quick update, which just displays the maximum likelihood model fit. - remove_state_files_at_end: true # Whether to remove the savestate of the seach (e.g. the Emcee hdf5 file) at the end to save hard-disk space (results are still stored as PyAutoFit pickles and loadable). -Drawer: - search: - total_draws: 50 - initialize: # The method used to generate where walkers are initialized in parameter space {prior | ball}. - method: ball # priors: samples are initialized by randomly drawing from each parameter's prior. ball: samples are initialized by randomly drawing unit values from a narrow uniform distribution. - ball_lower_limit: 0.49 # The lower limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - ball_upper_limit: 0.51 # The upper limit of the uniform distribution unit values are drawn from when initializing walkers using the ball method. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - printing: - silence: false # If True, the default print output of the non-linear search is silcened and not printed by the Python interpreter. - iterations_per_full_update: 500 # Non-linear search iterations between every full update, which outputs all visuals and result fits (e.g. model.result, search.summary), this exits the search and can be slow. - iterations_per_quick_update: 500 # Non-linear search iterations between every quick update, which just displays the maximum likelihood model fit. - remove_state_files_at_end: true # Whether to remove the savestate of the seach (e.g. the Emcee hdf5 file) at the end to save hard-disk space (results are still stored as PyAutoFit pickles and loadable). \ No newline at end of file diff --git a/config/non_linear/nest.yaml b/config/non_linear/nest.yaml deleted file mode 100644 index 141c3f565..000000000 --- a/config/non_linear/nest.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Configuration files that customize the default behaviour of non-linear searches. - -# - Nautilus https://https://github.com/johannesulf/nautilus / https://nautilus-sampler.readthedocs.io/en/stable/index.html -# - Dynesty: https://github.com/joshspeagle/dynesty / https://dynesty.readthedocs.io/en/latest/index.html -# Settings in the [search] and [run] entries are specific to each nested algorithm and should be determined by -# consulting that MCMC method's own readthedocs. -Nautilus: - search: - n_live: 200 # Number of so-called live points. New bounds are constructed so that they encompass the live points. - n_update: # The maximum number of additions to the live set before a new bound is created - enlarge_per_dim: 1.1 # Along each dimension, outer ellipsoidal bounds are enlarged by this factor. - n_points_min: # The minimum number of points each ellipsoid should have. Effectively, ellipsoids with less than twice that number will not be split further. - split_threshold: 100 # Threshold used for splitting the multi-ellipsoidal bound used for sampling. - n_networks: 4 # Number of networks used in the estimator. - n_batch: 50 # Number of likelihood evaluations that are performed at each step. If likelihood evaluations are parallelized, should be multiple of the number of parallel processes. - n_like_new_bound: # The maximum number of likelihood calls before a new bounds is created. If None, use 10 times n_live. - vectorized: false # If True, the likelihood function can receive multiple input sets at once. - seed: # Seed for random number generation used for reproducible results accross different runs. - run: - f_live: 0.01 # Maximum fraction of the evidence contained in the live set before building the initial shells terminates. - n_shell: 1 # Minimum number of points in each shell. The algorithm will sample from the shells until this is reached. Default is 1. - n_eff: 500 # Minimum effective sample size. The algorithm will sample from the shells until this is reached. Default is 10000. - n_like_max: .inf # Maximum number of likelihood evaluations. Regardless of progress, the sampler will stop if this value is reached. Default is infinity. - discard_exploration: false # Whether to discard points drawn in the exploration phase. This is required for a fully unbiased posterior and evidence estimate. - verbose: true # Whether to print information about the run. - initialize: # The method used to generate where walkers are initialized in parameter space {prior}. - method: prior # priors: samples are initialized by randomly drawing from each parameter's prior. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - force_x1_cpu: false # Force Dynesty to not use Python multiprocessing Pool, which can fix issues on certain operating systems. - printing: - silence: false # If True, the default print output of the non-linear search is silenced and not printed by the Python interpreter. -DynestyStatic: - search: - nlive: 50 - sample: rwalk - walks: 5 - bootstrap: null - bound: multi - enlarge: null - facc: 0.2 - first_update: null - fmove: 0.9 - max_move: 100 - slices: 5 - update_interval: null - run: - dlogz: null - logl_max: .inf - maxcall: null - maxiter: null - n_effective: null - initialize: # The method used to generate where walkers are initialized in parameter space {prior}. - method: prior # priors: samples are initialized by randomly drawing from each parameter's prior. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - force_x1_cpu: false # Force Dynesty to not use Python multiprocessing Pool, which can fix issues on certain operating systems. - printing: - silence: false # If True, the default print output of the non-linear search is silenced and not printed by the Python interpreter. - -DynestyDynamic: - search: - sample: rwalk - walks: 5 - bootstrap: null - bound: multi - enlarge: null - facc: 0.2 - first_update: null - fmove: 0.9 - max_move: 100 - slices: 5 - update_interval: null - run: - dlogz_init: 0.01 - logl_max_init: .inf - maxcall: null - maxcall_init: null - maxiter: null - maxiter_init: null - n_effective: .inf - n_effective_init: .inf - nlive_init: 500 - initialize: # The method used to generate where walkers are initialized in parameter space {prior}. - method: prior # priors: samples are initialized by randomly drawing from each parameter's prior. - parallel: - number_of_cores: 1 # The number of cores the search is parallelized over by default, using Python multiprocessing. - force_x1_cpu: false # Force Dynesty to not use Python multiprocessing Pool, which can fix issues on certain operating systems. - printing: - silence: false # If True, the default print output of the non-linear search is silenced and not printed by the Python interpreter. -