Skip to content

Grouper refactor #9122

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

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion xarray/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,8 @@ def _resample(
# TODO support non-string indexer after removing the old API.

from xarray.core.dataarray import DataArray
from xarray.core.groupby import ResolvedGrouper, TimeResampler
from xarray.core.groupby import ResolvedGrouper
from xarray.core.groupers import TimeResampler
from xarray.core.resample import RESAMPLE_DIM

# note: the second argument (now 'skipna') use to be 'dim'
Expand Down
4 changes: 2 additions & 2 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -6751,9 +6751,9 @@ def groupby(
from xarray.core.groupby import (
DataArrayGroupBy,
ResolvedGrouper,
UniqueGrouper,
_validate_groupby_squeeze,
)
from xarray.core.groupers import UniqueGrouper

_validate_groupby_squeeze(squeeze)
rgrouper = ResolvedGrouper(UniqueGrouper(), group, self)
Expand Down Expand Up @@ -6833,11 +6833,11 @@ def groupby_bins(
.. [1] http://pandas.pydata.org/pandas-docs/stable/generated/pandas.cut.html
"""
from xarray.core.groupby import (
BinGrouper,
DataArrayGroupBy,
ResolvedGrouper,
_validate_groupby_squeeze,
)
from xarray.core.groupers import BinGrouper

_validate_groupby_squeeze(squeeze)
grouper = BinGrouper(
Expand Down
4 changes: 2 additions & 2 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10301,9 +10301,9 @@ def groupby(
from xarray.core.groupby import (
DatasetGroupBy,
ResolvedGrouper,
UniqueGrouper,
_validate_groupby_squeeze,
)
from xarray.core.groupers import UniqueGrouper

_validate_groupby_squeeze(squeeze)
rgrouper = ResolvedGrouper(UniqueGrouper(), group, self)
Expand Down Expand Up @@ -10384,11 +10384,11 @@ def groupby_bins(
.. [1] http://pandas.pydata.org/pandas-docs/stable/generated/pandas.cut.html
"""
from xarray.core.groupby import (
BinGrouper,
DatasetGroupBy,
ResolvedGrouper,
_validate_groupby_squeeze,
)
from xarray.core.groupers import BinGrouper

_validate_groupby_squeeze(squeeze)
grouper = BinGrouper(
Expand Down
Loading
Loading