Skip to content

Commit

Permalink
Error messages (#391)
Browse files Browse the repository at this point in the history
* fixed 'mpi not installed' error message, extending 'out of range' error message

* updated corrected mpi error message
  • Loading branch information
ewanchamberlain authored Nov 29, 2024
1 parent c50acea commit 4225280
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cobaya/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def lock_error(self):
"File %s is locked by another process, you are running "
"with MPI disabled but may have more than one process. "
"Make sure that you have mpi4py installed and working."
"Note that --test should not be used with MPI.")
"Note that --test should not be used with MPI.", self.lock_file)
if mpi.get_mpi():
import mpi4py # pylint: disable=import-outside-toplevel
else:
Expand Down
10 changes: 5 additions & 5 deletions cobaya/theories/camb/camb.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,13 +881,13 @@ def set(self, params_values_dict, state):
self._base_params = params
args.update(self._reduced_extra_args)
return self.camb.set_params(self._base_params.copy(), **args)
except self.camb.baseconfig.CAMBParamRangeError:
except self.camb.baseconfig.CAMBParamRangeError as e:
if self.stop_at_error:
raise LoggedError(self.log, "Out of bound parameters: %r",
params_values_dict)
raise LoggedError(self.log, "%s\nOut of bound parameters: %r",
e, params_values_dict)
else:
self.log.debug("Out of bounds parameters. "
"Assigning 0 likelihood and going on.")
self.log.debug("%s;\n Out of bounds parameters. "
"Assigning 0 likelihood and going on.", e)
except (self.camb.baseconfig.CAMBValueError, self.camb.baseconfig.CAMBError) as e:
if self.stop_at_error:
self.log.error(
Expand Down

0 comments on commit 4225280

Please sign in to comment.