Skip to content

Commit

Permalink
fix: numpy 2.0 compatybility (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki authored Jul 16, 2024
1 parent 3b2171f commit f91e0c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mahotas/features/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def haralick(f,
nr_dirs = len(_3d_deltas)
else:
raise ValueError('mahotas.texture.haralick: Can only handle 2D and 3D images.')
fm1 = f.max() + 1
fm1 = int(f.max()) + 1
cmat = np.empty((fm1, fm1), np.int32)
def all_cmatrices():
for dir in range(nr_dirs):
Expand Down
1 change: 1 addition & 0 deletions mahotas/tests/test_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def test_4d_image():
def rand_haralick():
f = 255*np.random.random((128,128))
f = f.astype(np.uint8)
f[0, 0] = 255
f = mh.features.haralick(f)
return f.mean(0)
def test_feature_non_zero():
Expand Down

0 comments on commit f91e0c8

Please sign in to comment.