PowerLaw prior does not check if prior minimum/maximum are valid
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-58-1f15b00eece0> in <module>()
1 grid = np.linspace(0.1, 5, 100)
----> 2 plt.plot(grid, p.prob(grid))
3 plt.xlabel('value')
4 plt.ylabel('probability')
5 plt.savefig('prior_1')
/usr/local/lib/python3.6/dist-packages/bilby/core/prior.py in prob(self, val)
1016 return np.nan_to_num(val ** self.alpha * (1 + self.alpha) /
1017 (self.maximum ** (1 + self.alpha) -
-> 1018 self.minimum ** (1 + self.alpha))) * self.is_in_prior_range(val)
1019
1020 def ln_prob(self, val):
ZeroDivisionError: 0.0 cannot be raised to a negative power
Here my self.minimum
was 0. We should catch this earlier.
Edited by Moritz Huebner