seperman / deepdiff

DeepDiff: Deep Difference and search of any Python object/data. DeepHash: Hash of any object based on its contents. Delta: Use deltas to reconstruct objects by adding deltas together.
http://zepworks.com
Other
2.01k stars 221 forks source link

Numpy >= 2.0 issue #495

Open prav2019 opened 4 days ago

prav2019 commented 4 days ago

Please checkout the F.A.Q page before creating a bug ticket to make sure it is not already addressed.

Describe the bug deepdiff breaks if there is numpy 2.0 and above

To Reproduce Install numpy >=2.0 and try deepdiff

Expected behavior Should not throw error with numpy 2 and above

OS, DeepDiff version and Python version (please complete the following information):

Additional context Stack trace: import DeepDiff File "/usr/local/lib/python3.12/site-packages/deepdiff/init.py", line 10, in from .diff import DeepDiff File "/usr/local/lib/python3.12/site-packages/deepdiff/diff.py", line 16, in from deepdiff.helper import (strings, bytes_type, numbers, uuids, times, ListItemRemovedOrAdded, notpresent, File "/usr/local/lib/python3.12/site-packages/deepdiff/helper.py", line 60, in npfloat = np.float ^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/numpy/init.py", line 400, in getattr raise AttributeError( AttributeError: `np.floatwas removed in the NumPy 2.0 release. Usenp.float64` instead.

seperman commented 4 days ago

@prav2019 What is your Numpy version? We are using Numpy 2 when running tests: https://github.com/seperman/deepdiff/blob/master/requirements-dev.txt#L7