Skip to content

Commit

Permalink
fix for qm-qua==1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLaudatQM committed Nov 30, 2024
1 parent ab96682 commit 1ecc433
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions qualang_tools/external_frameworks/qcodes/opx_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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):
"""
Expand Down

0 comments on commit 1ecc433

Please sign in to comment.