Skip to content

Commit 18c8bb5

Browse files
committed
use min/max instead of nanmin/nanmax because nans are already filtered out by isfinite
1 parent 6e0bf10 commit 18c8bb5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

larray_editor/arraymodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ def reset_minmax(self):
272272
color_value = self.color_func(data) if self.color_func is not None else data
273273
# ignore nan, -inf, inf (setting them to 0 or to very large numbers is not an option)
274274
color_value = color_value[np.isfinite(color_value)]
275-
self.vmin = float(np.nanmin(color_value))
276-
self.vmax = float(np.nanmax(color_value))
275+
self.vmin = float(np.min(color_value))
276+
self.vmax = float(np.max(color_value))
277277
self.bgcolor_possible = True
278278
# ValueError for empty arrays, TypeError for object/string arrays
279279
except (TypeError, ValueError):

larray_editor/arraywidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def format_helper(self, data):
864864
if not data.size:
865865
return 0, 0, False
866866
data = np.where(np.isfinite(data), data, 0)
867-
vmin, vmax = np.nanmin(data), np.nanmax(data)
867+
vmin, vmax = np.min(data), np.max(data)
868868
absmax = max(abs(vmin), abs(vmax))
869869
logabsmax = math.log10(absmax) if absmax else 0
870870
# minimum number of zeros before meaningful fractional part

0 commit comments

Comments
 (0)