The Dependency class maintains a dependency of some quantity (i.e., some undarray) on one error source per element.
Initialise the dependency on error sources NAMES of variances VARIANCES with derivatives DERIVATIVES. All are supposed to be ndarrays of equal shape. As an alternative, everything can be left out when specifying SHAPE. In this case, an empty Dependency containing numpy.ndarrays of dtype = None [float] will be created.
OTHER must be a Dependency instance of same shape. Adds the OTHER to self as far as possible, what is left and could not be added is returned as new Dependency. If KEY is given, it specifies the portion of self where the OTHER applies. If KEY is given, it must be a tuple or a scalar.
__radd__ and __rsub__ are not needed, because always both operands will be Dependency instances for addition operations.
... will be emulated.
Returns a copy with the Dependency’s arrays compress()’ed. The arguments are handed over to the arrays’ methods.
Returns a copy with the data arrays copied. No name replacement is done (see undarray.copy for documentation).
Returns a copy with the Dependency’s arrays flatten()’ed. The arguments are handed over to the arrays’ methods.
Returns a copy with repeat()’ed arrays. The arguments are handed over to the arrays’ methods.
Bring the instance in shape SHAPE, by repetition of the object. No reshape()’ing will be performed. This function is used when coercing lower-dimensional object with higher-dimensional ones. It makes shure that both operands can have the same shape before coercion takes place. Broadcasting is necessary in the case that an Dependency is taken over from the other operand into the final result, because there is no dependency of both operands on the Dependency. In this case, no numpy broadcasting would occour, and the data integrity would be compromised.
The call will fail if len(SHAPE) < .ndim. Otherwise, the .ndim last items of SHAPE must be equal to .shape. The object will first be brought to the shape [1, 1, 1, ...] + .shape, such that .ndim becomes len(SHAPE). Then, it will be repeated in the added dimensions to meet SHAPE’s elements. The first step is done via .reshape(), and the second via .repeat(count, axis = axis).
This method acts on a copy.