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 same ARRAY_TYPE type. Currently, ARRAY_TYPE is defined as float32, giving a 24-bit significand (slightly more than 7 decimals of precission). This class also provides a unified way to define tensors in harmoni-pm

Constructor parameters are that of the underlying numpy.ndarray constructor with dtype set to ARRAY_TYPE.

static make(lst)

Factory method that instantiates a FloatArray from a given Python list or tuple specified by lst. This lst is passed directly to the underlying numpy.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.

class Configuration
class InvalidPrototypeError
class InvalidTensorShapeError
class QuantityType