Skip to content

Commit

Permalink
Refactoring GroupBy
Browse files Browse the repository at this point in the history
1. Simplify ResolvedGrouper by moving logic to EncodedGroups
2. Stack outside ResolvedGrouper in GroupBy.__init__ to prepare for
   multi-variable GroupBy
  • Loading branch information
dcherian committed Aug 21, 2024
1 parent 3107484 commit 5b40ae3
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 162 deletions.
2 changes: 1 addition & 1 deletion xarray/core/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def _construct_direct(
return obj

@classmethod
def from_pandas_multiindex(cls, midx: pd.MultiIndex, dim: str) -> Self:
def from_pandas_multiindex(cls, midx: pd.MultiIndex, dim: Hashable) -> Self:
"""Wrap a pandas multi-index as Xarray coordinates (dimension + levels).
The returned coordinates can be directly assigned to a
Expand Down
Loading

0 comments on commit 5b40ae3

Please sign in to comment.