deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

Numpy >= 2.0 issue

Open prav2019 opened this issue 1 year ago • 1 comments

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):

  • OS: Ubuntu
  • Version
  • Python Version 3.12.7
  • DeepDiff Version 8.0.1

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 np_float_ = np.float_ ^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/numpy/init.py", line 400, in getattr raise AttributeError( AttributeError: np.float_ was removed in the NumPy 2.0 release. Use np.float64 instead.

prav2019 avatar Oct 15 '24 19:10 prav2019

@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

seperman avatar Oct 15 '24 21:10 seperman

@prav2019 Since we are already running DeepDiff tests with Numpy 2, I doubt you are running the latest version of DeepDiff. In fact, np_float_ = np.float_ line that is throwing the error for you doesn't exist in DeepDiff 8.0.1

seperman avatar Oct 24 '24 18:10 seperman