Skip to content

Commit a0c9029

Browse files
committed
Fix errors due to DLV changes
1 parent b212894 commit a0c9029

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

qupulse/program/measurement.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def inner_scope(self, scope: Scope) -> Scope:
104104
process."""
105105
if self._ranges:
106106
name, rng = self._ranges[-1]
107-
return scope.overwrite({name: DynamicLinearValue(base=rng.start, offsets={name: rng.step})})
107+
return scope.overwrite({name: DynamicLinearValue(base=rng.start, factors={name: rng.step})})
108108
else:
109109
return scope
110110

@@ -169,7 +169,7 @@ def time_reversed(self) -> ContextManager['ProgramBuilder']:
169169
self._frames[-1].keep = True
170170
self._frames[-1].commands.extend(_reversed_commands(frame.commands))
171171

172-
def to_program(self) -> Optional[Program]:
172+
def to_program(self, channels = None) -> Optional[Program]:
173173
"""Further addition of new elements might fail after finalizing the program."""
174174
if self._frames[0].keep:
175175
return MeasurementInstructions(self._frames[0].commands)
@@ -214,7 +214,7 @@ def __init__(self, callback: Callable[[str, float, float], None]):
214214
def _eval_hardware_time(self, t: HardwareTime):
215215
if isinstance(t, DynamicLinearValue):
216216
value = t.base
217-
for (factor_name, factor_val) in t.offsets.items():
217+
for (factor_name, factor_val) in t.factors.items():
218218
count = self._counts[self._memory[factor_name]]
219219
value += factor_val * count
220220
return value

tests/program/measurement_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from qupulse.pulses import *
88
from qupulse.program.measurement import *
9+
from qupulse.program import DynamicLinearValue
910

1011

1112
class SingleRampTest(TestCase):
@@ -16,7 +17,7 @@ def setUp(self):
1617
self.commands = [
1718
LoopLabel(1, 'idx', 200),
1819
Measure('A', 10, 100),
19-
Measure('B', SimpleExpression(base=1, offsets={'idx': 2}), 200),
20+
Measure('B', DynamicLinearValue(base=1, factors={'idx': 2}), 200),
2021
Wait(TimeType(10 ** 6)),
2122
LoopJmp(1)
2223
]

0 commit comments

Comments
 (0)