Skip to content

Commit 222b50f

Browse files
authored
Resolve tests failures with elementwise functions towards numpy 2.0 (#2590)
The PR is follow of #2589 to address remaining issue observing on Windows only. There is data type mismatch in result returned for numpy.power, numpy.floor_divide, numpy.fmod, and numpy.remainder for "numpy < 2.1.0". They return int32, but expected int64. Where dpnp behavior is aligned with "numpy >= 2.1.0".
1 parent bea5156 commit 222b50f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6464
* Resolved the issue in `dpnp.random` functions to allow any value of `size` where each element is castable to `Py_ssize_t` type [#2578](https://github.com/IntelPython/dpnp/pull/2578)
6565
* Resolved `conda build --test` issue in python 3.9 environment [#2583](https://github.com/IntelPython/dpnp/pull/2583)
6666
* Fixed tests for the rounding functions to depend on minimum required numpy version [#2589](https://github.com/IntelPython/dpnp/pull/2589)
67+
* Fixed tests for the ufuncs to depend on minimum required numpy version [#2590](https://github.com/IntelPython/dpnp/pull/2590)
6768

6869
### Security
6970

dpnp/tests/test_mathematical.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,7 @@ def test_discont(self, dt):
19921992
assert result.dtype == ia.dtype == a.dtype
19931993

19941994

1995+
@testing.with_requires("numpy>=2.1.0")
19951996
@pytest.mark.usefixtures("suppress_divide_invalid_numpy_warnings")
19961997
@pytest.mark.parametrize("val_type", [bool, int, float])
19971998
@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True))

dpnp/tests/third_party/cupy/math_tests/test_arithmetic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def check_binary(self, xp):
367367
return y
368368

369369

370+
@testing.with_requires("numpy>=2.1.0")
370371
@testing.parameterize(
371372
*(
372373
testing.product(
@@ -409,6 +410,7 @@ def test_binary(self):
409410
self.check_binary()
410411

411412

413+
@testing.with_requires("numpy>=2.1.0")
412414
@testing.parameterize(
413415
*(
414416
testing.product(
@@ -487,7 +489,7 @@ def test_binary(self):
487489
self.check_binary()
488490

489491

490-
@testing.with_requires("numpy>=2.0")
492+
@testing.with_requires("numpy>=2.1.0")
491493
class TestArithmeticBinary3(ArithmeticBinaryBase):
492494

493495
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)