diff --git a/autofit/non_linear/search/mcmc/zeus/search.py b/autofit/non_linear/search/mcmc/zeus/search.py index d8332fe87..32e63242e 100644 --- a/autofit/non_linear/search/mcmc/zeus/search.py +++ b/autofit/non_linear/search/mcmc/zeus/search.py @@ -1,3 +1,4 @@ +import logging from typing import Dict, Optional import numpy as np @@ -292,6 +293,22 @@ def samples_via_internal_from(self, model, search_internal=None): discard=discard, thin=thin, flat=True ) + if len(samples_after_burn_in) == 0: + + logging.info( + """ + After thinnng the Zeus samples in order to remove burn-in, no samples were left. + + To create a samples object containing samples, so that the code can continue and results + can be inspected, the full list of samples before removing burn-in has been used. This may + indicate that the sampler has not converged and therefore your results may not be reliable. + + To fix this, run Zeus with more steps to ensure convergence is achieved or change the auto + correlation settings to be less aggressive in thinning samples. + """ + ) + + samples_after_burn_in = search_internal.get_chain(flat=True) parameter_lists = samples_after_burn_in.tolist() log_posterior_list = search_internal.get_log_prob(flat=True).tolist()