Deltares / xugrid

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

mapbox_earcut is broken for numpy 2.0 #264

Closed Huite closed 4 weeks ago

Huite commented 4 months 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 3 months 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.

Huite commented 1 month ago

Seems to be fixed some time ago for the feedstock.

JoerivanEngelen commented 4 weeks ago

We now build against numpy 2.0 since the commit below, so this issue can be closed.

https://github.com/Deltares/xugrid/commit/a62217d6a2063d623064e5df9cceefcb1795715d