Skip to content

Commit

Permalink
Fix changes after black
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-perevezentsev committed Feb 22, 2023
1 parent 9d3b3b9 commit 3a6990a
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions tests/test_arraycreation.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,32 +269,43 @@ def test_tri_default_dtype():

@pytest.mark.parametrize(
"k",
[-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6],
ids=["-6", "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "6"],
[-3, -2, -1, 0, 1, 2, 3, 4, 5, numpy.array(1), dpnp.array(2), dpt.asarray(3)],
ids=[
"-3",
"-2",
"-1",
"0",
"1",
"2",
"3",
"4",
"5",
"np.array(1)",
"dpnp.array(2)",
"dpt.asarray(3)",
],
)
@pytest.mark.parametrize(
"m",
[
[0, 1, 2, 3, 4],
[1, 1, 1, 1, 1],
[[0, 0], [0, 0]],
[[1, 2], [1, 2]],
[[1, 2], [3, 4]],
[[0, 1, 2], [3, 4, 5], [6, 7, 8]],
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]],
],
ids=[
"[0, 1, 2, 3, 4]",
"[1, 1, 1, 1, 1]",
"[[0, 0], [0, 0]]",
"[[1, 2], [1, 2]]",
"[[1, 2], [3, 4]]",
"[[0, 1, 2], [3, 4, 5], [6, 7, 8]]",
"[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]",
],
)
def test_tril(m, k):
a = numpy.array(m)
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
@pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False))
def test_tril(m, k, dtype):
a = numpy.array(m, dtype=dtype)
ia = dpnp.array(a)
expected = numpy.tril(a, k=k)
result = dpnp.tril(ia, k=k)
Expand All @@ -303,26 +314,39 @@ def test_tril(m, k):

@pytest.mark.parametrize(
"k",
[-4, -3, -2, -1, 0, 1, 2, 3, 4],
ids=["-4", "-3", "-2", "-1", "0", "1", "2", "3", "4"],
[-3, -2, -1, 0, 1, 2, 3, 4, 5, numpy.array(1), dpnp.array(2), dpt.asarray(3)],
ids=[
"-3",
"-2",
"-1",
"0",
"1",
"2",
"3",
"4",
"5",
"np.array(1)",
"dpnp.array(2)",
"dpt.asarray(3)",
],
)
@pytest.mark.parametrize(
"m",
[
[0, 1, 2, 3, 4],
[[1, 2], [3, 4]],
[[0, 1, 2], [3, 4, 5], [6, 7, 8]],
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]],
],
ids=[
"[0, 1, 2, 3, 4]",
"[[1, 2], [3, 4]]",
"[[0, 1, 2], [3, 4, 5], [6, 7, 8]]",
"[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]",
],
)
def test_triu(m, k):
a = numpy.array(m)
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
@pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False))
def test_triu(m, k, dtype):
a = numpy.array(m, dtype=dtype)
ia = dpnp.array(a)
expected = numpy.triu(a, k=k)
result = dpnp.triu(ia, k=k)
Expand Down

0 comments on commit 3a6990a

Please sign in to comment.