Add another exception to catch in `plot_with_data`
Currently, the plot_with_data
function tries to check if results.posterior.log_likelihood
exists using np.isnan
within a try...except...
block, for which the exception only catches AttributeError
s. If using, for example, the emcee sampler the results.posterior.log_likelihood
values in the pandas DataFrame default to being filled with None
-types, as the log_likelihood
values are not set. When these are tested using np.isnan
it results in a TypeError
, which is not caught by the except
block and the function does not work. This MR allows the except
to also catch a TypeError
.
It would be good to set the log_likelihood
values if using emcee
from the lnprobability
values that it can return (but that's for another issue...)