-
Notifications
You must be signed in to change notification settings - Fork 758
Open
Description
The MDAnalysos PBC-awared distance calculations normally use a grid-based method with "augmentation" to find minimum image distances.
However, as an alternative method a KDTree based method also exists in lib.pkdtree. More recent versions of scipy have added the boxsize=[Lx, Ly, Lz] kwarg to scipy.spatial.cKDTree to natively compute nearest neighbors on a toroidal topology (i.e., orthorhombic boxes in the case of MD simulations). As recently pointed out in scipy/scipy#16191 (comment) we could use this update to scipy.
- We should investigate if the performance of the native scipy periodic KDTree is better than our implementation.
- If yes, we should consider changing so that we only use our augmented KDTree for cases that native scipy cannot handle.
self, box: Optional[npt.ArrayLike] = None, leafsize: int = 10