(self)
| 899 | season_tuples: Mapping[str, Sequence[int]] = field(init=False, repr=False) |
| 900 | |
| 901 | def __post_init__(self): |
| 902 | self.season_inds = season_to_month_tuple(self.seasons) |
| 903 | all_inds = functools.reduce(operator.add, self.season_inds) |
| 904 | if len(all_inds) > len(set(all_inds)): |
| 905 | raise ValueError( |
| 906 | f"Overlapping seasons are not allowed. Received {self.seasons!r}" |
| 907 | ) |
| 908 | self.season_tuples = dict(zip(self.seasons, self.season_inds, strict=True)) |
| 909 | |
| 910 | if not is_sorted_periodic(list(itertools.chain(*self.season_inds))): |
| 911 | raise ValueError( |
| 912 | "Resampling is only supported with sorted seasons. " |
| 913 | f"Provided seasons {self.seasons!r} are not sorted." |
| 914 | ) |
| 915 | |
| 916 | def factorize(self, group: T_Group) -> EncodedGroups: |
| 917 | if group.ndim != 1: |
nothing calls this directly
no test coverage detected