Skip to content

Commit 50e4391

Browse files
committed
ErrorBarCurveItem: handle DeprecationWarning conversion (NumPy)
1 parent 4ef2dae commit 50e4391

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

plotpy/items/curve/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def _get_visible_axis_min(self, axis_id: int, axis_data: np.ndarray) -> float:
138138
"""
139139
if self.plot().get_axis_scale(axis_id) == "log":
140140
if len(axis_data[axis_data > 0]) == 0:
141-
return 0
141+
return 0.0
142142
else:
143143
return axis_data[axis_data > 0].min()
144144
else:

plotpy/items/curve/errorbar.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,18 @@ def set_data(
163163
self._dy = dy
164164
self.__minmaxarrays = {}
165165

166-
def get_minmax_arrays(self, all_values: bool = True) -> tuple[float, ...]:
166+
def get_minmax_arrays(
167+
self, all_values: bool = True
168+
) -> tuple[
169+
np.ndarray[float], np.ndarray[float], np.ndarray[float], np.ndarray[float]
170+
]:
167171
"""Get min/max arrays
168172
169173
Args:
170174
all_values: If True, return all values, else return only finite values
171175
172176
Returns:
173-
tuple[float, ...]: Min/max arrays
177+
Min/max arrays
174178
"""
175179
if self.__minmaxarrays.get(all_values) is None:
176180
x = self.dsamp(self._x)
@@ -256,12 +260,6 @@ def boundingRect(self) -> QC.QRectF:
256260
else:
257261
xmin = xminf.min()
258262
ymin = yminf.min()
259-
260-
xmin = np.float64(xmin)
261-
ymin = np.float64(ymin)
262-
xmax = np.float64(xmax)
263-
ymax = np.float64(ymax)
264-
265263
return QC.QRectF(xmin, ymin, xmaxf.max() - xmin, ymaxf.max() - ymin)
266264

267265
def draw(

0 commit comments

Comments
 (0)