Skip to content

Commit 0255861

Browse files
author
Henri Ervasti
committed
[173-support-4x2-and-2x4-mode-in-hdawg] Removed "already deprecated" added function set_awg_module_index. Edited CHANGELOG.md accordingly.
1 parent b8846c2 commit 0255861

File tree

3 files changed

+1
-46
lines changed

3 files changed

+1
-46
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- `run` method in `QMI_Context` class to accommodate for `threading.Thread` changes in Python 3.14.
1111
- `standard-xdrlib` from "dead batteries" as a dependency to fix issues coming from removal of `xdrlib` from standard library.
1212
- `grouping=2` input parameter in the `ZurichInstruments_Hdawg` to enable initialization directly in wanted grouping mode.
13-
- Addition of `set_awg_module_index` method to set the AWG module index number.
14-
- Addition of other new methods in Zurich Instruments HDAWG QMI driver. For example, now it is also possible to upload sequencer programs, command tables and waveforms to specific channel | core.
13+
- Addition of new methods in Zurich Instruments HDAWG QMI driver. For example, now it is also possible to upload sequencer programs, command tables and waveforms to specific AWG channel or AWG (core) index. Also setting DIO VALID index and polarity is now possible.
1514
- Python 3.14 CI pipelines.
1615

1716
### Changed

qmi/instruments/zurich_instruments/hdawg.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -716,30 +716,6 @@ def get_awg_module_index(self) -> int:
716716
"""
717717
return self.awg_module.getInt("index")
718718

719-
@rpc_method
720-
def set_awg_module_index(self, index: int):
721-
"""Set the AWG module index.
722-
723-
The currently set AWG module index, together with current grouping mode, defines which AWG cores will
724-
be [en|dis]abled when 'set_awg_module_enabled' is called.
725-
726-
NOTE: It is possible to set any value regardless of the grouping mode, so it is up to the user to control
727-
if the given index is valid.
728-
729-
Parameters:
730-
index: AWG module index number in range 0..3.
731-
732-
Raises:
733-
ValueError: If the given index value is invalid.
734-
"""
735-
warnings.warn(
736-
f"{self.get_awg_module_index.__name__} will be deprecated.", DeprecationWarning
737-
)
738-
if index not in range(self.NUM_AWGS):
739-
raise ValueError(f"Index number {index} is invalid.")
740-
741-
self.awg_module.set("index", index)
742-
743719
@rpc_method
744720
def get_awg_module_enabled(self) -> int:
745721
"""Return the current enable status of the currently selected AWG module.

tests/instruments/zurich_instruments/test_hdawg.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,26 +1489,6 @@ def test_get_awg_module_index(self):
14891489
self._awg_module.awg.raw_module.getInt.assert_called_once_with("index")
14901490
self.assertEqual(3, index)
14911491

1492-
def test_set_awg_module_index(self):
1493-
"""Test setting AWG module index with good values."""
1494-
side_effect = [True, False] * 7 # group 0 = 4x, group 1 = 2x, group 2 = 1x
1495-
self._awg_module.finished.side_effect = side_effect + [False, True] # For close
1496-
groupings = list(range(3))
1497-
for grouping in groupings:
1498-
self.hdawg._grouping = grouping
1499-
ok_indexes = list(range((2 - grouping) * 2))
1500-
ok_indexes = [0] if not ok_indexes else ok_indexes
1501-
for index in ok_indexes:
1502-
self.hdawg.set_awg_module_index(index)
1503-
1504-
def test_set_awg_module_index_exceptions(self):
1505-
"""Test setting AWG module index with wrong values w.r.t. grouping."""
1506-
self._awg_module.finished.side_effect = [False, True] # For close
1507-
nok_indexes = [-1, 4]
1508-
for index in nok_indexes:
1509-
with self.assertRaises(ValueError):
1510-
self.hdawg.set_awg_module_index(index)
1511-
15121492
def test_get_awg_enabled(self):
15131493
"""Test getting AWG core enable state."""
15141494
self.hdawg.get_awg_enabled(0)

0 commit comments

Comments
 (0)