Skip to content

Commit c9b90b2

Browse files
committed
Fix imports and typos
1 parent 2d7a72c commit c9b90b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

labscript_devices/PrawnBlaster/blacs_workers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import time
1414
import labscript_utils.h5_lock
1515
import h5py
16+
import numpy as np
1617
from blacs.tab_base_classes import Worker
1718
from labscript_utils.connections import _ensure_str
1819
import labscript_utils.properties as properties
@@ -38,6 +39,7 @@ def init(self):
3839
global time; import time
3940
global re; import re
4041
global numpy; import numpy
42+
global struct; import struct
4143
global zprocess; import zprocess
4244
self.smart_cache = {}
4345
self.cached_pll_params = {}
@@ -292,6 +294,7 @@ def transition_to_buffered(self, device_name, h5file, initial_values, fresh):
292294

293295
# Program instructions
294296
for pseudoclock, pulse_program in enumerate(pulse_programs):
297+
total_inst = len(pulse_program)
295298
# check if it is more efficient to fully refresh
296299
if not fresh and self.smart_cache[pseudoclock] is not None:
297300
# get more convenient handles to smart cache arrays
@@ -308,7 +311,7 @@ def transition_to_buffered(self, device_name, h5file, initial_values, fresh):
308311
val_diffs = np.sum(curr_inst != pulse_program[:n_curr])
309312
new_inst = val_diffs + n_diff
310313
else:
311-
new_inst = np.sum(curr_inst != inst)
314+
new_inst = np.sum(curr_inst != pulse_program)
312315

313316
if new_inst / total_inst > 0.1:
314317
fresh = True

0 commit comments

Comments
 (0)