Skip to content

Commit

Permalink
MAINT: Small NumPy 2 related fixes
Browse files Browse the repository at this point in the history
This applys some smaller NumPy 2 related fixes.  With (in progress)
cupy 13.2 fixups, the single gpu test suite seems to be doing fine
(not quite finished, I may push more commits, but can also open a new PR).

The one thinig I noticed that is a bit anonying is that hdbscan is not
yet released for NumPy 2, is that actually still required since I think
sklearn has a version?
(I don't expect this to be a problem for long, but there is at least one odd test
failure trying to make hdbscan work in scikit-learn-contrib/hdbscan#644)
  • Loading branch information
seberg committed Jul 18, 2024
1 parent 99b20f6 commit dea0c57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/cuml/cuml/_thirdparty/sklearn/utils/sparsefuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _sparse_min_or_max(X, axis, min_or_max):
if np.isnan(m):
if 'nan' in min_or_max:
m = 0
elif X.nnz != cpu_np.product(X.shape):
elif X.nnz != cpu_np.prod(X.shape):
if 'min' in min_or_max:
m = m if m <= 0 else 0
else:
Expand Down
3 changes: 3 additions & 0 deletions python/cuml/cuml/internals/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,9 @@ def from_input(
)

make_copy = force_contiguous and not arr.is_contiguous
if not make_copy:
# NumPy now interprets False as never copy, so must use None
make_copy = None

if (
not fail_on_order and order != arr.order and order != "K"
Expand Down

0 comments on commit dea0c57

Please sign in to comment.