Skip to content

Commit 923f751

Browse files
authored
updates to various_fixes changes in main (#253)
* fix: early stopping in Experiment.run() * extra break check before continue for reallocating scans
1 parent baa2f79 commit 923f751

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pyscan/measurement/experiment.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,19 @@ def run(self):
8686
self.preallocate(data)
8787
elif (self.runinfo.has_continuous_scan) and (deltas[-1] == 1):
8888
self.reallocate(data)
89+
# early terminate here
90+
if not self.runinfo.running:
91+
break
8992
continue # saving is handled here
9093
elif self.runinfo.has_average_scan:
9194
self.rolling_average(data)
9295

9396
self.save_point(data)
9497

98+
# early terminate here
99+
if not self.runinfo.running:
100+
break
101+
95102
self.runinfo.complete = True
96103
self.runinfo.running = False
97104

0 commit comments

Comments
 (0)