From ef4ca9e9ea94c65390cf10206ec73fc9cbb186d7 Mon Sep 17 00:00:00 2001 From: Ognyan Moore Date: Thu, 21 Nov 2019 08:46:25 -0800 Subject: [PATCH] Incorporated correction luke suggested --- pyqtgraph/metaarray/MetaArray.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/metaarray/MetaArray.py b/pyqtgraph/metaarray/MetaArray.py index 1410e40c..374c9acf 100644 --- a/pyqtgraph/metaarray/MetaArray.py +++ b/pyqtgraph/metaarray/MetaArray.py @@ -357,9 +357,12 @@ class MetaArray(object): else: return np.array(self._data) - def __array__(self): + def __array__(self, dtype=None): ## supports np.array(metaarray_instance) - return self.asarray() + if dtype is None: + return self.asarray() + else: + return self.asarray().astype(dtype) def view(self, typ): ## deprecated; kept for backward compatibility