add FID as fallback option for dtype in nmrreader

This commit is contained in:
Dominik Demuth 2023-05-19 16:56:01 +02:00
parent 84d136dd4c
commit cd9c85c12b

View File

@ -53,11 +53,17 @@ class NMRReader:
states = pickle.load(fp) states = pickle.load(fp)
datalist = OrderedDict() datalist = OrderedDict()
_dtypes = {'pts': Points, 'fit': FitResult, 'fid': FID, 'bds': BDS, 'dsc': DSC} _dtypes = {'pts': Points,
'fit': FitResult,
'fid': FID,
'bds': BDS,
'dsc': DSC,
'spectrum': Spectrum
}
for s in states['sets']: for s in states['sets']:
set_id = s.pop('id') set_id = s.pop('id')
dtype = _dtypes[s.pop('mode')] dtype = _dtypes.get(s.pop('mode'), FID)
data = dtype.set_state(s.pop('data')) data = dtype.set_state(s.pop('data'))
datalist[set_id] = (data, s) datalist[set_id] = (data, s)