A Characteristic is a dictionary of error source names and dependencies on that sources. Read-only attributes:
.dependencies - {source’s name: Dependency instance}
Returns a copy with compress()’ed Dependency instances. The arguments are handed over to the Dependencies’ methods. NEW_SHAPE is the new shape.
Returns a copy with flatten()’ed Dependency instances. The arguments are handed over to the Dependencies’ methods. NEW_SHAPE is the new shape.
Returns a copy with repeat()’ed Dependency instances. The arguments are handed over to the Dependencies’ methods. NEW_SHAPE is the new shape.
OTHER must be a Characteristic instance. Add dependencies on the same error source together. self and the OTHER Characteristic instance will be .broadcast()’ed to the .shape with the largest .ndim before being added together. Broadcasting is necessary because not both Characteristics must depend on all Dependencies, thus some Dependencies would be taken over, leaving their shape unchanged, and thus compromising data integrity, because there will be no numpy broadcasting mechanism bringing the operands to common shape. KEY is the portion of self where OTHER applies. KEY must be either a scalar, or a tuple.
For the functionality of .broadcast(), see Dependency.broadcast().
This method acts in-place.
__radd__ and __rsub__ are not needed bacause only Characteristics are allowed as operands.
Argument is not directly the key, but the tuple (SHAPE, KEY). I.e., call self[new_shape, key]. This is permissible, because the undarray can determine the shape from the key when applied to the undarray’s .value. Return the given subset of all Dependencies contained. Return value will be a Characteristic.