diff options
-rwxr-xr-x | Wrappers/Python/ccpi/framework/framework.py | 6 | ||||
-rwxr-xr-x | Wrappers/Python/test/test_algorithms.py | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/framework/framework.py b/Wrappers/Python/ccpi/framework/framework.py index acb59ae..caea1e1 100755 --- a/Wrappers/Python/ccpi/framework/framework.py +++ b/Wrappers/Python/ccpi/framework/framework.py @@ -708,7 +708,11 @@ class DataContainer(object): return out else: raise ValueError(message(type(self),"Wrong size for data memory: out {} x2 {} expected {}".format( out.shape,x2.shape ,self.shape))) - elif issubclass(type(out), DataContainer) and isinstance(x2, (int,float,complex)): + elif issubclass(type(out), DataContainer) and \ + isinstance(x2, (int,float,complex, numpy.int, numpy.int8, \ + numpy.int16, numpy.int32, numpy.int64,\ + numpy.float, numpy.float16, numpy.float32,\ + numpy.float64, numpy.complex)): if self.check_dimensions(out): kwargs['out']=out.as_array() pwop(self.as_array(), x2, *args, **kwargs ) diff --git a/Wrappers/Python/test/test_algorithms.py b/Wrappers/Python/test/test_algorithms.py index 8c398f4..3bb3d57 100755 --- a/Wrappers/Python/test/test_algorithms.py +++ b/Wrappers/Python/test/test_algorithms.py @@ -64,10 +64,11 @@ class TestAlgorithms(unittest.TestCase): print ("Test CGLS") ig = ImageGeometry(124,153,154) x_init = ImageData(geometry=ig) + x_init = ig.allocate() b = x_init.copy() # fill with random numbers b.fill(numpy.random.random(x_init.shape)) - + b = ig.allocate('random') identity = Identity(ig) alg = CGLS(x_init=x_init, operator=identity, data=b) |