21cmfast/21CMMC

[Feature Req.] Ability to choose which 21cmFAST errors to abort with.

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

At the moment, if a ParameterError occurs during running 21cmFAST, it will be ignored and the chain will continue, setting that set of parameters to have likelihood of -inf. As @BradGreig has pointed out, this can be dangerous because these parameters might affect the final chains.

Describe the solution you'd like
We should make it option whether to exit on these errors. The default should be to exit.

Two extra features that go along with this that we might consider:

  1. We could count the number of times one of these errors occurs, and exit after a certain threshold number. Thus we could ignore a few bad parameter choices on the edge of the distribution, but if it keeps happening, assume something is really going wrong.
  2. We could be a little more granular in the way we catch the errors, and let the user decide exactly which exception classes are ignored. At the moment, anything that is a subclass of ParameterError is let through. However, we could let the user specify subclasses of ParameterError (see 21cmfast/21cmFAST#219) that would trigger exits/ignoring.