@@ -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