From 84d136dd4c4de70719c84ac9c3ed26905352ea31 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 19 May 2023 16:53:54 +0200 Subject: [PATCH] .nmr files recognize all data types; closes #71 --- src/gui_qt/data/container.py | 4 ++++ src/nmreval/io/nmrreader.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui_qt/data/container.py b/src/gui_qt/data/container.py index 24cf09d..30cdb14 100644 --- a/src/gui_qt/data/container.py +++ b/src/gui_qt/data/container.py @@ -10,6 +10,7 @@ from nmreval.data.points import Points from nmreval.data.signals import Signal from nmreval.utils.text import convert from nmreval.data.bds import BDS +from nmreval.data.dsc import DSC from nmreval.lib.colors import BaseColor, TUColors from nmreval.lib.lines import LineStyle from nmreval.lib.symbols import SymbolStyle, symbolcycle @@ -488,6 +489,9 @@ class PointContainer(ExperimentContainer): self.mode = 'pts' self._init_plot(**kwargs) + if isinstance(self._data, DSC): + self.mode = 'dsc' + def _init_plot(self, **kwargs): self.plot_imag = None diff --git a/src/nmreval/io/nmrreader.py b/src/nmreval/io/nmrreader.py index 2268c8c..0a33339 100644 --- a/src/nmreval/io/nmrreader.py +++ b/src/nmreval/io/nmrreader.py @@ -5,6 +5,8 @@ from collections import OrderedDict from .read_old_nmr import HAS_BSDDB3, _read_file_v1 from ..data.nmr import FID, Spectrum +from ..data.bds import BDS +from ..data.dsc import DSC from ..data.points import Points from ..fit.result import FitResult, FitResultCreator from ..lib.colors import Colors @@ -51,7 +53,7 @@ class NMRReader: states = pickle.load(fp) datalist = OrderedDict() - _dtypes = {'pts': Points, 'fit': FitResult, 'fid': FID} + _dtypes = {'pts': Points, 'fit': FitResult, 'fid': FID, 'bds': BDS, 'dsc': DSC} for s in states['sets']: set_id = s.pop('id')