Skip to content

Commit 99507ac

Browse files
committed
FIX: fixed compare() background color for two equal integer arrays (closes #246)
1 parent 62d6ea9 commit 99507ac

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/source/changes/version_0_34.rst.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ Fixes
7373
again. This makes for an odd behavior but at least cleans up the program properly (closes :editor_issue:`231`).
7474

7575
* when save command history fails, do not do so silently. Closes :editor_issue:`225`.
76+
77+
* fixed compare() background color being red for two equal integer arrays instead of white
78+
(closes :editor_issue:`246`).

larray_editor/comparator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@ def update_isequal(self):
139139
# scale reldiff to range 0-1 with 0.5 for reldiff = 0
140140
self.bg_value = (reldiff / maxabsreldiff) / 2 + 0.5
141141
else:
142-
self.bg_value = la.full_like(self.array, 0.5)
142+
# do NOT use full_like as we don't want to inherit array dtype
143+
self.bg_value = la.full(self.array.axes, 0.5)
143144
except TypeError:
144145
# str/object array
145146
maxabsreldiff = la.nan
146-
self.bg_value = la.full_like(self.array, 0.5)
147+
# do NOT use full_like as we don't want to inherit array dtype
148+
self.bg_value = la.full(self.array.axes, 0.5)
147149

148150
self.maxdiff_label.setText(str(maxabsreldiff))
149151
self.display(self.diff_checkbox.isChecked())

0 commit comments

Comments
 (0)