WIP: Resolve "Implement a NumpyDataContainer"
This merge request implements a NumpyDataContainer class that is derived from a DataContainer, and inherits the functionality of a NumbersMixin, a ComparisonMixin and a ForwardAttrsToDataMixin.
Classes that have to be implemented:
-
NumpyDataContainer -
ForwardAttrsToDataMixinwhich forwards all attributes of a DataContainer to the internal data type. For an objectNumpyDataContainer ndcthis means that callingndc.shapecalls theshapemethod of the internally stored np.ndarray. Therefore all attributes (including functions) of the internalnumpy.ndarraycan be accessed. -
ComparisonMixinwhich yields the functionality to compare two objects such asx==y,x!=y,x<y,x<=y,x>y,x>=y -
NumbersMixinwhich provides the ability to perform ...-
binary operations: z = x + y,z = x - y,z = x * y,z = x ** y,z = x % y,z = x ** y,z = x / y,z = x // y,z = divmod(x, y)on copies of the data -
unary operations: floor(x), ... -
in-place operations: x += y, ...
-
Tests:
-
A NumpyDataContainerobject is constructed correctly -
The ForwardAttrsToDataMixincalls the correspondingnumpy.ndarraymethods. Test this by comparing the results of thesame operation onnumpy.ndarray's andNumpyDataContainerobjects -
The methods of the ComparisonMixin by comparing with the analog operations on numpy.ndarray's -
The methods of the NumbersMixin for operations with other NumpyDataContainerobjects and operations with simple scalars
Related issues
Closes #4 (closed)
Edited by Utopia Developers