@@ -62,15 +62,6 @@ def __init__(self, parent=None, bg_gradient='red-white-blue', rtol=0, atol=0, na
62
62
63
63
self .arraywidget .btn_layout .addLayout (tolerance_layout )
64
64
65
- if rtol > 0 and atol > 0 :
66
- raise ValueError ("Arguments 'rtol' and 'atol' cannot be used together." )
67
- if rtol > 0 :
68
- self .tolerance_combobox .setCurrentText ("relative" )
69
- self .tolerance_line_edit .setText (str (rtol ))
70
- if atol > 0 :
71
- self .tolerance_combobox .setCurrentText ("absolute" )
72
- self .tolerance_line_edit .setText (str (atol ))
73
-
74
65
self .nans_equal = nans_equal
75
66
76
67
# add local arraywidget to layout
@@ -83,6 +74,15 @@ def __init__(self, parent=None, bg_gradient='red-white-blue', rtol=0, atol=0, na
83
74
self .bg_value = None
84
75
self .stack_axis = None
85
76
77
+ if rtol > 0 and atol > 0 :
78
+ raise ValueError ("Arguments 'rtol' and 'atol' cannot be used together." )
79
+ if rtol > 0 :
80
+ self .tolerance_combobox .setCurrentText ("relative" )
81
+ self .tolerance_line_edit .setText (str (rtol ))
82
+ if atol > 0 :
83
+ self .tolerance_combobox .setCurrentText ("absolute" )
84
+ self .tolerance_line_edit .setText (str (atol ))
85
+
86
86
# override keyPressEvent to prevent pressing Enter after changing the tolerance value
87
87
# in associated QLineEdit to close the parent dialog box
88
88
def keyPressEvent (self , event ):
@@ -111,6 +111,9 @@ def set_data(self, arrays, stack_axis):
111
111
self .update_isequal ()
112
112
113
113
def update_isequal (self ):
114
+ if self .array is None :
115
+ return
116
+
114
117
try :
115
118
tol_str = self .tolerance_line_edit .text ()
116
119
tol = ast .literal_eval (tol_str ) if tol_str else 0
0 commit comments