|
4 | 4 | Dict, |
5 | 5 | Iterable, |
6 | 6 | Optional, |
7 | | - OrderedDict, |
8 | 7 | Tuple, |
9 | 8 | Union, |
10 | 9 | Sequence, |
11 | 10 | Callable, |
12 | 11 | TYPE_CHECKING |
13 | 12 | ) |
14 | | -from collections import namedtuple |
| 13 | +from collections import namedtuple, OrderedDict |
15 | 14 | from qcodes.instrument.parameter import ( |
16 | 15 | DelegateParameter, |
17 | 16 | ParamDataType, |
@@ -46,33 +45,33 @@ def __init__( |
46 | 45 |
|
47 | 46 |
|
48 | 47 | class DelegateGroup(Group): |
49 | | - """The DelegateGroup combines :class:`.DelegateParameter`s that |
| 48 | + """The DelegateGroup combines :class:`.DelegateParameter` s that |
50 | 49 | are to be gotten or set using one :class:`.GroupedParameter`. |
51 | 50 | Each :class:`.DelegateParameter` maps to one source parameter |
52 | 51 | that is individually set or gotten on an instrument. These |
53 | 52 | parameters can originate from the same or different instruments. |
54 | 53 |
|
55 | 54 | The class :class:`.DelegateGroup` is used within the |
56 | 55 | :class:`GroupedParameter` class in order to get and set the |
57 | | - :class:`.DelegateParameter`s either via their default get and set |
| 56 | + :class:`.DelegateParameter` s either via their default get and set |
58 | 57 | methods or via a custom get or set method. |
59 | 58 |
|
60 | 59 | The value to be set can be passed to the set method either via a |
61 | 60 | dictionary, where the keys are the names of the |
62 | | - :class:`.DelegateParameter`s contained in the :class:`DelegateGroup`, |
| 61 | + :class:`.DelegateParameter` s contained in the :class:`DelegateGroup`, |
63 | 62 | or a single value, if a custom setter is defined or if the group |
64 | 63 | only contains a single :class:`.DelegateParameter`. |
65 | 64 |
|
66 | 65 | The value returned by the get method is passed through a formatter. |
67 | 66 | By default, the formatter returns the :class:`.DelegateParameter` |
68 | 67 | values in a namedtuple, where the keys are the names of the |
69 | | - :class:`.DelegateParameter`s. In the special case where the |
| 68 | + :class:`.DelegateParameter` s. In the special case where the |
70 | 69 | :class:`.DelegateGroup` only contains one :class:`.DelegateParameter`, |
71 | 70 | the formatter simply returns the individual value. Optionally, |
72 | 71 | the formatter can be customized and specified via the constructor. |
73 | | - The formatter takes as input the values of the :class:`.DelegateParameter`s |
| 72 | + The formatter takes as input the values of the :class:`.DelegateParameter` s |
74 | 73 | as positional arguments in the order at which the |
75 | | - :class:`.DelegateParameter`s are specified. |
| 74 | + :class:`.DelegateParameter` s are specified. |
76 | 75 |
|
77 | 76 | Args: |
78 | 77 | name: Name of the DelegateGroup |
@@ -157,12 +156,12 @@ def source_parameters(self) -> Tuple[Optional[Parameter], ...]: |
157 | 156 |
|
158 | 157 | class GroupedParameter(_BaseParameter): |
159 | 158 | """ |
160 | | - The GroupedParameter wraps one or more :class:`.DelegateParameter`s, |
| 159 | + The GroupedParameter wraps one or more :class:`.DelegateParameter` s, |
161 | 160 | such that those parameters can be accessed as if they were one |
162 | 161 | parameter. |
163 | 162 |
|
164 | 163 | The :class:`GroupedParameter` uses a :class:`DelegateGroup` to keep |
165 | | - track of the :class:`.DelegateParameter`s. Mainly, this class is a |
| 164 | + track of the :class:`.DelegateParameter` s. Mainly, this class is a |
166 | 165 | thin wrapper around the :class:`DelegateGroup`, and mainly exists |
167 | 166 | in order to allow for it to be used as a :class:`_BaseParameter`. |
168 | 167 |
|
|
0 commit comments