Skip to content

Commit

Permalink
test if these needed
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Nov 4, 2024
1 parent 4f3cd39 commit 25dde66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions cobaya/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def run(info_or_yaml_or_file: Union[InputDict, str, os.PathLike],
# as early as possible, e.g. to check if resuming possible or `force` needed.
if no_mpi or test:
mpi.set_mpi_disabled()
mpi.sync_processes()
with mpi.ProcessState("run"):
flags = {packages_path_input: packages_path, "debug": debug,
"stop_at_error": stop_at_error, "resume": resume, "force": force,
Expand Down
6 changes: 3 additions & 3 deletions cobaya/samplers/mcmc/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def n_fast(self):
"""Number of parameters which are considered fast, in binary fast/slow splits."""
return len(self.fast_params)

def get_acceptance_rate(self, first=0, last=None):
def get_acceptance_rate(self, first=0, last=None) -> np.floating:
"""
Computes the current acceptance rate, optionally only for ``[first:last]``
subchain.
Expand Down Expand Up @@ -698,12 +698,12 @@ def check_convergence_and_learn_proposal(self):
acceptance_rate = (np.average(acceptance_rates, weights=Ns)
if acceptance_rates is not None else acceptance_rate)
if self.oversample_thin > 1:
weights_multi_str = (" = 1/avg(%r)" % list(acceptance_rates)
weights_multi_str = (" = 1/avg(%r)" % acceptance_rates.tolist()
if acceptance_rates is not None else "")
self.log.info(" - Average thinned weight: %.3f%s", 1 / acceptance_rate,
weights_multi_str)
else:
accpt_multi_str = (" = avg(%r)" % list(acceptance_rates)
accpt_multi_str = (" = avg(%r)" % acceptance_rates.tolist()
if acceptance_rates is not None else "")
self.log.info(" - Acceptance rate: %.3f%s", acceptance_rate,
accpt_multi_str)
Expand Down

0 comments on commit 25dde66

Please sign in to comment.