Skip to content

Commit

Permalink
Fix formatting mistakes moving mypy comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Armavica committed Sep 17, 2024
1 parent 492c0d6 commit f98980c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions xarray/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def _interpolate(self, kind="linear", **kwargs) -> T_Xarray:


# https://github.com/python/mypy/issues/9031
class DataArrayResample(
class DataArrayResample( # type: ignore[misc]
Resample["DataArray"], DataArrayGroupByBase, DataArrayResampleAggregations
): # type: ignore[misc]
):
"""DataArrayGroupBy object specialized to time resampling operations over a
specified dimension
"""
Expand Down Expand Up @@ -331,9 +331,9 @@ def asfreq(self) -> DataArray:


# https://github.com/python/mypy/issues/9031
class DatasetResample(
class DatasetResample( # type: ignore[misc]
Resample["Dataset"], DatasetGroupByBase, DatasetResampleAggregations
): # type: ignore[misc]
):
"""DatasetGroupBy object specialized to resampling a specified dimension"""

def map(
Expand Down
8 changes: 4 additions & 4 deletions xarray/namedarray/_array_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def astype(


def imag(
x: NamedArray[_ShapeType, np.dtype[_SupportsImag[_ScalarType]]],
/, # type: ignore[type-var]
x: NamedArray[_ShapeType, np.dtype[_SupportsImag[_ScalarType]]], # type: ignore[type-var]
/,
) -> NamedArray[_ShapeType, np.dtype[_ScalarType]]:
"""
Returns the imaginary component of a complex number for each element x_i of the
Expand Down Expand Up @@ -112,8 +112,8 @@ def imag(


def real(
x: NamedArray[_ShapeType, np.dtype[_SupportsReal[_ScalarType]]],
/, # type: ignore[type-var]
x: NamedArray[_ShapeType, np.dtype[_SupportsReal[_ScalarType]]], # type: ignore[type-var]
/,
) -> NamedArray[_ShapeType, np.dtype[_ScalarType]]:
"""
Returns the real component of a complex number for each element x_i of the
Expand Down
5 changes: 3 additions & 2 deletions xarray/tests/test_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def test_init_index_error(self) -> None:

with pytest.raises(TypeError, match=".* is not an `xarray.indexes.Index`"):
Coordinates(
coords={"x": ("x", [1, 2, 3])}, indexes={"x": "not_an_xarray_index"}
) # type: ignore[dict-item]
coords={"x": ("x", [1, 2, 3])},
indexes={"x": "not_an_xarray_index"}, # type: ignore[dict-item]
)

def test_init_dim_sizes_conflict(self) -> None:
with pytest.raises(ValueError):
Expand Down

0 comments on commit f98980c

Please sign in to comment.