Skip to content

Commit 5786963

Browse files
committed
Fix np.unique() calls for numpy 2.0
Numpy now returns a 2D array for reverse indexing, but we want the flattened version.
1 parent d9d70e6 commit 5786963

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

jigsawpy/bisect.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ def bisect(mesh):
208208
return_index=True,
209209
return_inverse=True, axis=0)
210210

211+
# for numpy 2.x compatibility
212+
erev = erev.ravel()
213+
211214
edge = edge[efwd, :]
212215

213216
if (quad.size != 0):
@@ -216,6 +219,9 @@ def bisect(mesh):
216219
return_index=True,
217220
return_inverse=True, axis=0)
218221

222+
# for numpy 2.x compatibility
223+
qrev = qrev.ravel()
224+
219225
quad = quad[qfwd, :]
220226

221227
if (hexa.size != 0):
@@ -224,6 +230,9 @@ def bisect(mesh):
224230
return_index=True,
225231
return_inverse=True, axis=0)
226232

233+
# for numpy 2.x compatibility
234+
hrev = hrev.ravel()
235+
227236
hexa = hexa[hfwd, :]
228237

229238
#------------------------------ map unique joins to elements

0 commit comments

Comments
 (0)