seung-lab / connected-components-3d

Connected components on discrete and continuous multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants; periodic boundaries (4, 8, & 6)
GNU Lesser General Public License v3.0
356 stars 42 forks source link

Support for Numpy 2.0 #125

Closed lorinczszabolcs closed 2 months ago

lorinczszabolcs commented 2 months ago

Hi!

Numpy 2.0 is out, and recently I received the following error:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Is numpy 2.0 support planned? Thanks in advance!

william-silversmith commented 2 months ago

Hi, I anticipate support for Numpy 2.0 coming in the near future, but I haven't looked into what that entails yet.

Usually, my libraries are compiled with oldest-supported-numpy in order to make them maximally compatible. I am not sure what 2.0 will do to backwards compatibility yet.

On Mon, Jun 17, 2024 at 5:01 AM Lőrincz-Molnár Szabolcs-Botond < @.***> wrote:

Hi!

Numpy 2.0 is out, and recently I received the following error:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2.

Is numpy 2.0 support planned? Thanks in advance!

— Reply to this email directly, view it on GitHub https://github.com/seung-lab/connected-components-3d/issues/125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATGQSN4KIUYJJM4V5D6XOTZH2QYNAVCNFSM6AAAAABJNSM5U6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2TMNZZHEYDCNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

william-silversmith commented 2 months ago

Interesting, it seems that after Numpy 1.19, they fixed this backwards compatibility issue. In that case, it's probably safe to just compile with 2.0.

https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-abi-handling

william-silversmith commented 2 months ago

Okay, the new version is uploaded! Thanks for pointing this out.