Skip to content

numpy 2.0 compatibility #26

@xylar

Description

@xylar

There has been a change in numpy as of 2.0 that affects the behavior of np.unique:
https://numpy.org/doc/stable/release/2.0.0-notes.html#np-unique-return-inverse-shape-for-multi-dimensional-inputs

This seems to affect:

if (edge.size != 0):
__, efwd, erev = np.unique(
np.sort(edge, axis=+1),
return_index=True,
return_inverse=True, axis=0)
edge = edge[efwd, :]
if (quad.size != 0):
__, qfwd, qrev = np.unique(
np.sort(quad, axis=+1),
return_index=True,
return_inverse=True, axis=0)
quad = quad[qfwd, :]
if (hexa.size != 0):
__, hfwd, hrev = np.unique(
np.sort(hexa, axis=+1),
return_index=True,
return_inverse=True, axis=0)
hexa = hexa[hfwd, :]

I will submit a PR to hopefully address this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions