From 039f562ce33627e51c40390bc409121ae04a795d Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 9 Apr 2026 10:21:42 +0100 Subject: [PATCH] Remove UltraNest and PySwarms config blocks and references Co-Authored-By: Claude Opus 4.6 --- config/non_linear/mle.yaml | 43 ---------------- config/non_linear/nest.yaml | 49 ------------------- scripts/features/config/non_linear/nest.yaml | 44 ----------------- .../features/config/non_linear/optimize.yaml | 36 -------------- scripts/features/config/visualize.yaml | 9 ---- scripts/searches/LBFGS.py | 2 +- 6 files changed, 1 insertion(+), 182 deletions(-) diff --git a/config/non_linear/mle.yaml b/config/non_linear/mle.yaml index 365b911..25c0be5 100644 --- a/config/non_linear/mle.yaml +++ b/config/non_linear/mle.yaml @@ -2,53 +2,10 @@ # **PyAutoFit** supports the following maximum likelihood estimator (MLE) algorithms: -# - PySwarms: https://github.com/ljvmiranda921/pyswarms / https://pyswarms.readthedocs.io/en/latest/index.html # 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. -PySwarmsGlobal: - run: - iters: 2000 - search: - cognitive: 0.5 - ftol: -.inf - inertia: 0.9 - n_particles: 50 - social: 0.3 - 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). -PySwarmsLocal: - run: - iters: 2000 - search: - cognitive: 0.5 - ftol: -.inf - inertia: 0.9 - minkowski_p_norm: 2 - n_particles: 50 - number_of_k_neighbors: 3 - social: 0.3 - 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). LBFGS: search: tol: null diff --git a/config/non_linear/nest.yaml b/config/non_linear/nest.yaml index c113fb3..bbbef54 100644 --- a/config/non_linear/nest.yaml +++ b/config/non_linear/nest.yaml @@ -4,7 +4,6 @@ # - Dynesty: https://github.com/joshspeagle/dynesty / https://dynesty.readthedocs.io/en/latest/index.html # - Nautilus https://https://github.com/johannesulf/nautilus / https://nautilus-sampler.readthedocs.io/en/stable/index.html -# - UltraNest: https://github.com/JohannesBuchner/UltraNest / https://johannesbuchner.github.io/UltraNest/readme.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. @@ -95,51 +94,3 @@ Nautilus: printing: silence: false # If True, the default print output of the non-linear search is silenced and not printed by the Python interpreter. -UltraNest: - search: - draw_multiple: true - ndraw_max: 65536 - ndraw_min: 128 - num_bootstraps: 30 - num_test_samples: 2 - resume: true - run_num: null - storage_backend: hdf5 - vectorized: false - warmstart_max_tau: -1.0 - run: - cluster_num_live_points: 40 - dkl: 0.5 - dlogz: 0.5 - frac_remain: 0.01 - insertion_test_window: 10 - insertion_test_zscore_threshold: 2 - lepsilon: 0.001 - log_interval: null - max_iters: null - max_ncalls: null - max_num_improvement_loops: -1.0 - min_ess: 400 - min_num_live_points: 400 - show_status: true - update_interval_ncall: null - update_interval_volume_fraction: 0.8 - viz_callback: auto - stepsampler: - adaptive_nsteps: false - log: false - max_nsteps: 1000 - nsteps: 25 - region_filter: false - scale: 1.0 - stepsampler_cls: 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. - 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/scripts/features/config/non_linear/nest.yaml b/scripts/features/config/non_linear/nest.yaml index 835128d..e5bf284 100644 --- a/scripts/features/config/non_linear/nest.yaml +++ b/scripts/features/config/non_linear/nest.yaml @@ -55,47 +55,3 @@ DynestyDynamic: force_x1_cpu: false printing: silence: false -UltraNest: - search: - draw_multiple: true - ndraw_max: 65536 - ndraw_min: 128 - num_bootstraps: 30 - num_test_samples: 2 - resume: true - run_num: null - storage_backend: hdf5 - vectorized: false - warmstart_max_tau: -1.0 - run: - cluster_num_live_points: 40 - dkl: 0.5 - dlogz: 0.5 - frac_remain: 0.01 - insertion_test_window: 10 - insertion_test_zscore_threshold: 2 - lepsilon: 0.001 - log_interval: null - max_iters: null - max_ncalls: null - max_num_improvement_loops: -1.0 - min_ess: 400 - min_num_live_points: 400 - show_status: true - update_interval_ncall: null - update_interval_volume_fraction: 0.8 - viz_callback: auto - stepsampler: - adaptive_nsteps: false - log: false - max_nsteps: 1000 - nsteps: 25 - region_filter: false - scale: 1.0 - stepsampler_cls: null - initialize: - method: prior - parallel: - number_of_cores: 1 - printing: - silence: false diff --git a/scripts/features/config/non_linear/optimize.yaml b/scripts/features/config/non_linear/optimize.yaml index ed6576a..fd67715 100644 --- a/scripts/features/config/non_linear/optimize.yaml +++ b/scripts/features/config/non_linear/optimize.yaml @@ -1,39 +1,3 @@ -PySwarmsGlobal: - run: - iters: 2000 - search: - cognitive: 0.5 - ftol: -.inf - inertia: 0.9 - n_particles: 50 - social: 0.3 - initialize: - method: ball - ball_lower_limit: 0.49 - ball_upper_limit: 0.51 - parallel: - number_of_cores: 1 - printing: - silence: false -PySwarmsLocal: - run: - iters: 2000 - search: - cognitive: 0.5 - ftol: -.inf - inertia: 0.9 - minkowski_p_norm: 2 - n_particles: 50 - number_of_k_neighbors: 3 - social: 0.3 - initialize: - method: ball - ball_lower_limit: 0.49 - ball_upper_limit: 0.51 - parallel: - number_of_cores: 1 - printing: - silence: false LBFGS: search: tol: null diff --git a/scripts/features/config/visualize.yaml b/scripts/features/config/visualize.yaml index 8455afe..6ff01ed 100644 --- a/scripts/features/config/visualize.yaml +++ b/scripts/features/config/visualize.yaml @@ -12,15 +12,6 @@ plots_search: likelihood_series: true time_series: true trajectories: true - pyswarms: - contour: true - cost_history: true - time_series: true - trajectories: true - ultranest: - corner: true - runplot: true - traceplot: true zeus: corner: true likelihood_series: true diff --git a/scripts/searches/LBFGS.py b/scripts/searches/LBFGS.py index 4ef07dd..4374d3d 100644 --- a/scripts/searches/LBFGS.py +++ b/scripts/searches/LBFGS.py @@ -120,7 +120,7 @@ capsize=2, ) plt.plot(range(data.shape[0]), model_data, color="r") -plt.title("PySwarmsLocal model fit to 1D Gaussian dataset.") +plt.title("LBFGS model fit to 1D Gaussian dataset.") plt.xlabel("x values of profile") plt.ylabel("Profile normalization") plt.show()