Skip to content

Commit c9ccf06

Browse files
committed
fix: resolve mypy errors by reordering suppression comments
1 parent f520db9 commit c9ccf06

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

test/python/vectypes.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def sum_array_int32(coll: npt.NDArray[np.int32]) -> int:
1919

2020

2121
def collectify_uint32(
22-
i: "unsigned int", j: "unsigned int" # noqa: F722
22+
i: "unsigned int", j: "unsigned int" # type: ignore # noqa: F722
2323
) -> npt.NDArray[np.uint32]:
2424
"""Create a uint32 array from two integers."""
2525
return np.array([i, j], dtype=np.uint32)
@@ -30,24 +30,24 @@ def sum_array_uint32(coll: npt.NDArray[np.uint32]) -> int:
3030
return int(sum(coll))
3131

3232

33-
def collectify_int64(i: "long", j: "long") -> npt.NDArray[np.int64]: # noqa: F821
33+
def collectify_int64(i: "long", j: "long") -> npt.NDArray[np.int64]: # type: ignore # noqa: F821
3434
"""Create an int64 array from two integers."""
3535
return np.array([i, j], dtype=np.int64)
3636

3737

38-
def sum_array_int64(coll: npt.NDArray[np.int64]) -> "long": # noqa: F821
38+
def sum_array_int64(coll: npt.NDArray[np.int64]) -> "long": # type: ignore # noqa: F821
3939
"""Sum an int64 array."""
4040
return int(sum(coll))
4141

4242

4343
def collectify_uint64(
44-
i: "unsigned long", j: "unsigned long" # noqa: F722
44+
i: "unsigned long", j: "unsigned long" # type: ignore # noqa: F722
4545
) -> npt.NDArray[np.uint64]:
4646
"""Create a uint64 array from two integers."""
4747
return np.array([i, j], dtype=np.uint64)
4848

4949

50-
def sum_array_uint64(coll: npt.NDArray[np.uint64]) -> "unsigned long": # noqa: F722
50+
def sum_array_uint64(coll: npt.NDArray[np.uint64]) -> "unsigned long": # type: ignore # noqa: F722
5151
"""Sum a uint64 array."""
5252
return int(sum(coll))
5353

@@ -62,12 +62,12 @@ def sum_array_float32(coll: npt.NDArray[np.float32]) -> "float":
6262
return float(sum(coll))
6363

6464

65-
def collectify_float64(i: "double", j: "double") -> npt.NDArray[np.float64]: # noqa: F821
65+
def collectify_float64(i: "double", j: "double") -> npt.NDArray[np.float64]: # type: ignore # noqa: F821
6666
"""Create a float64 array from two floats."""
6767
return np.array([i, j], dtype=np.float64)
6868

6969

70-
def sum_array_float64(coll: npt.NDArray[np.float64]) -> "double": # noqa: F821
70+
def sum_array_float64(coll: npt.NDArray[np.float64]) -> "double": # type: ignore # noqa: F821
7171
"""Sum a float64 array."""
7272
return float(sum(coll))
7373

test/python/verify_extended.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, sum_total: int):
2020
"""Initialize with expected sum."""
2121
self._sum_total = sum_total
2222

23-
def __call__(self, value: "unsigned int") -> None: # noqa: F722
23+
def __call__(self, value: "unsigned int") -> None: # type: ignore # noqa: F722
2424
"""Check if value matches expected sum."""
2525
assert value == self._sum_total
2626

@@ -32,7 +32,7 @@ def __init__(self, sum_total: int):
3232
"""Initialize with expected sum."""
3333
self._sum_total = sum_total
3434

35-
def __call__(self, value: "long") -> None: # noqa: F821
35+
def __call__(self, value: "long") -> None: # type: ignore # noqa: F821
3636
"""Check if value matches expected sum."""
3737
assert value == self._sum_total
3838

@@ -44,7 +44,7 @@ def __init__(self, sum_total: int):
4444
"""Initialize with expected sum."""
4545
self._sum_total = sum_total
4646

47-
def __call__(self, value: "unsigned long") -> None: # noqa: F722
47+
def __call__(self, value: "unsigned long") -> None: # type: ignore # noqa: F722
4848
"""Check if value matches expected sum."""
4949
assert value == self._sum_total
5050

@@ -68,7 +68,7 @@ def __init__(self, sum_total: float):
6868
"""Initialize with expected sum."""
6969
self._sum_total = sum_total
7070

71-
def __call__(self, value: "double") -> None: # noqa: F821
71+
def __call__(self, value: "double") -> None: # type: ignore # noqa: F821
7272
"""Check if value matches expected sum."""
7373
assert abs(value - self._sum_total) < 1e-5
7474

0 commit comments

Comments
 (0)