The base module

The base module contains the Base class.

This class contains essential methods and attributes needed for all other classes.

class base.Base(coordinates=None, distances=None, maxk=None, period=None, verbose=False, njobs=2)[source]

Base class.

compute_distances(maxk=None, metric='euclidean', period=None)[source]

Compute distaces between points up to the maxk nearest neighbour.

  • maxk – maximum number of neighbours for which distance is computed and stored

  • metric – type of metric

  • period (float or np.array) – periodicity (only used for periodic distance computation). Default is None.


Find points that are numerically identical and remove them.

For very large datasets this method might be slow; you might want to use a command like: awk ‘!seen[$0]++’ . See for more information


Find zero neighbour distances and substitute the numerical zeros with a very small number.

This method is mostly useful to regularize the computation of certain id estimators.