From cd9c85c12bfd1103e2827db7d26b6073f6cd9150 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 19 May 2023 16:56:01 +0200 Subject: [PATCH] add FID as fallback option for dtype in nmrreader --- src/nmreval/io/nmrreader.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nmreval/io/nmrreader.py b/src/nmreval/io/nmrreader.py index 0a33339..18bae10 100644 --- a/src/nmreval/io/nmrreader.py +++ b/src/nmreval/io/nmrreader.py @@ -53,11 +53,17 @@ class NMRReader: states = pickle.load(fp) 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']: set_id = s.pop('id') - dtype = _dtypes[s.pop('mode')] + dtype = _dtypes.get(s.pop('mode'), FID) data = dtype.set_state(s.pop('data')) datalist[set_id] = (data, s)