brainhops._core.typing
Type hints shared across the package.
Internal module
brainhops._core.typing is an internal module. It is documented only
to explain the type hints that appear in the public interface, and it
should not be imported or relied upon. It may change or disappear
without notice.
Attributes
Const
module-attribute
Field that is frozen and cannot be set through the constructor.
HiddenConst
module-attribute
Constant field that is also hidden from the generated __repr__.
npscalar
module-attribute
Scalar, given either as a plain value or as a 0-d array.
npvector
module-attribute
One-dimensional NumPy array, converted from an array of any backend.
A scalar becomes a vector of one element. An array with more dimensions is refused, unless its extra leading dimensions have length one, in which case they are removed.
npmatrix
module-attribute
Two-dimensional NumPy array, converted from an array of any backend.
A scalar becomes a matrix of one element and a vector becomes a matrix of one row. An array with more dimensions, such as a stack of matrices, is refused, unless its extra leading dimensions have length one, in which case they are removed.
Clip
module-attribute
Voxel margin: symmetric scalar, shared pair, per-axis pairs, or None.
ShapeLike
module-attribute
Any shape-like object, such as a list or a tuple.
NativeNumber
module-attribute
Native number values.
Functions:
is_instance_or_subclass
Return whether an object is an instance or a subclass of a class.
Classes are tested with issubclass and other objects with
isinstance, so the function returns False for unrelated classes and
for objects such as None.