Deltares / xugrid

Xarray and unstructured grids
https://deltares.github.io/xugrid/
MIT License
61 stars 8 forks source link

mapbox_earcut is broken for numpy 2.0 #264

Open Huite opened 1 month ago

Huite commented 1 month ago

For both pypi and conda.

There's a conda-feedstock PR in progress. Since the problem seems to be resolved by rebuilding with pybind against numpy 2.0, I'm optimistic that this can be resolved relatively quickly.

However, the PR for the mapbox_earcut Python bindings to regenerate the wheels requires the original maintainer to publish the wheels on pypi. This might mean that in some time, the conda-forge bindings will work with numpy 2.0, but the pip installed one won't. We can either:

Both are not ideal, but my expectation is that most use is through conda-forge.

Another note: the optional dependency approach will just result in an import error, which one would expect to solve by simply running pip install mapbox_earcut. This will then result not in a crash, but nonsense results. So then we'd have to run a check on version numbers...

Or alternatively, with a little patience both the wheels and the conda-forge release are updated for numpy 2.0 and no effort is required.

JoerivanEngelen commented 1 month ago

Update: mapbox_earcut_python has just released an update 2 days ago, supporting numpy 2. https://github.com/skogler/mapbox_earcut_python/releases/tag/v1.0.2

When the feedstock is also merged, we can move to numpy 2.