From 82d94d608ea639c0aa8aefb80cc97c5d8b1ba2cb Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 1 May 2019 16:29:46 +0100 Subject: raise error if method is not recognised --- Wrappers/Python/ccpi/framework/framework.py | 3 +++ 1 file changed, 3 insertions(+) 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': -- cgit v1.2.3