Skip to content

Commit bea5156

Browse files
authored
Resolve tests failures in rounding functions with numpy 2.0 (#2589)
There is data type mismatch in result returned for the rounding functions, because numpy.ceil, numpy.floor, numpy.trunc, and numpy.fix always returns floating dtype for "numpy < 2.1.0". The dpnp behavior is aligned with "numpy >= 2.1.0", so this PR adds a missing fixture to run the test depending on minimum required numpy version.
1 parent 12c324b commit bea5156

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6363
* Fixed `dpnp.linalg.cond` to always return a real dtype [#2547](https://github.com/IntelPython/dpnp/pull/2547)
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)
66+
* Fixed tests for the rounding functions to depend on minimum required numpy version [#2589](https://github.com/IntelPython/dpnp/pull/2589)
6667

6768
### Security
6869

dpnp/tests/test_mathematical.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,6 +2302,7 @@ def test_projection(self, dtype):
23022302

23032303
@pytest.mark.parametrize("func", ["ceil", "floor", "trunc", "fix"])
23042304
class TestRoundingFuncs:
2305+
@testing.with_requires("numpy>=2.1.0")
23052306
@pytest.mark.parametrize(
23062307
"dt", get_all_dtypes(no_none=True, no_complex=True)
23072308
)

0 commit comments

Comments
 (0)