Skip to content

Commit 68580ab

Browse files
committed
Don't assume 16 bits when transforming unsigned bit arrays.
This was failing with uint8 OBJCAT extensions under NumPy 2, since the bitmask values go out of range.
1 parent feaab38 commit 68580ab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gempy/library/transform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,8 @@ def transform(self, attributes=['data'], interpolant="linear", subsample=1,
11561156
# Set up the functions to call to transform this attribute
11571157
jobs = []
11581158
if np.issubdtype(arr.dtype, np.unsignedinteger):
1159-
for j in range(0, 16):
1159+
nbits = arr.itemsize * 8
1160+
for j in range(0, nbits):
11601161
bit = 2 ** j
11611162
if bit == cval or np.sum(arr & bit) > 0:
11621163
key = ((attr,bit), output_corners)

0 commit comments

Comments
 (0)