Common¶
The common component represents the set of generic utility classes used across the project, like float array, exceptions and quantities.
-
class
FloatArray
(shape, buffer=None, offset=0, strides=None, order=None)¶ Convenience subclass of
numpy.ndarray
with helper methods that ensures all arrays created from miscellaneous Python objects like tuples or lists are of the sameARRAY_TYPE
type. Currently,ARRAY_TYPE
is defined asfloat32
, giving a 24-bit significand (slightly more than 7 decimals of precission). This class also provides a unified way to define tensors inharmoni-pm
Constructor parameters are that of the underlying
numpy.ndarray
constructor withdtype
set toARRAY_TYPE
.-
static
make
(lst)¶ Factory method that instantiates a
FloatArray
from a given Python list or tuple specified bylst
. Thislst
is passed directly to the underlyingnumpy.ndarray
constructor, and therefore the usual list/tuple -numpy.ndarray
conversion rules apply.
-
static
compatible_with
(arr)¶ Returns True if arr is derived from numpy.ndarray and its dtype is set to ARRAY_TYPE. Otherwise, return false.
-
static
-
class
Configuration
¶
-
class
InvalidPrototypeError
¶
-
class
InvalidTensorShapeError
¶
-
class
QuantityType
¶