From 1a5da33eb2c7bfde2224d634cb34d17b18d7cf72 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 15 Apr 2019 12:16:21 +0100 Subject: add test for allocate when passed a geometry closes #223 --- Wrappers/Python/ccpi/framework/framework.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/ccpi/framework/framework.py b/Wrappers/Python/ccpi/framework/framework.py index 7874813..7516447 100755 --- a/Wrappers/Python/ccpi/framework/framework.py +++ b/Wrappers/Python/ccpi/framework/framework.py @@ -913,7 +913,7 @@ class AcquisitionData(DataContainer): deep_copy=True, dimension_labels=None, **kwargs): - self.geometry = None + self.geometry = kwargs.get('geometry', None) if array is None: if 'geometry' in kwargs.keys(): geometry = kwargs['geometry'] @@ -928,7 +928,6 @@ class AcquisitionData(DataContainer): else: if self.geometry is not None: shape, labels = self.get_shape_labels(self.geometry, dimension_labels) - print('Shape mismatch {} {}'.format(shape, array.shape)) if array.shape != shape: raise ValueError('Shape mismatch {} {}'.format(shape, array.shape)) @@ -952,16 +951,18 @@ class AcquisitionData(DataContainer): if dimension_labels is None: if array.ndim == 4: - dimension_labels = ['channel' ,'angle' , 'vertical' , - 'horizontal'] + dimension_labels = [AcquisitionGeometry.CHANNEL, + AcquisitionGeometry.ANGLE, + AcquisitionGeometry.VERTICAL, + AcquisitionGeometry.HORIZONTAL] elif array.ndim == 3: - dimension_labels = ['angle' , 'vertical' , - 'horizontal'] + dimension_labels = [AcquisitionGeometry.ANGLE, + AcquisitionGeometry.VERTICAL, + AcquisitionGeometry.HORIZONTAL] else: - dimension_labels = ['angle' , - 'horizontal'] - - #DataContainer.__init__(self, array, deep_copy, dimension_labels, **kwargs) + dimension_labels = [AcquisitionGeometry.ANGLE, + AcquisitionGeometry.HORIZONTAL] + super(AcquisitionData, self).__init__(array, deep_copy, dimension_labels, **kwargs) -- cgit v1.2.3