Open epapoutsellis opened 3 years ago
Initially I had thought sum
would reduce a DataContainer
to a number. This is what happens in the default configuration. However if you pass the optional parameter axis
returning the sum
for numpy
returns a numpy array and then we are lost. In such case, we should first deduce the size (geometry) and then return an appropriate DataContainer.
There are more universal functions than sum
that are not implemented correctly in CIL, e.g., max
, min
with axis
. All these return a numpy
array.
When I developed it I didn't think we'd use the axis parameter and these methods would return a number. However, we allow passing the axis
parameter and also make use of it, which is wrong in the current setup.
Can you make an example of usage?
REductions are not the algebra methods like add
etc. Are those also not taking the optional (hidden) numpy parameters and return something wrong?
@epapoutsellis I guess we need specific examples of usage for each function we want to "fix".
I currently think we shouldn't use all of the numpy parameters if we don't have to. In fact, if we remove *args, **kwargs
from sum
it will do what I developed it to do and it won't have the current bug.
Additionally, passing axis
as a number is against our normal philosophy of passing the label rather than the index of the axis.
We have some algebra reductions for
DataContainers
coming from numpy. However we have no tests.In addition
.sum
does not return aDataContainer
orImageData
whenaxis
is not 0. This is quite important when dealing with multichannel data.