From 8b741c9102ab6222d9e365aa7277773030080f00 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 28 Oct 2019 16:32:34 +0100 Subject: [PATCH] [bugfix] old parameter default values, especially min/max values remained from older pylot projects --- PyLoT.py | 3 +++ pylot/core/io/default_parameters.py | 2 +- pylot/core/io/inputs.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/PyLoT.py b/PyLoT.py index edb6a9a2..354634f9 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -3511,6 +3511,9 @@ class MainWindow(QMainWindow): self.project = Project.load(fnm) if hasattr(self.project, 'parameter'): if self.project.parameter: + # do this step to update default parameter on older PyLoT projects + self.project.parameter.reinit_default_parameters() + self._inputs = self.project.parameter self.updateFilteroptions() # added for backwards compatibility with older events not having a 'dirty' attribute diff --git a/pylot/core/io/default_parameters.py b/pylot/core/io/default_parameters.py index 026c69c2..cd18a6f0 100644 --- a/pylot/core/io/default_parameters.py +++ b/pylot/core/io/default_parameters.py @@ -466,7 +466,7 @@ defaults = {'rootpath': {'type': str, 'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \ If zeros are set, original Richter magnitude is calculated!', 'value': (0., 0., 0.), - 'min': (0., 0., 0.), + 'min': (-np.inf, -np.inf, -np.inf), 'max': (np.inf, np.inf, np.inf), 'namestring': ('Wood-Anderson scaling', '', '', '')}, diff --git a/pylot/core/io/inputs.py b/pylot/core/io/inputs.py index 1e8effd0..6f2528bd 100644 --- a/pylot/core/io/inputs.py +++ b/pylot/core/io/inputs.py @@ -194,6 +194,9 @@ class PylotParameter(object): all_names += self.get_special_para_names()['quality'] return all_names + def reinit_default_parameters(self): + self.__init_default_paras() + @staticmethod def check_range(value, max_value, min_value): """