diff --git a/Wrappers/Python/cil/framework/BlockDataContainer.py b/Wrappers/Python/cil/framework/BlockDataContainer.py index 35b94f84d5..d624c201e2 100644 --- a/Wrappers/Python/cil/framework/BlockDataContainer.py +++ b/Wrappers/Python/cil/framework/BlockDataContainer.py @@ -33,7 +33,7 @@ class BlockDataContainer(object): will fail 2) algebra between `BlockDataContainer`s and `list` or `numpy array` will work as long as the number of `rows` and element of the arrays match, - indipendently on the fact that the `BlockDataContainer` could be nested + independently on the fact that the `BlockDataContainer` could be nested 3) algebra between `BlockDataContainer` and one `DataContainer` is possible. It will require all the `DataContainers` in the block to be compatible with the `DataContainer` we want to operate with. @@ -147,7 +147,7 @@ def subtract(self, other, *args, **kwargs): '''Algebra: subtract method of BlockDataContainer with number/DataContainer or BlockDataContainer :param: other (number, DataContainer or subclasses or BlockDataContainer - :param: out (optional): provides a placehold for the resul. + :param: out (optional): provides a placeholder for the result. ''' out = kwargs.get('out', None) if out is not None: @@ -157,8 +157,8 @@ def subtract(self, other, *args, **kwargs): def multiply(self, other, *args, **kwargs): '''Algebra: multiply method of BlockDataContainer with number/DataContainer or BlockDataContainer - :param: other (number, DataContainer or subclasses or BlockDataContainer - :param: out (optional): provides a placehold for the resul. + :param: other (number, DataContainer or subclasses or BlockDataContainer) + :param: out (optional): provides a placeholder for the result. ''' out = kwargs.get('out', None) if out is not None: @@ -168,8 +168,8 @@ def multiply(self, other, *args, **kwargs): def divide(self, other, *args, **kwargs): '''Algebra: divide method of BlockDataContainer with number/DataContainer or BlockDataContainer - :param: other (number, DataContainer or subclasses or BlockDataContainer - :param: out (optional): provides a placehold for the resul. + :param: other (number, DataContainer or subclasses or BlockDataContainer) + :param: out (optional): provides a placeholder for the result. ''' out = kwargs.get('out', None) if out is not None: @@ -180,7 +180,7 @@ def power(self, other, *args, **kwargs): '''Algebra: power method of BlockDataContainer with number/DataContainer or BlockDataContainer :param: other (number, DataContainer or subclasses or BlockDataContainer - :param: out (optional): provides a placehold for the resul. + :param: out (optional): provides a placeholder for the result. ''' out = kwargs.get('out', None) if out is not None: @@ -190,8 +190,8 @@ def power(self, other, *args, **kwargs): def maximum(self, other, *args, **kwargs): '''Algebra: power method of BlockDataContainer with number/DataContainer or BlockDataContainer - :param: other (number, DataContainer or subclasses or BlockDataContainer - :param: out (optional): provides a placehold for the resul. + :param: other (number, DataContainer or subclasses or BlockDataContainer) + :param: out (optional): provides a placeholder for the result. ''' out = kwargs.get('out', None) if out is not None: @@ -201,8 +201,8 @@ def maximum(self, other, *args, **kwargs): def minimum(self, other, *args, **kwargs): '''Algebra: power method of BlockDataContainer with number/DataContainer or BlockDataContainer - :param: other (number, DataContainer or subclasses or BlockDataContainer - :param: out (optional): provides a placehold for the resul. + :param: other (number, DataContainer or subclasses or BlockDataContainer) + :param: out (optional): provides a placeholder for the result. ''' out = kwargs.get('out', None) if out is not None: @@ -224,14 +224,14 @@ def sapyb(self, a, y, b, out, num_threads = NUM_THREADS): Example: -------- - a = 2 - b = 3 - ig = ImageGeometry(10,11) - x = ig.allocate(1) - y = ig.allocate(2) - bdc1 = BlockDataContainer(2*x, y) - bdc2 = BlockDataContainer(x, 2*y) - out = bdc1.sapyb(a,bdc2,b) + >>> a = 2 + >>> b = 3 + >>> ig = ImageGeometry(10,11) + >>> x = ig.allocate(1) + >>> y = ig.allocate(2) + >>> bdc1 = BlockDataContainer(2*x, y) + >>> bdc2 = BlockDataContainer(x, 2*y) + >>> out = bdc1.sapyb(a,bdc2,b) ''' if out is None: raise ValueError("out container cannot be None") @@ -249,7 +249,7 @@ def binary_operations(self, operation, other, *args, **kwargs): '''Algebra: generic method of algebric operation with BlockDataContainer with number/DataContainer or BlockDataContainer Provides commutativity with DataContainer and subclasses, i.e. this - class's reverse algebric methods take precedence w.r.t. direct algebric + class's reverse algebraic methods take precedence w.r.t. direct algebraic methods of DataContainer and subclasses. This method is not to be used directly diff --git a/Wrappers/Python/cil/framework/framework.py b/Wrappers/Python/cil/framework/framework.py index d205a1fa64..ca32f243f8 100644 --- a/Wrappers/Python/cil/framework/framework.py +++ b/Wrappers/Python/cil/framework/framework.py @@ -2950,12 +2950,12 @@ def __str__ (self, representation=False): def get_data_axes_order(self,new_order=None): '''returns the axes label of self as a list - if new_order is None returns the labels of the axes as a sorted-by-key list - if new_order is a list of length number_of_dimensions, returns a list + If new_order is None returns the labels of the axes as a sorted-by-key list. + If new_order is a list of length number_of_dimensions, returns a list with the indices of the axes in new_order with respect to those in self.dimension_labels: i.e. - self.dimension_labels = {0:'horizontal',1:'vertical'} - new_order = ['vertical','horizontal'] + >>> self.dimension_labels = {0:'horizontal',1:'vertical'} + >>> new_order = ['vertical','horizontal'] returns [1,0] ''' if new_order is None: @@ -3285,11 +3285,8 @@ def norm(self, **kwargs): return numpy.sqrt(self.squared_norm(**kwargs)) def dot(self, other, *args, **kwargs): - '''return the inner product of 2 DataContainers viewed as vectors - - applies to real and complex data. In such case the dot method returns - - a.dot(b.conjugate()) + '''returns the inner product of 2 DataContainers viewed as vectors. Suitable for real and complex data. + For complex data, the dot method returns a.dot(b.conjugate()) ''' method = kwargs.get('method', 'numpy') if method not in ['numpy','reduce']: