src.geometry package

Subpackages

Submodules

src.geometry.normalize module

src.geometry.normalize.normalize(arr, axis=1, degree_exp=1.0, sym_norm=False, in_place=False)
Parameters:
  • arr (BaseArray[T])

  • axis (int | None)

  • degree_exp (float)

  • sym_norm (bool)

  • in_place (bool)

Return type:

BaseArray[T]

src.geometry.points module

class src.geometry.points.Coordinates(*args, **metadata)

Bases: PointsMixin, DenseArray

Parameters:
property d: int
class src.geometry.points.Data(*args, **metadata)

Bases: Points

Parameters:
property D: int
class src.geometry.points.Embedding(*args, **metadata)

Bases: Points

Parameters:
property p: int
class src.geometry.points.Points(*args, **metadata)

Bases: PointsMixin, DenseArray

Parameters:
pairwise_distance(y_pts=None, dist_type='euclidean')

Compute the pairwise distance matrix between points.

If y_pts is provided, computes distances between self and y_pts. Otherwise, computes distances among points in self.

Parameters:
  • y_pts (Optional[Points]) – Another Points object to compute distances to. If None, distances are computed within self.

  • dist_type (DistanceType) – The type of distance metric to use (“euclidean”, “cityblock”, “sqeuclidian”). Name of metric is stored in metadata. (default: “euclidian”)

Returns:

A DistanceMatrix containing pairwise distances. The matrix name is constructed from the metadata of the points involved.

Return type:

DistanceMatrix

class src.geometry.points.PointsMixin(*args, **metadata)

Bases: ObjectMixin, ABC

Mixin class for point cloud objects.

Adds fixed dimensionality and dtype constraints, metadata handling, and distance computation functionality to point cloud classes.

Parameters:
fixed_dtype

alias of float64

fixed_ndim: int = 2
metadata: Metadata
property nfeats: int

Number of features (dimensions) per point.

Returns:

Number of features per point.

Return type:

int

property npts: int

Number of points in the point set.

Returns:

Number of points.

Return type:

int

Module contents

class src.geometry.Coordinates(*args, **metadata)

Bases: PointsMixin, DenseArray

Parameters:
  • args (Any)

  • metadata (Any)

property d: int
class src.geometry.Data(*args, **metadata)

Bases: Points

Parameters:
  • args (Any)

  • metadata (Any)

property D: int
class src.geometry.Embedding(*args, **metadata)

Bases: Points

Parameters:
  • args (Any)

  • metadata (Any)

property p: int
class src.geometry.Points(*args, **metadata)

Bases: PointsMixin, DenseArray

Parameters:
  • args (Any)

  • metadata (Any)

pairwise_distance(y_pts=None, dist_type='euclidean')

Compute the pairwise distance matrix between points.

If y_pts is provided, computes distances between self and y_pts. Otherwise, computes distances among points in self.

Parameters:
  • y_pts (Optional[Points]) – Another Points object to compute distances to. If None, distances are computed within self.

  • dist_type (DistanceType) – The type of distance metric to use (“euclidean”, “cityblock”, “sqeuclidian”). Name of metric is stored in metadata. (default: “euclidian”)

Returns:

A DistanceMatrix containing pairwise distances. The matrix name is constructed from the metadata of the points involved.

Return type:

DistanceMatrix

src.geometry.normalize(arr, axis=1, degree_exp=1.0, sym_norm=False, in_place=False)
Parameters:
  • arr (BaseArray[T])

  • axis (int | None)

  • degree_exp (float)

  • sym_norm (bool)

  • in_place (bool)

Return type:

BaseArray[T]