From 344430304c2383d059d2077f20f915fed30eecf8 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Sat, 12 Mar 2022 21:45:51 +0100 Subject: [PATCH 1/3] Run pyupgrade on core/groupby --- xarray/core/groupby.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index dea8949b84f..f2beb653a21 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime import warnings from typing import Any, Callable, Hashable, Sequence, Union From aca4310de5847ce362a91abe75116eee225bde49 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:47:47 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xarray/core/groupby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index f2beb653a21..d12cb1eb19d 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -871,9 +871,9 @@ def _combine(self, applied, shortcut=False): def reduce( self, func: Callable[..., Any], - dim: Union[None, Hashable, Sequence[Hashable]] = None, + dim: None | Hashable | Sequence[Hashable] = None, *, - axis: Union[None, int, Sequence[int]] = None, + axis: None | int | Sequence[int] = None, keep_attrs: bool = None, keepdims: bool = False, shortcut: bool = True, @@ -999,9 +999,9 @@ def _combine(self, applied): def reduce( self, func: Callable[..., Any], - dim: Union[None, Hashable, Sequence[Hashable]] = None, + dim: None | Hashable | Sequence[Hashable] = None, *, - axis: Union[None, int, Sequence[int]] = None, + axis: None | int | Sequence[int] = None, keep_attrs: bool = None, keepdims: bool = False, **kwargs: Any, From a7afddce2a4ddea27beeb9ec785ff21ec5e7db2c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:52:19 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xarray/core/groupby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index d12cb1eb19d..68db14c29be 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -2,7 +2,7 @@ import datetime import warnings -from typing import Any, Callable, Hashable, Sequence, Union +from typing import Any, Callable, Hashable, Sequence import numpy as np import pandas as pd