Skip to content

Commit 8430f3d

Browse files
Review feedback
1 parent 813d20e commit 8430f3d

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

cpp/cmake/modules/compute_matrix_product.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class UsedKeyWarning(UserWarning):
3939

4040

4141
def iterate_matrix_product(
42+
*,
4243
matrix: "Matrix",
4344
warn_unused=True,
4445
warn_used=True,
@@ -231,7 +232,7 @@ def iterate_impl(
231232
json.dump(
232233
list(
233234
iterate_matrix_product(
234-
matrix,
235+
matrix=matrix,
235236
warn_unused=namespace.warn_unused,
236237
warn_used=namespace.warn_used,
237238
)

python/cuvs/cuvs/tests/test_compute_matrix_product.py

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,23 @@
1414
MatrixValue = None | bool | int | float | str
1515
Matrix = MatrixValue | list["Matrix"] | dict[str, "Matrix"]
1616

17-
try:
18-
compute_matrix_product_script = runpy.run_path(
19-
str(
20-
pathlib.Path(__file__).parent
21-
/ "../../../../cpp/cmake/modules/compute_matrix_product.py"
22-
)
23-
)
24-
except FileNotFoundError:
25-
pytest.skip(
26-
"Could not find compute_matrix_product.py", allow_module_level=True
17+
compute_matrix_product_script = runpy.run_path(
18+
str(
19+
pathlib.Path(__file__).parent
20+
/ "../../../../cpp/cmake/modules/compute_matrix_product.py"
2721
)
28-
else:
29-
iterate_matrix_product: "Callable[[Matrix], Generator[dict[str, MatrixValue]]]" = compute_matrix_product_script[
30-
"iterate_matrix_product"
31-
]
32-
NoKeyError: type[ValueError] = compute_matrix_product_script["NoKeyError"]
33-
UnusedKeyWarning: type[UserWarning] = compute_matrix_product_script[
34-
"UnusedKeyWarning"
35-
]
36-
UsedKeyWarning: type[UserWarning] = compute_matrix_product_script[
37-
"UsedKeyWarning"
38-
]
22+
)
23+
24+
iterate_matrix_product: "Callable[[Matrix], Generator[dict[str, MatrixValue]]]" = compute_matrix_product_script[
25+
"iterate_matrix_product"
26+
]
27+
NoKeyError: type[ValueError] = compute_matrix_product_script["NoKeyError"]
28+
UnusedKeyWarning: type[UserWarning] = compute_matrix_product_script[
29+
"UnusedKeyWarning"
30+
]
31+
UsedKeyWarning: type[UserWarning] = compute_matrix_product_script[
32+
"UsedKeyWarning"
33+
]
3934

4035

4136
@pytest.mark.parametrize(
@@ -251,7 +246,7 @@ def test_iterate_matrix_product(
251246
assert (
252247
list(
253248
iterate_matrix_product(
254-
matrix, warn_unused=warn_unused, warn_used=warn_used
249+
matrix=matrix, warn_unused=warn_unused, warn_used=warn_used
255250
)
256251
)
257252
== expected_product

0 commit comments

Comments
 (0)