From 37ff4558477d35617431b8189fff29d732c5b16b Mon Sep 17 00:00:00 2001 From: Francisco Romero Hinrichsen Date: Thu, 5 Aug 2021 13:52:44 +0200 Subject: [PATCH 1/3] Added NotImplemented error to Array.concatenate --- pyopencl/array.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyopencl/array.py b/pyopencl/array.py index fb80f2d70..3cdffdbfc 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -2604,11 +2604,20 @@ def make_func_for_chunk_size(chunk_size): def concatenate(arrays, axis=0, queue=None, allocator=None): """ + Return a :class:`Array` that is a concatenation of the input tuple of + :class:`Array` along :arg axis:. **Warning** Only axis = 0 has been + implemented. + .. versionadded:: 2013.1 """ # {{{ find properties of result array shape = None + if axis != 0: + raise NotImplementedError("Axis != 0. "+ + "To be implementedk when Array.setitems " + + "allows values with different stride".) + for i_ary, ary in enumerate(arrays): queue = queue or ary.queue From 940cfcf24445388b39a708c53ac2b698da3c9506 Mon Sep 17 00:00:00 2001 From: Francisco Romero Hinrichsen Date: Wed, 11 Aug 2021 07:51:07 +0200 Subject: [PATCH 2/3] fixed syntax error in Error message --- pyopencl/array.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyopencl/array.py b/pyopencl/array.py index 3cdffdbfc..3aa8a022c 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -2605,8 +2605,8 @@ def make_func_for_chunk_size(chunk_size): def concatenate(arrays, axis=0, queue=None, allocator=None): """ Return a :class:`Array` that is a concatenation of the input tuple of - :class:`Array` along :arg axis:. **Warning** Only axis = 0 has been - implemented. + :class:`Array` along :arg axis:. **Warning** The current implementation + allows only concatenation of row-major arrays along axis = 0. .. versionadded:: 2013.1 """ @@ -2615,8 +2615,8 @@ def concatenate(arrays, axis=0, queue=None, allocator=None): shape = None if axis != 0: raise NotImplementedError("Axis != 0. "+ - "To be implementedk when Array.setitems " + - "allows values with different stride".) + "To be implemented when Array.setitems " + + "allows values with different stride.") for i_ary, ary in enumerate(arrays): From 33e83dd63e20924afe2a522901af502a68bef798 Mon Sep 17 00:00:00 2001 From: Francisco Romero Hinrichsen Date: Thu, 12 Aug 2021 09:30:41 +0200 Subject: [PATCH 3/3] fixed Flake8 errors --- pyopencl/array.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyopencl/array.py b/pyopencl/array.py index 3aa8a022c..27607c7b6 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -2604,7 +2604,7 @@ def make_func_for_chunk_size(chunk_size): def concatenate(arrays, axis=0, queue=None, allocator=None): """ - Return a :class:`Array` that is a concatenation of the input tuple of + Return a :class:`Array` that is a concatenation of the input tuple of :class:`Array` along :arg axis:. **Warning** The current implementation allows only concatenation of row-major arrays along axis = 0. @@ -2614,10 +2614,9 @@ def concatenate(arrays, axis=0, queue=None, allocator=None): shape = None if axis != 0: - raise NotImplementedError("Axis != 0. "+ - "To be implemented when Array.setitems " + - "allows values with different stride.") - + raise NotImplementedError("Axis != 0. " + + "To be implemented when Array.setitems " + + "allows values with different stride.") for i_ary, ary in enumerate(arrays): queue = queue or ary.queue