Skip to content

Commit 4506af9

Browse files
committed
fixed bug in DataArrayModel.reset_min_max(): added AssertionError in except list
1 parent b07663b commit 4506af9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

larray_editor/arraymodel.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,11 @@ def reset_minmax(self):
286286
self.bgcolor_enabled = True
287287
self.bg_gradient = LinearGradient([(self.vmin, self.hsv_min), (self.vmax, self.hsv_max)])
288288

289-
# ValueError for empty arrays
290-
except (TypeError, ValueError):
289+
# a) ValueError for empty arrays
290+
# b) AssertionError for fail of LinearGradient.init
291+
# -> for very large float number (e.g. 1664780726569649730), doing self.vmin -= 1 does nothing.
292+
# Then, vman = vmin and LinearGradient.init fails
293+
except (TypeError, ValueError, AssertionError):
291294
self.vmin = None
292295
self.vmax = None
293296
self.bgcolor_enabled = False

0 commit comments

Comments
 (0)