Skip to content

Commit

Permalink
clean up reprs
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jul 1, 2024
1 parent cdee857 commit 74268ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ class ResolvedGrouper(Generic[T_DataWithCoords]):
obj: T_DataWithCoords

# returned by factorize:
codes: DataArray = field(init=False)
full_index: pd.Index = field(init=False)
group_indices: T_GroupIndices = field(init=False)
unique_coord: Variable | _DummyGroup = field(init=False)
codes: DataArray = field(init=False, repr=False)
full_index: pd.Index = field(init=False, repr=False)
group_indices: T_GroupIndices = field(init=False, repr=False)
unique_coord: Variable | _DummyGroup = field(init=False, repr=False)

# _ensure_1d:
group1d: T_Group = field(init=False)
stacked_obj: T_DataWithCoords = field(init=False)
stacked_dim: Hashable | None = field(init=False)
inserted_dims: list[Hashable] = field(init=False)
group1d: T_Group = field(init=False, repr=False)
stacked_obj: T_DataWithCoords = field(init=False, repr=False)
stacked_dim: Hashable | None = field(init=False, repr=False)
inserted_dims: list[Hashable] = field(init=False, repr=False)

def __post_init__(self) -> None:
# This copy allows the BinGrouper.factorize() method
Expand Down
6 changes: 3 additions & 3 deletions xarray/core/groupers.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Resampler(Grouper):
class UniqueGrouper(Grouper):
"""Grouper object for grouping by a categorical variable."""

_group_as_index: pd.Index | None = None
_group_as_index: pd.Index | None = field(default=None, repr=False)

@property
def is_unique_and_monotonic(self) -> bool:
Expand Down Expand Up @@ -336,8 +336,8 @@ class TimeResampler(Resampler):
loffset: datetime.timedelta | str | None = field(default=None)
base: int | None = field(default=None)

index_grouper: CFTimeGrouper | pd.Grouper = field(init=False)
group_as_index: pd.Index = field(init=False)
index_grouper: CFTimeGrouper | pd.Grouper = field(init=False, repr=False)
group_as_index: pd.Index = field(init=False, repr=False)

def __post_init__(self):
if self.loffset is not None:
Expand Down

0 comments on commit 74268ef

Please sign in to comment.