hipscatalog_gen.selection.reduce_topk_by_group_dask

reduce_topk_by_group_dask(ddf_like, group_col, score_col, order_desc, k_per_group, ra_col, dec_col, tie_col=None)[source]

Keep up to k_per_group rows per group, sorted by score then RA/DEC.

Uses a two-stage exact strategy: 1) per-partition local top-k pruning (no global shuffle), 2) global top-k by group on the pruned collection.

Parameters:
  • ddf_like (Any)

  • group_col (str)

  • score_col (str)

  • order_desc (bool)

  • k_per_group (Dict[int, int])

  • ra_col (str)

  • dec_col (str)

  • tie_col (str | None)