treams.util

Utilities.

Collection of functions to make AnnotatedArray work. The implementation is aimed to be quite general, while still providing a solid basis for the rest of the code.

Module Attributes

HANDLED_FUNCTIONS

Dictionary of numpy functions implemented for AnnotatedArrays.

Functions

diag(a[, k])

Extract diagonal from an array or create an diagonal array.

implements(np_func)

Decorator to register an __array_function__ implementation to AnnotatedArrays.

lstsq(a, b[, rcond])

Solve linear system using least squares.

ones_like(a[, dtype, order, shape])

Create a numpy array like the given array containing ones.

solve(a, b)

Solve linear system.

svd(a[, full_matrices, compute_uv, hermitian])

Compute the singular value decomposition.

tril(a[, k])

Get lower trinagular matrix.

triu(a[, k])

Get upper trinagular matrix.

zeros_like(a[, dtype, order, shape])

Create a numpy array like the given array containing zeros.

Classes

AnnotatedArray(array[, ann])

Array that keeps track of annotations for each dimension.

AnnotationDict([items])

Dictionary that notifies the user when overwriting keys.

AnnotationSequence(*args[, mapping])

A Sequence of dictionaries.

OrderedSet()

Ordered set.

SequenceAsDict()

Exceptions

AnnotationError

Custom exception for Annotations.

AnnotationWarning

Custom warning for Annotations.