Skip to content
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

Unmuted tests from test_mathematical.py scope #1668

Merged
merged 6 commits into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions tests/test_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import dpnp
from dpnp.dpnp_array import dpnp_array
from tests.third_party.cupy import testing

from .helper import (
assert_dtype_allclose,
Expand All @@ -25,7 +26,6 @@
get_integer_dtypes,
has_support_aspect64,
is_cpu_device,
is_win_platform,
)


Expand Down Expand Up @@ -125,8 +125,7 @@ def test_input_nan(self):
expected = numpy.clip(np_a, -1, 1)
assert_array_equal(result, expected)

# TODO: unmute the test once dpctl resolves the issue
@pytest.mark.skip(reason="dpctl-1489 issue")
@testing.with_requires("numpy>=1.25.0")
@pytest.mark.parametrize(
"kwargs",
[
Expand All @@ -138,7 +137,7 @@ def test_input_nan(self):
],
)
def test_nan_edges(self, kwargs):
np_a = numpy.arange(7)
np_a = numpy.arange(7.0)
dp_a = dpnp.asarray(np_a)

result = dp_a.clip(**kwargs)
Expand Down Expand Up @@ -424,7 +423,6 @@ def test_add(self, dtype, lhs, rhs):
def test_arctan2(self, dtype, lhs, rhs):
self._test_mathematical("arctan2", dtype, lhs, rhs)

@pytest.mark.usefixtures("allow_fall_back_on_numpy")
@pytest.mark.parametrize(
"dtype", get_all_dtypes(no_bool=True, no_complex=True)
)
Expand Down Expand Up @@ -564,7 +562,7 @@ def test_op_with_scalar(array, val, func, data_type, val_type):
pytest.skip(
"(0j ** 0) is different: (NaN + NaNj) in dpnp and (1 + 0j) in numpy"
)
# TODO: Remove when #1378 (dpctl) is solved
# TODO: Remove when #1378 (dpctl) is solved and 2024.1 is released (coverage is failing otherwise)
elif (
is_cpu_device()
and dpnp_a.dtype == dpnp.complex128
Expand Down Expand Up @@ -1002,7 +1000,7 @@ def test_power(array, val, data_type, val_type):
dpnp_a = dpnp.array(array, dtype=data_type)
val_ = val_type(val)

# TODO: Remove when #1378 (dpctl) is solved
# TODO: Remove when #1378 (dpctl) is solved and 2024.1 is released (coverage is failing otherwise)
if (
is_cpu_device()
and (
Expand Down Expand Up @@ -2306,12 +2304,6 @@ def test_complex_values(self):
dp_arr = dpnp.array(np_arr)
func = lambda x: x**2

# TODO: unmute the test once it's available
if is_win_platform():
pytest.skip(
"Until the latest dpctl is available on internal channel"
)

assert_dtype_allclose(func(dp_arr), func(np_arr))

@pytest.mark.parametrize("val", [0, 1], ids=["0", "1"])
Expand Down Expand Up @@ -2696,9 +2688,6 @@ def test_matmul_dtype_matrix_inputs(self, dtype1, dtype2, shape_pair):
with pytest.raises(TypeError):
dpnp.matmul(b1, b2, dtype=dtype2)

# TODO: Temporary skipping the test, until Internal CI is updated with
# recent changed in dpctl regarding dpt.result_type function
@pytest.mark.skip("Temporary skipping the test")
@pytest.mark.parametrize("dtype1", get_all_dtypes(no_bool=True))
@pytest.mark.parametrize("dtype2", get_all_dtypes(no_bool=True))
@pytest.mark.parametrize(
Expand Down Expand Up @@ -2846,9 +2835,6 @@ def test_exe_q(self):
with pytest.raises(ValueError):
dpnp.matmul(x1, x2)

# TODO: Temporary skipping the test, until Internal CI is updated with
# recent changed in dpctl regarding dpt.result_type function
@pytest.mark.skip("Temporary skipping the test")
def test_matmul_casting(self):
a1 = dpnp.arange(2 * 4, dtype=dpnp.float32).reshape(2, 4)
a2 = dpnp.arange(4 * 3).reshape(4, 3)
Expand Down
Loading