Skip to content

Commit c3fe479

Browse files
authored
update the test suit for dpnp.fft module (#2071)
* update an FFT test * update changelog.md * disable too-many-arguments error for pylint * fix: too-many-positional-arguments * set a larger value for max-positional-arguments instead of disabling it
1 parent 81144e8 commit c3fe479

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11-
### Change
11+
### Changed
1212

1313
### Fixed
1414

@@ -50,7 +50,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds
5050
* Added implementation of `dpnp.resize` and `dpnp.rot90` functions [#2030](https://github.com/IntelPython/dpnp/pull/2030)
5151
* Added implementation of `dpnp.require` function [#2036](https://github.com/IntelPython/dpnp/pull/2036)
5252

53-
### Change
53+
### Changed
5454

5555
* Extended pre-commit pylint check to `dpnp.fft` module [#1860](https://github.com/IntelPython/dpnp/pull/1860)
5656
* Reworked `vm` vector math backend to reuse `dpctl.tensor` functions around unary and binary functions [#1868](https://github.com/IntelPython/dpnp/pull/1868)
@@ -114,6 +114,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds
114114
* Updated `dpnp.fft` backend to depend on `INTEL_MKL_VERSION` flag to ensures that the appropriate code segment is executed based on the version of OneMKL [#2035](https://github.com/IntelPython/dpnp/pull/2035)
115115
* Use `dpctl::tensor::alloc_utils::sycl_free_noexcept` instead of `sycl::free` in `host_task` tasks associated with life-time management of temporary USM allocations [#2058](https://github.com/IntelPython/dpnp/pull/2058)
116116
* Improved implementation of `dpnp.kron` to avoid unnecessary copy for non-contiguous arrays [#2059](https://github.com/IntelPython/dpnp/pull/2059)
117+
* Updated the test suit for `dpnp.fft` module [#2071](https://github.com/IntelPython/dpnp/pull/2071)
117118

118119
### Fixed
119120

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exclude-protected = ["_create_from_usm_ndarray"]
1616

1717
[tool.pylint.design]
1818
max-args = 11
19+
max-positional-arguments = 9
1920
max-locals = 30
2021
max-branches = 15
2122
max-returns = 8

tests/test_fft.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,13 @@ def test_fftn_out(self, axes, s):
564564
assert_dtype_allclose(iresult, iexpected, check_only_type_kind=True)
565565

566566
def test_negative_s(self):
567-
# stock NumPy 2.0, if s is -1, the whole input is used (no padding/trimming).
568-
a_np = numpy.empty((3, 4, 5), dtype=numpy.complex64)
567+
x1 = numpy.random.uniform(-10, 10, 60)
568+
x2 = numpy.random.uniform(-10, 10, 60)
569+
a_np = numpy.array(x1 + 1j * x2, dtype=numpy.complex64).reshape(3, 4, 5)
569570
a = dpnp.array(a_np)
570571

572+
# For dpnp and stock NumPy 2.0, if s is -1, the whole input is used
573+
# (no padding or trimming).
571574
result = dpnp.fft.fftn(a, s=(-1, -1), axes=(0, 2))
572575
expected = numpy.fft.fftn(a_np, s=(3, 5), axes=(0, 2))
573576
assert_dtype_allclose(result, expected, check_only_type_kind=True)

0 commit comments

Comments
 (0)