Skip to content

Commit

Permalink
Fix qcodes driver for qm-qua==1.2.1 (#251)
Browse files Browse the repository at this point in the history
* fix for qm-qua==1.2.1

* update changelog
  • Loading branch information
TheoLaudatQM authored Dec 2, 2024
1 parent ab96682 commit 54b2b16
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Fixed
- external_frameworks/qcodes - Fixed the driver to be compatible with qm-qua==1.2.1.

## [0.18.1] - 2024-11-05
### Added
Expand Down
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 54b2b16

Please sign in to comment.