Skip to content

Commit f9f585d

Browse files
committed
Merge pull request #122 from labscript-suite/blacs-connection-bug
Don't have all devices have a BLACS_connection
1 parent 4dbad20 commit f9f585d

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

labscript/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def __init__(
9393
self.connection = connection
9494
self.start_order = start_order
9595
self.stop_order = stop_order
96-
self.BLACS_connection = ""
9796
if start_order is not None and not isinstance(start_order, int):
9897
raise TypeError(
9998
f"Error when instantiating {name}. start_order must be an integer, not "

labscript/labscript.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,6 @@ def generate_connection_table(hdf5_file):
228228
connection_table = []
229229
devicedict = {}
230230

231-
# Only use a string dtype as long as is needed:
232-
max_BLACS_conn_length = 0
233-
234231
for device in compiler.inventory:
235232
devicedict[device.name] = device
236233

@@ -244,8 +241,6 @@ def generate_connection_table(hdf5_file):
244241
if hasattr(device,"BLACS_connection"):
245242
# Make sure it is a string!
246243
BLACS_connection = str(device.BLACS_connection)
247-
if len(BLACS_connection) > max_BLACS_conn_length:
248-
max_BLACS_conn_length = len(BLACS_connection)
249244
else:
250245
BLACS_connection = ""
251246

@@ -269,11 +264,17 @@ def generate_connection_table(hdf5_file):
269264

270265
connection_table.sort()
271266
vlenstring = h5py.special_dtype(vlen=str)
272-
connection_table_dtypes = [('name','a256'), ('class','a256'), ('parent','a256'), ('parent port','a256'),
273-
('unit conversion class','a256'), ('unit conversion params', vlenstring),
274-
('BLACS_connection','a'+str(max_BLACS_conn_length)),
275-
('properties', vlenstring)]
276-
connection_table_array = empty(len(connection_table),dtype=connection_table_dtypes)
267+
connection_table_dtypes = [
268+
('name', "a256"),
269+
('class', vlenstring),
270+
('parent', vlenstring),
271+
('parent port', vlenstring),
272+
('unit conversion class', vlenstring),
273+
('unit conversion params', vlenstring),
274+
('BLACS_connection', vlenstring),
275+
('properties', vlenstring),
276+
]
277+
connection_table_array = empty(len(connection_table), dtype=connection_table_dtypes)
277278
for i, row in enumerate(connection_table):
278279
connection_table_array[i] = row
279280
dataset = hdf5_file.create_dataset('connection table', compression=compiler.compression, data=connection_table_array, maxshape=(None,))

0 commit comments

Comments
 (0)