Skip to content

MAINT: fixes for numpy>=2

Colm Talbot requested to merge numpy-v2 into master

Numpy is preparing to release version 2 which makes a number of backwards incompatible changes. This MR fixes the small number of issues we had following the migration guide.

(o4-pe-review) [colm.talbot@ldas-pcdev2:~/modules/o4-pe-review/bilby] [master $=] [Mon May 13, 08:23:14]
$ ruff bilby --select NPY201
warning: `ruff <path>` is deprecated. Use `ruff check <path>` instead.
bilby/core/utils/io.py:267:27: NPY201 [*] `np.float_` will be removed in NumPy 2.0. Use `numpy.float64` instead.
bilby/core/utils/io.py:269:27: NPY201 [*] `np.complex_` will be removed in NumPy 2.0. Use `numpy.complex128` instead.
bilby/gw/prior.py:1439:22: NPY201 [*] `np.row_stack` will be removed in NumPy 2.0. Use `numpy.vstack` instead.
Found 3 errors.
[*] 3 fixable with the `--fix` option.
(o4-pe-review) [colm.talbot@ldas-pcdev2:~/modules/o4-pe-review/bilby] [master $=] [Mon May 13, 08:23:27]
$ ruff bilby --select NPY201 --fix
warning: `ruff <path>` is deprecated. Use `ruff check <path>` instead.
Found 3 errors (3 fixed, 0 remaining).

Merge request reports