Skip to content

Commit f44bf1e

Browse files
committed
Add support for NumPy 2.0
1 parent 3d108af commit f44bf1e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

plotpy/items/curve/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ def set_data(self, x: np.ndarray, y: np.ndarray) -> None:
388388
this method is called to update decimated data (i.e. only update 1/N value
389389
with N set in CurveItem.param.decimation).
390390
"""
391-
self._x = np.array(x, copy=False)
392-
self._y = np.array(y, copy=False)
391+
self._x = np.asarray(x)
392+
self._y = np.asarray(y)
393393
self._setData(self._x, self._y)
394394

395395
def is_empty(self) -> bool:

plotpy/items/curve/errorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ def set_data(
144144
"""
145145
CurveItem.set_data(self, x, y)
146146
if dx is not None:
147-
dx = np.array(dx, copy=False)
147+
dx = np.asarray(dx)
148148
if dx.size == 0:
149149
dx = None
150150
if dy is not None:
151-
dy = np.array(dy, copy=False)
151+
dy = np.asarray(dy)
152152
if dy.size == 0:
153153
dy = None
154154
self._dx = dx

plotpy/items/polygonmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ def set_data(self, pts, n, c):
264264
* x: NumPy array
265265
* y: NumPy array
266266
"""
267-
self._pts = np.array(pts, copy=False)
268-
self._n = np.array(n, copy=False)
269-
self._c = np.array(c, copy=False)
267+
self._pts = np.asarray(pts)
268+
self._n = np.asarray(n)
269+
self._c = np.asarray(c)
270270
xmin, ymin = self._pts.min(axis=0)
271271
xmax, ymax = self._pts.max(axis=0)
272272
self.bounds = QC.QRectF(xmin, ymin, xmax - xmin, ymax - ymin)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# plotpy setup configuration file
22

33
[build-system]
4-
requires = ["setuptools", "wheel", "cython ~= 0.29.0", "numpy >= 1.17"]
4+
requires = ["setuptools", "wheel", "cython ~= 0.29.0", "numpy >= 2.0.0"]
55
build-backend = "setuptools.build_meta"
66

77
[project]

0 commit comments

Comments
 (0)