fused_leader#

nvmolkit.pickers.fused_leader(
x,
cutoff: float,
*,
metric: Literal['tanimoto', 'cosine', 'aap'] | TanimotoMetric | CosineMetric | AAPMetric = 'tanimoto',
pick_size: int = 0,
first_picks: Sequence[int] = (),
stream: Stream | None = None,
output: OutputMode = OutputMode.DEVICE,
) → AsyncGpuResult | tuple[int, ...]#

Select leaders by sphere exclusion, computing distances as needed.

Equivalent to leader() on the matrix of 1 - similarity values, with memory that scales as O(N). Distances are computed in float32, so results can differ slightly from RDKit’s double-precision results.

Parameters:
  • x – Packed int32 or uint32 fingerprints of shape (N, num_words) for Tanimoto and cosine, or a sequence of RDKit molecules for AAP.

  • cutoff – Inclusive exclusion distance in [0, 1], rounded to float32.

  • metric – Similarity metric.

  • pick_size – Maximum number of leaders, or 0 for no limit. All first_picks are retained even if they exceed this limit.

  • first_picks – Unique indices selected as leaders, in order, before the input-order pass.

  • stream – CUDA stream to use. If None, uses the current stream.

  • output – Result representation.

Returns:

An AsyncGpuResult of int32 indices for OutputMode.DEVICE, or a tuple of indices for OutputMode.RDKIT.