Skip to content

Commit 29483ca

Browse files
committed
1 parent 9e0a35f commit 29483ca

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

apstools/plans.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,14 +579,16 @@ class Results(Device):
579579
crossings = Component(Signal)
580580
peakstats_attrs = "x y cen com fwhm min max crossings".split()
581581

582-
def report(self):
582+
def report(self, title=None):
583583
keys = self.peakstats_attrs + "tune_ok center initial_position final_position".split()
584584
t = pyRestTable.Table()
585585
t.addLabel("key")
586-
t.addLabel("PeakStats value")
586+
t.addLabel("result")
587587
for key in keys:
588588
v = getattr(self, key).value
589589
t.addRow((key, v))
590+
if title is not None:
591+
print(title)
590592
print(t)
591593

592594
@bpp.subs_decorator(self.peaks)
@@ -626,11 +628,17 @@ def _scan(md=None):
626628
v = np.array(v)
627629
getattr(results, key).put(v)
628630

629-
results.report()
631+
results.report(stream_name)
630632

631633
if results.tune_ok.value:
632634
yield from bps.create(name=stream_name)
633-
yield from bps.read(results)
635+
try:
636+
yield from bps.read(results)
637+
except ValueError as ex:
638+
separator = " "*8 + "-"*12
639+
print(separator)
640+
print(f"Error saving stream {stream_name}:\n{ex}")
641+
print(separator)
634642
yield from bps.save()
635643

636644
yield from bps.mv(self.axis, final_position)

0 commit comments

Comments
 (0)