[bugfix] old parameter default values, especially min/max values remained from older pylot projects
This commit is contained in:
parent
0ef2afa775
commit
8b741c9102
3
PyLoT.py
3
PyLoT.py
@ -3511,6 +3511,9 @@ class MainWindow(QMainWindow):
|
|||||||
self.project = Project.load(fnm)
|
self.project = Project.load(fnm)
|
||||||
if hasattr(self.project, 'parameter'):
|
if hasattr(self.project, 'parameter'):
|
||||||
if 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._inputs = self.project.parameter
|
||||||
self.updateFilteroptions()
|
self.updateFilteroptions()
|
||||||
# added for backwards compatibility with older events not having a 'dirty' attribute
|
# added for backwards compatibility with older events not having a 'dirty' attribute
|
||||||
|
@ -466,7 +466,7 @@ defaults = {'rootpath': {'type': str,
|
|||||||
'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \
|
'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \
|
||||||
If zeros are set, original Richter magnitude is calculated!',
|
If zeros are set, original Richter magnitude is calculated!',
|
||||||
'value': (0., 0., 0.),
|
'value': (0., 0., 0.),
|
||||||
'min': (0., 0., 0.),
|
'min': (-np.inf, -np.inf, -np.inf),
|
||||||
'max': (np.inf, np.inf, np.inf),
|
'max': (np.inf, np.inf, np.inf),
|
||||||
'namestring': ('Wood-Anderson scaling', '', '', '')},
|
'namestring': ('Wood-Anderson scaling', '', '', '')},
|
||||||
|
|
||||||
|
@ -194,6 +194,9 @@ class PylotParameter(object):
|
|||||||
all_names += self.get_special_para_names()['quality']
|
all_names += self.get_special_para_names()['quality']
|
||||||
return all_names
|
return all_names
|
||||||
|
|
||||||
|
def reinit_default_parameters(self):
|
||||||
|
self.__init_default_paras()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_range(value, max_value, min_value):
|
def check_range(value, max_value, min_value):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user