[minor] corrected some coding mistakes, added some requirements
This commit is contained in:
1 parent
81240a8ffe
commit
ca56139922
8 files changed
+20
-19
No files matched your search
@@ -5,8 +5,6 @@ import sys
|
||||
import os
|
||||
import matplotlib
|
||||
|
||||
matplotlib.use('Qt5Agg')
|
||||
|
||||
from PySide2 import QtCore, QtGui, QtWidgets
|
||||
from PySide2.QtCore import Qt
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
@@ -29,6 +27,9 @@ from scipy.interpolate import griddata
|
||||
from pylot.core.util.widgets import PickDlg
|
||||
from pylot.core.pick.utils import get_quality_class
|
||||
|
||||
matplotlib.use('Qt5Agg')
|
||||
|
||||
|
||||
|
||||
class MplCanvas(FigureCanvas):
|
||||
|
||||
@@ -49,7 +50,7 @@ class Array_map(QtWidgets.QWidget):
|
||||
# super(Array_map, self).__init__(parent)
|
||||
QtWidgets.QWidget.__init__(self)
|
||||
|
||||
assert (parameter != None or parent != None), 'either parent or parameter has to be set'
|
||||
assert (parameter is not None or parent is not None), 'either parent or parameter has to be set'
|
||||
# set properties
|
||||
self._parent = parent
|
||||
self.metadata = metadata
|
||||
|
||||
@@ -227,7 +227,7 @@ def findComboBoxIndex(combo_box, val):
|
||||
:type val: basestring
|
||||
:return: index value of item with name val or 0
|
||||
"""
|
||||
return combo_box.findText(val) if combo_box.findText(val) is not -1 else 0
|
||||
return combo_box.findText(val) if combo_box.findText(val) != -1 else 0
|
||||
|
||||
|
||||
def find_in_list(list, str):
|
||||
@@ -1016,7 +1016,7 @@ def scaleWFData(data, factor=None, components='all'):
|
||||
:return: scaled waveform data
|
||||
:rtype: `~obspy.core.stream.Stream` object
|
||||
"""
|
||||
if components is not 'all':
|
||||
if components != 'all':
|
||||
for comp in components:
|
||||
if factor is None:
|
||||
max_val = np.max(np.abs(data.select(component=comp)[0].data))
|
||||
|
||||
Reference in new issue
Block a user