From 1ecc433753392b3d53bfcd0d880345e0238e2128 Mon Sep 17 00:00:00 2001 From: TheoQM Date: Sat, 30 Nov 2024 10:39:15 +0100 Subject: [PATCH] fix for qm-qua==1.2.1 --- .../external_frameworks/qcodes/opx_driver.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/qualang_tools/external_frameworks/qcodes/opx_driver.py b/qualang_tools/external_frameworks/qcodes/opx_driver.py index 8bf76725..1808045e 100644 --- a/qualang_tools/external_frameworks/qcodes/opx_driver.py +++ b/qualang_tools/external_frameworks/qcodes/opx_driver.py @@ -364,16 +364,18 @@ def _extend_result(self, gene, count, averaging_buffer): self.results["buffers"].append([]) self.results["scale_factor"].append(1) # Check if next buffer is for averaging - if len(gene.values[2].list_value.values[1].list_value.values) > 0: - if gene.values[2].list_value.values[1].list_value.values[0].string_value == "average": - averaging_buffer = True + if hasattr(gene.values[2].list_value.values[1], "list_value"): + if len(gene.values[2].list_value.values[1].list_value.values) > 0: + if gene.values[2].list_value.values[1].list_value.values[0].string_value == "average": + averaging_buffer = True elif gene.values[0].string_value == "buffer": if not averaging_buffer: self.results["buffers"][count].append(int(gene.values[1].string_value)) # Check if next buffer is for averaging - if len(gene.values[2].list_value.values[1].list_value.values) > 0: - if gene.values[2].list_value.values[1].list_value.values[0].string_value == "average": - averaging_buffer = True + if hasattr(gene.values[2].list_value.values[1], "list_value"): + if len(gene.values[2].list_value.values[1].list_value.values) > 0: + if gene.values[2].list_value.values[1].list_value.values[0].string_value == "average": + averaging_buffer = True else: averaging_buffer = False elif gene.values[0].string_value == "@macro_adc_trace": @@ -383,9 +385,11 @@ def _extend_result(self, gene, count, averaging_buffer): else: pass if len(gene.values) > 2: - self._extend_result(gene.values[2].list_value, count, averaging_buffer) + if hasattr(gene.values[2], "list_value"): + self._extend_result(gene.values[2].list_value, count, averaging_buffer) elif gene.values[0].string_value == "average": - self._extend_result(gene.values[1].list_value, count, averaging_buffer) + if hasattr(gene.values[1], "list_value"): + self._extend_result(gene.values[1].list_value, count, averaging_buffer) def _get_stream_processing(self, prog): """