Skip to content

Commit

Permalink
Supporting NumPy 2.0 (#950)
Browse files Browse the repository at this point in the history
* added numpy-2.0 support

* Update ChangeLog.md
  • Loading branch information
qiyunzhu authored Apr 10, 2024
1 parent 9e6fa39 commit d00f947
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ biom 2.1.15-dev

Performance improvements:

* Add NumPy 2.0 support. PR [#950](https://github.com/biocore/biom-format/pull/950) ensures code compatibility with NumPy 2.0. This support is yet to be added to the CI testing matrix.
* Revise `Table._fast_merge` to use COO directly. For very large tables, this reduces runtime by ~50x and memory by ~5x. See PR [#913](https://github.com/biocore/biom-format/pull/933).
* Drastically reduce the memory needs of subsampling when sums are large. Also adds 64-bit support. See PR [#935](https://github.com/biocore/biom-format/pull/935).
* Improve handling of not-perfectly-integer inputs. See PR [#938](https://github.com/biocore/biom-format/pull/938).
Expand Down
1 change: 1 addition & 0 deletions biom/_filter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ from types import FunctionType

import numpy as np
cimport numpy as cnp
cnp.import_array()


cdef cnp.ndarray[cnp.uint8_t, ndim=1] \
Expand Down
2 changes: 2 additions & 0 deletions biom/_subsample.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import numpy as np
cimport numpy as cnp
cnp.import_array()


cdef _subsample_with_replacement(cnp.ndarray[cnp.float64_t, ndim=1] data,
cnp.ndarray[cnp.int32_t, ndim=1] indptr,
Expand Down
1 change: 1 addition & 0 deletions biom/_transform.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import numpy as np
cimport numpy as cnp
cnp.import_array()


def _transform(arr, ids, metadata, function, axis):
Expand Down

0 comments on commit d00f947

Please sign in to comment.