Skip to content

Commit 5802536

Browse files
DummyPseudoclock: Function renames and comments for clarity
1 parent abd528f commit 5802536

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

DummyPseudoclock.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def start_run(self, notify_queue):
6161

6262
@define_state(MODE_BUFFERED,True)
6363
def wait_until_done(self, notify_queue):
64-
done = yield(self.queue_work(self.primary_worker, 'wait_until_done'))
64+
"""Call check_if_done repeatedly in the worker until the shot is complete"""
65+
done = yield(self.queue_work(self.primary_worker, 'check_if_done'))
6566
# Experiment is over. Tell the queue manager about it:
6667
if done:
6768
notify_queue.put('done')
@@ -83,8 +84,9 @@ def transition_to_buffered(self, device_name, h5file, initial_values, fresh):
8384
self.stop_time = props.get('stop_time', None) # stop_time may be absent if we are not the master pseudoclock
8485
return {}
8586

86-
def wait_until_done(self):
87-
# Wait up to 1 second or until the shot is done:
87+
def check_if_done(self):
88+
# Wait up to 1 second for the shot to be done, returning True if it is
89+
# or False if not.
8890
if getattr(self, 'start_time', None) is None:
8991
self.start_time = time.time()
9092
timeout = min(self.start_time + self.stop_time - time.time(), 1)

0 commit comments

Comments
 (0)