From 1e21e3e8c1839d099078f92574c41164c2ed27ad Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Fri, 10 Jan 2025 11:49:57 -0700 Subject: [PATCH] convert back to int --- py/desiutil/bitmask.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/desiutil/bitmask.py b/py/desiutil/bitmask.py index 200c9f3..85637e5 100644 --- a/py/desiutil/bitmask.py +++ b/py/desiutil/bitmask.py @@ -246,6 +246,9 @@ def names(self, mask=None): raise ValueError('Unknown type or invalid shape for mask!') if mask < 0: mask = np.int64(mask).astype(np.uint64) + # For Numpy < 2, the operation (int & np.uint64) was not defined. + # For Numpy >= 2, this operation should be harmless. + mask = int(mask) bitnum = 0 while 2**bitnum <= mask: if (2**bitnum & mask):