From d956f08f46b0bbbfd7dcf5e8d1919a03ac51a4cb Mon Sep 17 00:00:00 2001 From: Noe Brucy Date: Tue, 19 Oct 2021 13:43:49 +0200 Subject: [PATCH] [baseprocessor] solve error when saving scalar data --- baseprocessor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/baseprocessor.py b/baseprocessor.py index 160719e..c1e5c93 100644 --- a/baseprocessor.py +++ b/baseprocessor.py @@ -356,8 +356,11 @@ class HDF5Container(BaseProcessor): else: self._save_data(name_full + "/" + key, data[key], "", unit) else: - if len(data) == 0: - return + try: + if len(data) == 0: + return + except TypeError: + data = np.array([data]) self.save.create_array( os.path.dirname(name_full),