From 09b8cdd3298bce68adcb585510391ef9485ae498 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 15 Feb 2021 13:17:51 -0600 Subject: [PATCH] Remove usage of deprecated np.PYTYPE type aliases --- pyopencl/array.py | 4 ++-- test/test_array.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyopencl/array.py b/pyopencl/array.py index e5cdda02..874ae92c 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -499,7 +499,7 @@ class Array: # }}} - assert dtype != np.object, \ + assert dtype != object, \ "object arrays on the compute device are not allowed" assert isinstance(shape, tuple) assert isinstance(strides, tuple) @@ -2084,7 +2084,7 @@ def to_device(queue, ary, allocator=None, async_=None, # }}} - if ary.dtype == np.object: + if ary.dtype == object: raise RuntimeError("to_device does not work on object arrays.") if array_queue is _same_as_transfer: diff --git a/test/test_array.py b/test/test_array.py index 899fc238..deb6ac28 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -1469,18 +1469,18 @@ def test_negative_dim_rejection(ctx_factory): queue = cl.CommandQueue(context) with pytest.raises(ValueError): - cl_array.Array(queue, shape=-10, dtype=np.float) + cl_array.Array(queue, shape=-10, dtype=np.float64) with pytest.raises(ValueError): - cl_array.Array(queue, shape=(-10,), dtype=np.float) + cl_array.Array(queue, shape=(-10,), dtype=np.float64) for left_dim in (-1, 0, 1): with pytest.raises(ValueError): - cl_array.Array(queue, shape=(left_dim, -1), dtype=np.float) + cl_array.Array(queue, shape=(left_dim, -1), dtype=np.float64) for right_dim in (-1, 0, 1): with pytest.raises(ValueError): - cl_array.Array(queue, shape=(-1, right_dim), dtype=np.float) + cl_array.Array(queue, shape=(-1, right_dim), dtype=np.float64) @pytest.mark.parametrize("empty_shape", [0, (), (3, 0, 2), (0, 5), (5, 0)]) -- GitLab