Skip to content

Commit

Permalink
revert(measurement): restoring main version of run_info.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbrost committed Sep 18, 2024
1 parent b341479 commit 9d3558e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pyscan/measurement/run_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ def __init__(self):
self.average_d = -1

self.verbose = False
try:
self._pyscan_version = get_pyscan_version()
except:
pass
self._pyscan_version = get_pyscan_version()

def check(self):
'''Checks to see if runinfo is properly formatted. Called by Experiment object's `run()` methods.
Expand All @@ -91,6 +88,20 @@ def check(self):
if num_av_scans > 1:
assert False, "More than one average scan is not allowed"

# make sure there are no empty scans inbetween used scans.
used_scan_found = False
scans = self.scans
for i in range(len(scans)):
count_down = len(scans) - i - 1
if used_scan_found is False:
if not (isinstance(scans[count_down], PropertyScan) and len(scans[count_down].input_dict) == 0):
used_scan_found = True
used_scan_index = count_down
else:
assert not (isinstance(scans[count_down], PropertyScan) and len(scans[count_down].input_dict) == 0), \
(f"Found empty PropertyScan (scan{count_down}) below used scan (scan{used_scan_index}).\n"
+ "Scans must be populated in sequential order.")

@property
def scans(self):
''' Returns array of all scans
Expand Down

0 comments on commit 9d3558e

Please sign in to comment.