From 99fe894d97771d3a67f9899b83376b925c95d146 Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Fri, 20 Sep 2024 07:51:23 -0500 Subject: [PATCH 1/5] update an FFT test --- tests/test_fft.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_fft.py b/tests/test_fft.py index c6f33fb71f72..ddc9623611a8 100644 --- a/tests/test_fft.py +++ b/tests/test_fft.py @@ -564,10 +564,13 @@ def test_fftn_out(self, axes, s): assert_dtype_allclose(iresult, iexpected, check_only_type_kind=True) def test_negative_s(self): - # stock NumPy 2.0, if s is -1, the whole input is used (no padding/trimming). - a_np = numpy.empty((3, 4, 5), dtype=numpy.complex64) + x1 = numpy.random.uniform(-10, 10, 60) + x2 = numpy.random.uniform(-10, 10, 60) + a_np = numpy.array(x1 + 1j * x2, dtype=numpy.complex64).reshape(3, 4, 5) a = dpnp.array(a_np) + # For dpnp and stock NumPy 2.0, if s is -1, the whole input is used + # (no padding or trimming). result = dpnp.fft.fftn(a, s=(-1, -1), axes=(0, 2)) expected = numpy.fft.fftn(a_np, s=(3, 5), axes=(0, 2)) assert_dtype_allclose(result, expected, check_only_type_kind=True) From 1ef1820379dc7debeb9f4a163fde328a244782cc Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Fri, 20 Sep 2024 09:35:00 -0500 Subject: [PATCH 2/5] update changelog.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 080165eb4870..729ed3845219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -### Change +### Changed ### Fixed @@ -50,7 +50,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds * Added implementation of `dpnp.resize` and `dpnp.rot90` functions [#2030](https://github.com/IntelPython/dpnp/pull/2030) * Added implementation of `dpnp.require` function [#2036](https://github.com/IntelPython/dpnp/pull/2036) -### Change +### Changed * Extended pre-commit pylint check to `dpnp.fft` module [#1860](https://github.com/IntelPython/dpnp/pull/1860) * 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 * 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) * 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) * Improved implementation of `dpnp.kron` to avoid unnecessary copy for non-contiguous arrays [#2059](https://github.com/IntelPython/dpnp/pull/2059) +* Updated the test suit for `dpnp.fft` module [#2071](https://github.com/IntelPython/dpnp/pull/2071) ### Fixed From 0da928609c906cdd1d1cff9ad3e491fb5ce9cd24 Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Fri, 20 Sep 2024 09:43:27 -0500 Subject: [PATCH 3/5] disable too-many-arguments error for pylint --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d3995a85e7c..d7e2f68ddc2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -99,6 +99,7 @@ repos: "--disable=c-extension-no-member", "--disable=import-error", "--disable=redefined-builtin", - "--disable=unused-wildcard-import" + "--disable=unused-wildcard-import", + "--disable=too-many-arguments" ] files: '^dpnp/(dpnp_iface.*|fft|linalg)' From d8786189b731080c285e0e27fc54085560ecd64e Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Fri, 20 Sep 2024 09:49:43 -0500 Subject: [PATCH 4/5] fix: too-many-positional-arguments --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d7e2f68ddc2f..7969ca25cd13 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -100,6 +100,6 @@ repos: "--disable=import-error", "--disable=redefined-builtin", "--disable=unused-wildcard-import", - "--disable=too-many-arguments" + "--disable=too-many-positional-arguments" ] files: '^dpnp/(dpnp_iface.*|fft|linalg)' From 8a14222c0e7191e35d58dd8ebe56fc50858d0ef8 Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Fri, 20 Sep 2024 10:39:45 -0500 Subject: [PATCH 5/5] set a larger value for max-positional-arguments instead of disabling it --- .pre-commit-config.yaml | 3 +-- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7969ca25cd13..3d3995a85e7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -99,7 +99,6 @@ repos: "--disable=c-extension-no-member", "--disable=import-error", "--disable=redefined-builtin", - "--disable=unused-wildcard-import", - "--disable=too-many-positional-arguments" + "--disable=unused-wildcard-import" ] files: '^dpnp/(dpnp_iface.*|fft|linalg)' diff --git a/pyproject.toml b/pyproject.toml index 5b8c944b2c98..6c0cb342d446 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ exclude-protected = ["_create_from_usm_ndarray"] [tool.pylint.design] max-args = 11 +max-positional-arguments = 9 max-locals = 30 max-branches = 15 max-returns = 8