@@ -23,10 +23,10 @@ def __init__(self, parent=None):
23
23
maxdiff_layout .addStretch ()
24
24
layout .addLayout (maxdiff_layout )
25
25
26
- self .arraywidget = ArrayEditorWidget (self , np . array ([]) , readonly = True , bg_gradient = 'red-white-blue' )
26
+ self .arraywidget = ArrayEditorWidget (self , data = None , readonly = True , bg_gradient = 'red-white-blue' )
27
27
28
28
diff_checkbox = QCheckBox (_ ('Differences Only' ))
29
- diff_checkbox .stateChanged .connect (self .show_differences_only )
29
+ diff_checkbox .stateChanged .connect (self .display )
30
30
self .diff_checkbox = diff_checkbox
31
31
self .arraywidget .btn_layout .addWidget (diff_checkbox )
32
32
@@ -72,11 +72,10 @@ def set_data(self, arrays, stack_axis):
72
72
self .bg_value = full_like (self .array , 0.5 )
73
73
74
74
self .maxdiff_label .setText (str (maxabsreldiff ))
75
- self .arraywidget . set_data (self .array , bg_value = self . bg_value )
75
+ self .display (self .diff_checkbox . isChecked () )
76
76
77
- def show_differences_only (self , yes ):
78
- if yes :
79
- # only show rows with a difference. For some reason, this is abysmally slow though.
77
+ def display (self , diff_only ):
78
+ if diff_only :
80
79
row_filter = (~ self .isequal ).any (self .stack_axis .name )
81
80
self .arraywidget .set_data (self .array [row_filter ], bg_value = self .bg_value [row_filter ])
82
81
else :
0 commit comments