-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Numpy 2.0 support #1306
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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 |
datashader/datashape/coretypes.py
Outdated
@@ -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_): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Found with the latest release of ruff and this command
ruff check . --preview --select=NPY201 --fix