From 8f4baa8089bf0abf5e6e93441790b1bdff94c966 Mon Sep 17 00:00:00 2001 From: Imri Fattal Date: Tue, 29 Oct 2024 12:03:47 +0100 Subject: [PATCH] Hotfix data_set.py: flatten 2D arrays When adding a 2D array as a standalone parameter in a dataset, the whole numpy array would be save in bit form. Flatten is needed to make a proper array to saved alongside the data. --- src/qcodes/dataset/data_set.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qcodes/dataset/data_set.py b/src/qcodes/dataset/data_set.py index 8c7cded5a45..b59d6c5df43 100644 --- a/src/qcodes/dataset/data_set.py +++ b/src/qcodes/dataset/data_set.py @@ -1395,13 +1395,13 @@ def _finalize_res_dict_standalones( res_list += new_res elif param.type == "numeric": if value.shape: - res_list += [{param.name: number} for number in value] + res_list += [{param.name: number} for number in value.flatten()] else: new_res = [{param.name: float(value)}] res_list += new_res elif param.type == "complex": if value.shape: - res_list += [{param.name: number} for number in value] + res_list += [{param.name: number} for number in value.flatten()] else: new_res = [{param.name: complex(value)}] res_list += new_res