-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
mypy 1.10.0 fails with matplotlib wrappers #9155
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Is the error still present on a recent version of xarray? |
Before, I only read through the latest code and didn't find any relevant changes. I just had time to test the latest version, but the issue still persists. |
OK. Mypy does pass — so if you find a mypy error in the current version then that's news, we'd like to understand that. We do have a pyright job in CI, but it doesn't pass and so the check is allowed to fail. We're definitely open to contributions that improve it, and probably we'd be happy to turn on the check if we could get everything to pass. Though it's not feasible to have an open issue for every pyright error so we can close this unless there's more info; hope that's reasonable. |
mypy also get this errorAs @erictraut points out here, mypy wil generate the same error. It's reasonable if you choose to close this issue.
Version information
|
I can't get this to fail locally, so adding a test to assess what's going on. Alos excludes matplotlib from type exclusions
Thanks for the example and mypy output. I see now — it's that our mypy version in CI is a bit out of date, and it does indeed raise an error with the newer mypy 1.10.0. Thanks for helping debug it. I'll adjust the title of the issue if that's OK |
I (edit: can't) immediately see what's going on, so I'll have to leave it for the moment. (If anyone wants to dive in, that would be great). Thanks for finding it @singledoggy |
* Add test for #9155 I can't get this to fail locally, so adding a test to assess what's going on. Alos excludes matplotlib from type exclusions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Just ran into the same problem. Also when running mypy on xarray codebase (-> 70 errors) |
Looks like python/mypy#17166 |
* main: promote floating-point numeric datetimes to 64-bit before decoding (pydata#9182) also pin `numpy` in the all-but-dask CI (pydata#9184) temporarily remove `pydap` from CI (pydata#9183) temporarily pin `numpy<2` (pydata#9181) Change np.core.defchararray to np.char (pydata#9165) (pydata#9166) Fix example code formatting for CachingFileManager (pydata#9178) Slightly improve DataTree repr (pydata#9064) switch to unit `"D"` (pydata#9170) Docs: Add page with figure for navigating help resources (pydata#9147) Add test for pydata#9155 (pydata#9161) Remove mypy exclusions for a couple more libraries (pydata#9160) Include numbagg in type checks (pydata#9159) Improve zarr chunks docs (pydata#9140)
* main: (48 commits) Add test for #9155 (#9161) Remove mypy exclusions for a couple more libraries (#9160) Include numbagg in type checks (#9159) Improve zarr chunks docs (#9140) groupby: remove some internal use of IndexVariable (#9123) Improve `to_zarr` docs (#9139) Split out distributed writes in zarr docs (#9132) Update zendoo badge link (#9133) Support duplicate dimensions in `.chunk` (#9099) Bump the actions group with 2 updates (#9130) adjust repr tests to account for different platforms (#9127) (#9128) Grouper refactor (#9122) Update docstring in api.py for open_mfdataset(), clarifying "chunks" argument (#9121) Add test for rechunking to a size string (#9117) Move Sphinx directives out of `See also` (#8466) new whats-new section (#9115) release v2024.06.0 (#9113) release notes for 2024.06.0 (#9092) [skip-ci] Try fixing hypothesis CI trigger (#9112) Undo custom padding-top. (#9107) ...
I think this is mostly covered now — we have ignores, we can wait for the mypy upstream issue before removing. |
What is your issue?
Pyright
is a full-featured, standards-based static type checker for Python, recently I tried it with xarray and get an error.And
mypy
generates the same error.So I wonder if we can fix this error, although this error won't have any impacts except for static type checker errors.
Originally posted by @singledoggy in #9150
The text was updated successfully, but these errors were encountered: