From 9fa4712ab5f44deb05905f21602d6a0750a61c5c Mon Sep 17 00:00:00 2001 From: dcherian Date: Thu, 20 Oct 2022 08:58:29 -0600 Subject: [PATCH] More typing --- flox/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flox/core.py b/flox/core.py index 2d0af4688..68afd5c6a 100644 --- a/flox/core.py +++ b/flox/core.py @@ -888,9 +888,9 @@ def _conc2(x_chunk, key1, key2=slice(None), axis: T_Axes = None) -> np.ndarray: # return concatenate3(mapped) -def reindex_intermediates(x: IntermediateDict, agg: Aggregation, unique_groups): +def reindex_intermediates(x: IntermediateDict, agg: Aggregation, unique_groups) -> IntermediateDict: new_shape = x["groups"].shape[:-1] + (len(unique_groups),) - newx = {"groups": np.broadcast_to(unique_groups, new_shape)} + newx: IntermediateDict = {"groups": np.broadcast_to(unique_groups, new_shape)} newx["intermediates"] = tuple( reindex_( v, from_=np.atleast_1d(x["groups"].squeeze()), to=pd.Index(unique_groups), fill_value=f