Skip to content

Commit 0e85f73

Browse files
Fix bug where FunctionRunner functions were sorted by name
Instead of remaining in the order they were added. Functions are intended to be sorted by time, but not by anything else. But naively sorting the tuples caused them to be sorted unintentionally by name if they had the same time.
1 parent 75b175d commit 0e85f73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

labscript_devices/FunctionRunner/labscript_devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def func(shot_context, t, ...):
9090
def generate_code(self, hdf5_file):
9191
# Python's sorting is stable, so items with equal times will remain in the order
9292
# they were added
93-
self.functions.sort()
93+
self.functions.sort(key=lambda item: item[0])
9494
vlenstr = h5py.special_dtype(vlen=str)
9595
table_dtypes = [
9696
('t', float),

0 commit comments

Comments
 (0)