summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-05-01 16:29:46 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2019-05-01 16:29:46 +0100
commit82d94d608ea639c0aa8aefb80cc97c5d8b1ba2cb (patch)
treeb8b572bee346799e313c8dd8e084fa54a327fa3f
parent67fa9b5a985912232d8b5aeeec12451ed55a1a7a (diff)
downloadframework-82d94d608ea639c0aa8aefb80cc97c5d8b1ba2cb.tar.gz
framework-82d94d608ea639c0aa8aefb80cc97c5d8b1ba2cb.tar.bz2
framework-82d94d608ea639c0aa8aefb80cc97c5d8b1ba2cb.tar.xz
framework-82d94d608ea639c0aa8aefb80cc97c5d8b1ba2cb.zip
raise error if method is not recognised
-rwxr-xr-xWrappers/Python/ccpi/framework/framework.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Wrappers/Python/ccpi/framework/framework.py b/Wrappers/Python/ccpi/framework/framework.py
index 66420b9..7236e0e 100755
--- a/Wrappers/Python/ccpi/framework/framework.py
+++ b/Wrappers/Python/ccpi/framework/framework.py
@@ -765,6 +765,9 @@ class DataContainer(object):
def dot(self, other, *args, **kwargs):
'''return the inner product of 2 DataContainers viewed as vectors'''
method = kwargs.get('method', 'reduce')
+ if method not in ['numpy','reduce']:
+ raise ValueError('dot: specified method not valid. Expecting numpy or reduce got {} '.format(
+ method))
if self.shape == other.shape:
# return (self*other).sum()
if method == 'numpy':