-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
use numpys SupportsDtype #7521
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
use numpys SupportsDtype #7521
Conversation
@Illviljan I was away for quite some time, do you have an idea what is wrong with mypy-3.9? |
I don't get the error. Distributed has a py.typed file https://github.com/dask/distributed/blob/main/distributed/py.typed @TomNicholas added py.typed to package data, xarray-contrib/datatree@927749a
|
I vaguely remember seeing this error before, but no idea how it got fixed. |
Yeah looks like an old version. py.typed was around september so it makes sense that part. |
Is it some caching issue, since this PR has been lying around for some time? |
Thanks @headtr1ck Do you know if there's a plan to make something like this public on the numpy end? |
No idea, the static typing of numpy is still changing a lot and has many bugs (same with xarray, haha). I'm sure they will make it public is we request it. |
Ugh I think I clicked merge too early. Shall we just keep it on our end till it become public? I defer to your judgement here. |
I have opened numpy/numpy#23308 It should be an easy change on numpys side if they decide to go for it. |
* main: Preserve `base` and `loffset` arguments in `resample` (pydata#7444) ignore the `pkg_resources` deprecation warning (pydata#7594) Update contains_cftime_datetimes to avoid loading entire variable array (pydata#7494) Support first, last with dask arrays (pydata#7562) update the docs environment (pydata#7442) Add xCDAT to list of Xarray related projects (pydata#7579) [pre-commit.ci] pre-commit autoupdate (pydata#7565) fix nczarr when libnetcdf>4.8.1 (pydata#7575) use numpys SupportsDtype (pydata#7521)
It seems that numpy is somewhat against this change, so maybe we are better off to restore the previous state to not have a mess with supporting different numpy versions again. |
I guess we should revert this change and use our own definition as proposed by the numpy defs. |
I don't know how I feel about using private numpy classes that might change anytime.
Maybe within a if TYPE_CHECKING block it is not too bad?