From f8b2a1368f998f126f308d9491490e7c3e658e5d Mon Sep 17 00:00:00 2001 From: Keara Soloway Date: Tue, 8 Oct 2024 11:10:34 -0400 Subject: [PATCH] fix: handle default values of detectors and detector_ids in edd.SetupNXdataReader and edd.UpdateNXdataReader --- CHAP/edd/reader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHAP/edd/reader.py b/CHAP/edd/reader.py index c15c30b..177551d 100755 --- a/CHAP/edd/reader.py +++ b/CHAP/edd/reader.py @@ -518,6 +518,8 @@ def read(self, filename, dataset_id, detectors=None): :rtype: dict """ from CHAP.common.models.map import DetectorConfig + if detectors is None: + detectors = [] detector_config = DetectorConfig(detectors=detectors) # Columns in input .txt file: # 0: scan number @@ -783,6 +785,8 @@ def read(self, spec_file, scan_number, detector_ids=None, inputdir='.'): f'dataset_point_index_offset = {dataset_point_index_offset}') # Get full data point for every point in the scan + if detector_ids is None: + detector_ids = [] detector_data = scanparser.get_detector_data(detector_ids) detector_data = {_id: detector_data[:,i,:] for i, _id in enumerate(detector_ids)}