You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove mypy exclusion for xarray.tests.test_dataarray
This commit removes test_dataarray from the mypy exclusions list and fixes
all resulting type errors:
- Add type ignores for intentional test cases that verify error handling
- Add type ignore for scipy import fallback to object
- Split test_astype_attrs to handle Variable separately from DataArray/Dataset
due to different method signatures (Variable.astype doesn't have keep_attrs)
- Add type ignores for MultiIndex.get_level_values calls where names may be None
All tests continue to pass after these changes.
Co-authored-by: Claude <[email protected]>
* Update CLAUDE.md to use [email protected] for co-authorship
This email format is more likely to be recognized by GitHub for bot/AI
co-authorship attribution.
Co-authored-by: Claude <[email protected]>
* Fix mypy unused-ignore errors
Use the established pattern of including unused-ignore in the type ignore
comments for cases where the ignore necessity varies by environment:
- scipy_.py: scipy import is optional, so ignore is unused when scipy is installed
- test_dataarray.py: pandas-stubs versions vary in their MultiIndex.names typing
Co-authored-by: Claude <[email protected]>
* Clarify comment about test_astype_attrs split
The split is required for mypy type checking, not due to API differences.
Variable, DataArray, and Dataset don't share a common base class that mypy
recognizes, so when they're in the same list, mypy infers the type as
'object', which lacks the attrs and astype methods.
Co-authored-by: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
0 commit comments