File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -136,12 +136,7 @@ def autoset_widget_bins(self, data: npt.NDArray[Any]) -> None:
136136 """Update widgets with bins determined from the image data"""
137137 if data .dtype .kind in {"i" , "u" }:
138138 # Make sure integer data types have integer sized bins
139- # We can't use unsigned ints when calculating the step, otherwise
140- # the following warning is raised:
141- # 'RuntimeWarning: overflow encountered in scalar subtract'
142- step = abs (
143- np .min (data ).astype (int ) - np .max (data ).astype (int ) // 100
144- )
139+ step = abs (np .max (data ) - np .min (data )) // 100
145140 step = max (1 , step )
146141 bins = np .arange (np .min (data ), np .max (data ) + step , step )
147142 else :
@@ -213,7 +208,7 @@ def draw(self) -> None:
213208 # whole cube into memory.
214209 if data .dtype .kind in {"i" , "u" }:
215210 # Make sure integer data types have integer sized bins
216- step = abs (( self .bins_start - self .bins_stop ) // self .bins_num )
211+ step = abs (self .bins_stop - self .bins_start ) // self .bins_num
217212 step = max (1 , step )
218213 bins = np .arange (self .bins_start , self .bins_stop + step , step )
219214 else :
You can’t perform that action at this time.
0 commit comments