From 09e415babf23097647f72b878efb36d70cbbf8b3 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Tue, 23 May 2023 19:23:13 +0200 Subject: [PATCH] begin work on gui --- src/gui_qt/dsc/glass_dialog.py | 8 ++++++++ src/nmreval/data/dsc.py | 6 ++---- src/nmreval/io/hdfreader.py | 9 +++++---- 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 src/gui_qt/dsc/glass_dialog.py diff --git a/src/gui_qt/dsc/glass_dialog.py b/src/gui_qt/dsc/glass_dialog.py new file mode 100644 index 0000000..260ba2c --- /dev/null +++ b/src/gui_qt/dsc/glass_dialog.py @@ -0,0 +1,8 @@ +from ..Qt import QtWidgets + + +class TgCalculator(QtWidgets.QDialog): + def __init__(self, parent=None): + super().__init__(parent=parent) + + diff --git a/src/nmreval/data/dsc.py b/src/nmreval/data/dsc.py index a621797..f69dd0f 100644 --- a/src/nmreval/data/dsc.py +++ b/src/nmreval/data/dsc.py @@ -23,10 +23,8 @@ class DSC(Points): y = np.asarray(y).reshape(np.asarray(x).shape) x, unique = np.unique(x, return_index=True) - - if 'y_err' in kwargs: - _yerr = kwargs['y_err'] - _yerr = np.asarray(_yerr).reshape(np.asarray(x).shape) + if kwargs.get('y_err', None) is not None: + _yerr = np.asarray(kwargs['y_err']).reshape(np.asarray(x).shape) kwargs['y_err'] = _yerr[unique] super().__init__(x, y[unique], **kwargs) diff --git a/src/nmreval/io/hdfreader.py b/src/nmreval/io/hdfreader.py index b5b85cb..8c681ce 100644 --- a/src/nmreval/io/hdfreader.py +++ b/src/nmreval/io/hdfreader.py @@ -388,10 +388,11 @@ class HdfReader(HdfNode): if multi: var_key = None - try: - value = param_dic[var_key.lower()] - except KeyError: - pass + if var_key is not None: + try: + value = param_dic[var_key.lower()] + except KeyError: + pass return value