probnum.typing

Custom type aliases.

This module defines commonly used types in the library. These are separated into two different kinds, API types and argument types.

API types (*Type) are aliases which define custom types used throughout the library. Objects ofthis type may be supplied as arguments or returned by a method.

Argument types (*Like) are aliases which define commonly used method arguments that are internally converted to a standardized representation. These should only ever be used in the signature of a method and then be converted internally, e.g. in a class instantiation or an interface. They enable the user to conveniently supply a variety of objects of different types for the same argument, while ensuring a unified internal representation of those same objects. As an example, take the different ways a user might specify a shape: 2, (2,), [2, 2]. These may all be acceptable arguments to a function taking a shape, but internally should always be converted to a ShapeType, i.e. a tuple of ints.

Variables

ShapeType

Type defining a shape of an object.

MatrixType

Type defining a matrix, i.e. a linear map between finite-dimensional vector spaces.

IntLike

Object that can be converted to an integer.

FloatLike

Object that can be converted to a float.

ShapeLike

Object that can be converted to a shape.

DTypeLike

Object that can be converted to an array dtype.

ArrayIndicesLike

Object that can be converted to indices of an array.

ScalarLike

Object that can be converted to a scalar value.

ArrayLike

Object that can be converted to an array.

LinearOperatorLike

Object that can be converted to a LinearOperator.