diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-04-15 12:16:21 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-04-15 12:16:21 +0100 |
commit | 1a5da33eb2c7bfde2224d634cb34d17b18d7cf72 (patch) | |
tree | 5de726157c004452612c96eb6010f96b31b98bf4 | |
parent | d1e26ec31df5a2b269e021e4a2c039e0e265a353 (diff) | |
download | framework-1a5da33eb2c7bfde2224d634cb34d17b18d7cf72.tar.gz framework-1a5da33eb2c7bfde2224d634cb34d17b18d7cf72.tar.bz2 framework-1a5da33eb2c7bfde2224d634cb34d17b18d7cf72.tar.xz framework-1a5da33eb2c7bfde2224d634cb34d17b18d7cf72.zip |
add test for allocate when passed a geometry
closes #223
-rwxr-xr-x | Wrappers/Python/ccpi/framework/framework.py | 21 |
1 files changed, 11 insertions, 10 deletions
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) |