From 259ea85de890fc67e1a6bbdac4e78543bbcb1253 Mon Sep 17 00:00:00 2001 From: spielman Date: Tue, 25 Jun 2024 09:29:49 -0400 Subject: [PATCH] Move one object update out of the h5 block (for slight speedup if h5lock is blocking) and changed create_group to require_group to allow more than one process to work. --- labscript_devices/TekScope/blacs_workers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/labscript_devices/TekScope/blacs_workers.py b/labscript_devices/TekScope/blacs_workers.py index b97afd5f..ae2cc79c 100644 --- a/labscript_devices/TekScope/blacs_workers.py +++ b/labscript_devices/TekScope/blacs_workers.py @@ -27,7 +27,8 @@ def transition_to_buffered(self, device_name, h5file, front_panel_values, refres self.scope_params = labscript_utils.properties.get( hdf5_file, device_name, 'device_properties' ) - self.scope.dev.timeout = 1000 * self.scope_params.get('timeout', 5) + + self.scope.dev.timeout = 1000 * self.scope_params.get('timeout', 5) self.scope.unlock() self.scope.set_acquire_state(True) @@ -61,10 +62,11 @@ def transition_to_manual(self): # Open the file after download so as not to hog the file lock with h5py.File(self.h5file, 'r+') as hdf_file: - grp = hdf_file.create_group('/data/traces') + grp = hdf_file.require_group('/data/traces') print('Saving traces...') dset = grp.create_dataset(self.device_name, data=data) dset.attrs.update(wfmp[ch]) + print('Done!') return True