Beta prior prob method fails on pandas objects
I got the following error using the Beta
prior when evaluating the prior after the run finished.
File "/Users/ctal0001/modules/bilby/bilby/core/prior.py", line 2175, in ln_prob
if np.isfinite(_ln_prob) and val >= self.minimum and val <= self.maximum:
File "/Users/ctal0001/anaconda2/envs/psd_model/lib/python3.7/site-packages/pandas/core/generic.py", line 1478, in __nonzero__
.format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I think the problem is https://git.ligo.org/lscsoft/bilby/blob/master/bilby/core/prior.py#L2127. In most other places we test whether the argument is a float
/int
, however, this explicitly looks for a np.ndarray
. I would suggest that we flip the order of the if
statement to align with the other cases.