Skip to content

Commit aa14656

Browse files
committed
Simplify code for blockwise
1 parent b1b43d9 commit aa14656

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

flox/core.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,17 +1344,8 @@ def dask_groupby_agg(
13441344
# find number of groups in each chunk, this is needed for output chunks
13451345
# along the reduced axis
13461346
slices = slices_from_chunks(tuple(array.chunks[ax] for ax in axis))
1347-
if expected_groups is None:
1348-
groups_in_block = tuple(_unique(by_input[slc]) for slc in slices)
1349-
else:
1350-
# For cohorts, we could be indexing a block with groups that
1351-
# are not in the cohort (usually for nD `by`)
1352-
# Only keep the expected groups.
1353-
groups_in_block = tuple(
1354-
np.intersect1d(by_input[slc], expected_groups) for slc in slices
1355-
)
1347+
groups_in_block = tuple(_unique(by_input[slc]) for slc in slices)
13561348
groups = (np.concatenate(groups_in_block),)
1357-
13581349
ngroups_per_block = tuple(len(grp) for grp in groups_in_block)
13591350
group_chunks = (ngroups_per_block,)
13601351

0 commit comments

Comments
 (0)