[bugfix] old parameter default values, especially min/max values remained from older pylot projects

This commit is contained in:
Marcel Paffrath 2019-10-28 16:32:34 +01:00
parent 0ef2afa775
commit 8b741c9102
3 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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', '', '', '')},

View File

@ -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):
"""