Skip to content

Commit

Permalink
Spelling corrections in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MargaretDuff committed Sep 25, 2023
1 parent 88fc10e commit d7d9075
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 29 deletions.
40 changes: 20 additions & 20 deletions Wrappers/Python/cil/framework/BlockDataContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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")
Expand All @@ -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
Expand Down
15 changes: 6 additions & 9 deletions Wrappers/Python/cil/framework/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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']:
Expand Down

0 comments on commit d7d9075

Please sign in to comment.