Skip to content

Commit

Permalink
Fix to mode setter
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperMartins committed Nov 25, 2024
1 parent 2fa2bc1 commit 0cf2c7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bilby/core/prior/joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ def mode(self):

@mode.setter
def mode(self, mode):
if not np.isdtype(np.asarray(mode).dtype, "integral"):
mode = np.asarray(mode)
if not mode.dtype == int:
raise ValueError("The mode to set must have integral data type.")
if np.any(mode >= self.nmodes) or np.any(mode < 0):
raise ValueError("The value of mode cannot be higher than the number of modes or smaller than zero.")
Expand Down

0 comments on commit 0cf2c7e

Please sign in to comment.