Skip to content

Commit 6c219b8

Browse files
committed
Types
1 parent 09f0e5a commit 6c219b8

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

flox/core.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -855,30 +855,6 @@ def factorize_(
855855
) -> tuple[np.ndarray, tuple[np.ndarray, ...], tuple[int, ...], int, int, None]: ...
856856

857857

858-
@overload
859-
def factorize_(
860-
by: T_Bys,
861-
axes: T_Axes,
862-
*,
863-
expected_groups: T_ExpectIndexOptTuple | None = None,
864-
reindex: bool = False,
865-
sort: bool = True,
866-
fastpath: Literal[False] = False,
867-
) -> tuple[np.ndarray, tuple[np.ndarray, ...], tuple[int, ...], int, int, FactorProps]: ...
868-
869-
870-
@overload
871-
def factorize_(
872-
by: T_Bys,
873-
axes: T_Axes,
874-
*,
875-
expected_groups: T_ExpectIndexOptTuple | None = None,
876-
reindex: bool = False,
877-
sort: bool = True,
878-
fastpath: bool = False,
879-
) -> tuple[np.ndarray, tuple[np.ndarray, ...], tuple[int, ...], int, int, FactorProps | None]: ...
880-
881-
882858
def _factorize_single(by, expect, *, sort: bool, reindex: bool):
883859
flat = by.reshape(-1)
884860
if isinstance(expect, pd.RangeIndex):
@@ -940,6 +916,30 @@ def _ravel_factorized(*factorized: np.ndarray, grp_shape: tuple[int, ...]) -> np
940916
return group_idx
941917

942918

919+
@overload
920+
def factorize_(
921+
by: T_Bys,
922+
axes: T_Axes,
923+
*,
924+
expected_groups: T_ExpectIndexOptTuple | None = None,
925+
reindex: bool = False,
926+
sort: bool = True,
927+
fastpath: Literal[False] = False,
928+
) -> tuple[np.ndarray, tuple[np.ndarray, ...], tuple[int, ...], int, int, FactorProps]: ...
929+
930+
931+
@overload
932+
def factorize_(
933+
by: T_Bys,
934+
axes: T_Axes,
935+
*,
936+
expected_groups: T_ExpectIndexOptTuple | None = None,
937+
reindex: bool = False,
938+
sort: bool = True,
939+
fastpath: bool = False,
940+
) -> tuple[np.ndarray, tuple[np.ndarray, ...], tuple[int, ...], int, int, FactorProps | None]: ...
941+
942+
943943
def factorize_(
944944
by: T_Bys,
945945
axes: T_Axes,
@@ -967,10 +967,10 @@ def factorize_(
967967
]
968968
results = tuple(f.result() for f in futures)
969969
else:
970-
results = [
970+
results = tuple(
971971
_factorize_single(groupvar, expect, sort=sort, reindex=reindex)
972972
for groupvar, expect in zip(by, expected_groups)
973-
]
973+
)
974974
found_groups = [r[0] for r in results]
975975
factorized = [r[1] for r in results]
976976

0 commit comments

Comments
 (0)