Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy 2.0 support #1306

Merged
merged 4 commits into from Apr 8, 2024
Merged

Numpy 2.0 support #1306

merged 4 commits into from Apr 8, 2024

Conversation

Hoxbro
Copy link
Member

@Hoxbro Hoxbro commented Nov 6, 2023

Found with the latest release of ruff and this command ruff check . --preview --select=NPY201 --fix

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (09da5a0) 85.63% compared to head (5e54e2b) 85.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1306   +/-   ##
=======================================
  Coverage   85.63%   85.63%           
=======================================
  Files          51       51           
  Lines       11286    11286           
=======================================
  Hits         9665     9665           
  Misses       1621     1621           

@Hoxbro Hoxbro requested a review from jbednar November 6, 2023 13:15
@@ -779,7 +779,7 @@ def from_numpy_dtype(self, dt):
elif np.issubdtype(dt, np.timedelta64):
unit, _ = np.datetime_data(dt)
return TimeDelta(unit=unit)
elif np.issubdtype(dt, np.unicode_):
elif np.__version__[0] < "2" and np.issubdtype(dt, np.unicode_):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does numpy2 not have nay unicode dtypes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the recommendation is to use np.str_ instead, but this is checked further down, which is why I did it this way.

https://numpy.org/devdocs/numpy_2_0_migration_guide.html

@Hoxbro Hoxbro merged commit 7261610 into main Apr 8, 2024
14 checks passed
@Hoxbro Hoxbro deleted the npy2 branch April 8, 2024 16:33
@Hoxbro Hoxbro mentioned this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants