kups.core.neighborlist.compact
¶
Compactors for the neighbor list pipeline.
Compactor variants:
ReduceCompactor— compresses surviving candidate rows viajnp.where(keep, size=k)with a capacity assertion, preserving the emitted edge degree.MaskOnlyCompactor— preserves the candidate count, replacing failing entries with OOB indices and zero shifts. Used byRefineMaskNeighborList.
Graph-level output shaping, such as restoring undirected symmetry after
queried_keys deduplication, lives in pipeline postprocessors.
MaskOnlyCompactor
¶
Bases: Compactor[D]
In-place compaction: failing entries become OOB indices and zero shifts.
No size change; preserves the candidate count from the selector. Pair candidates are already in their output index space.
Source code in src/kups/core/neighborlist/compact.py
ReduceCompactor
¶
Bases: Compactor[D]
Compact surviving candidates to a size-bounded Edges[D].
Compacts whole candidate rows, so pair neighbor lists and fixed higher-degree topology share the same implementation.