Skip to content

Implement dpnp.interp() #2417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Implement dpnp.interp() #2417

wants to merge 48 commits into from

Conversation

vlad-perevezentsev
Copy link
Collaborator

This PR suggests adding an implementation of dpnp.interp() with sycl_kernel including support for all function arguments.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

Copy link
Contributor

github-actions bot commented Apr 11, 2025

Array API standard conformance tests for dpnp=0.18.0dev1=py312he4f9c94_62 ran successfully.
Passed: 1222
Failed: 0
Skipped: 9

@coveralls
Copy link
Collaborator

coveralls commented Apr 11, 2025

Coverage Status

coverage: 72.039% (-0.2%) from 72.271%
when pulling 62802f8 on impl_of_interp
into 6a81e55 on master.

Copy link
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2417/index.html

@antonwolfy antonwolfy added this to the 0.18.0 release milestone Apr 14, 2025
fp = dpnp.array([])
assert_raises(ValueError, dpnp.interp, x, xp, fp)

# x complex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any test that xp can't be complex?

@@ -1143,6 +1143,152 @@ def test_complex(self, xp):
assert_raises((ValueError, TypeError), xp.i0, a)


class TestInterp:
@pytest.mark.parametrize(
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests with bool inputs?

)
@pytest.mark.parametrize("dtype_y", get_all_dtypes(no_bool=True))
def test_all_dtypes(self, dtype_x, dtype_y):
x = numpy.linspace(0.1, 9.9, 20).astype(dtype_x)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any test where x and xp have different dtypes?

@@ -1143,6 +1143,152 @@ def test_complex(self, xp):
assert_raises((ValueError, TypeError), xp.i0, a)


class TestInterp:
@pytest.mark.parametrize(
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True)
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True, no_none=True)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to test None dtype here and after.

@pytest.mark.parametrize(
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True)
)
@pytest.mark.parametrize("dtype_y", get_all_dtypes(no_bool=True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a test with bool fp array?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants