Skip to content

Commit

Permalink
MAINT: fixes for numpy>=2
Browse files Browse the repository at this point in the history
  • Loading branch information
ColmTalbot committed May 13, 2024
1 parent 6c8678f commit 38b3052
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bilby/core/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ def encode_for_hdf5(key, item):

if isinstance(item, np.int_):
item = int(item)
elif isinstance(item, np.float_):
elif isinstance(item, np.float64):
item = float(item)
elif isinstance(item, np.complex_):
elif isinstance(item, np.complex128):
item = complex(item)
if isinstance(item, np.ndarray):
# Numpy's wide unicode strings are not supported by hdf5
Expand Down
2 changes: 1 addition & 1 deletion bilby/gw/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ def _rescale(self, samp, **kwargs):
self.update_distance(int(round(val)))
dist_samples[i] = self.distance_icdf(dist_samp[i])
if self.distance:
sample = np.row_stack([sample[:, 0], sample[:, 1], dist_samples])
sample = np.vstack([sample[:, 0], sample[:, 1], dist_samples])
return sample.reshape((-1, self.num_vars))

def update_distance(self, pix_idx):
Expand Down

0 comments on commit 38b3052

Please sign in to comment.