From 902a35b71abaa6a136592814a6ffc1222442b18f Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Wed, 27 Sep 2023 18:06:53 +0200 Subject: [PATCH] check if Default.agr knows what a graph is; helps with #124 --- src/nmreval/fit/minimizer.py | 4 ++-- src/nmreval/io/graceeditor.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nmreval/fit/minimizer.py b/src/nmreval/fit/minimizer.py index 2b8bf54..fb6bcc5 100644 --- a/src/nmreval/fit/minimizer.py +++ b/src/nmreval/fit/minimizer.py @@ -278,7 +278,7 @@ class FitRoutine(object): data._model = self.fit_model self._no_own_model.append(data) - data.parameter.prepare_bounds() + # data.parameter.prepare_bounds() return self._prep_parameter(data.parameter) @@ -309,7 +309,7 @@ class FitRoutine(object): for k, v in data.model.parameter.items(): data.replace_parameter(k, v) - data.parameter.prepare_bounds() + # data.parameter.prepare_bounds() actual_pars = [] for i, p_k in enumerate(data.para_keys): diff --git a/src/nmreval/io/graceeditor.py b/src/nmreval/io/graceeditor.py index f657f68..47cbbac 100644 --- a/src/nmreval/io/graceeditor.py +++ b/src/nmreval/io/graceeditor.py @@ -207,6 +207,9 @@ class GraceEditor: self.graphs[-1].append(line) + if len(self.defaults.graphs) == 0: + raise ValueError(f'Default Grace file in {config_paths().joinpath("Default.agr")} has no information about graphs, please replace this file') + self._fix_tuda_colors() def _make_graph(self, line: str):