quemb.shared.typingΒΆ

Define some types that do not fit into one particular module

In particular it enables barebone typechecking for the shape of numpy arrays

Inspired by https://stackoverflow.com/questions/75495212/type-hinting-numpy-arrays-and-batches

Note that most numpy functions return ndarray[Any, Any] i.e. the type is mostly useful to document intent to the developer.

Module Attributes

T_dtype_co

Type annotation of a generic covariant type.

Vector

Type annotation of a vector.

Matrix

Type annotation of a matrix.

Tensor3D

Type annotation of a tensor.

Tensor4D

Type annotation of a tensor.

Tensor5D

Type annotation of a tensor.

Tensor6D

Type annotation of a tensor.

Tensor7D

Type annotation of a tensor.

Tensor

Type annotation of a tensor.

PathLike

Type annotation for pathlike objects.

KwargDict

Type annotation for dictionaries holding keyword arguments.

T

A generic type variable, without any constraints.

AOIdx

The index of an atomic orbital.

GlobalAOIdx

The global index of an atomic orbital, i.e. not per fragment.

OwnRelAOIdx

The relative AO index.

OtherRelAOIdx

The relative AO index, relative to another fragment.

FragmentIdx

The index of a Fragment.

MotifIdx

The index of a heavy atom, i.e. of a motif.

CenterIdx

In a given fragment, this is the index of a center.

EdgeIdx

An edge is the complement of the set of centers in a fragment.

OriginIdx

In a given BE fragment, this is the origin of the remaining fragment after subsets have been removed.