soft-matter / trackpy

Python particle tracking toolkit
http://soft-matter.github.io/trackpy
Other
454 stars 132 forks source link

Trackpy incompatible with Numpy 2.0 #768

Open SiFroehl opened 4 months ago

SiFroehl commented 4 months ago

Trackpy internally uses np.Inf which was removed in numpy version 2.0.0 (should use np.inf instead) leading in an error in multiple trackpy functions (such as link). To replicate, install numpy 2.0.0 (newest version as of now) and trackpy 0.6.3 (newest version as of now), import both and call trackpy.link

erikamoore commented 4 months ago

I had the same issue. Here is how I fixed it: Uninstall numpy. Then, run pip install numpy==1.26.0. Hope that helps.

nkeim commented 4 months ago

Thanks. The fix within the trackpy code is straightforward; you can see it in #770 and it will go in the next release. However, trackpy optionally uses PyTables to store data in files, and the PyTables team is still working on compatibility: https://github.com/PyTables/PyTables/issues/1172 . So, even once #770 is merged, I recommend sticking with numpy 1, unless you are certain you will not use trackpy's storage features. That means one of

nkeim commented 4 months ago

Version 0.6.4 is now available via pip install trackpy and should be on conda-forge by July 15. I'm leaving this issue open until PyTables is updated.