Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 53e1ca9

Browse files
committed
STY: remove unused # noqa
1 parent 26d5a20 commit 53e1ca9

27 files changed

Lines changed: 48 additions & 51 deletions

.spin/cmds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test(*, parent_callback, pytest_args, tests, markexpr, parallel_threads, **k
154154
155155
When pytest-run-parallel is avaliable, use `spin test -p auto` or
156156
`spin test -p <num_of_threads>` to run tests sequentional in parallel threads.
157-
""" # noqa: E501
157+
"""
158158
if (not pytest_args) and (not tests):
159159
pytest_args = ('--pyargs', 'numpy')
160160

@@ -201,10 +201,10 @@ def check_docs(*, parent_callback, pytest_args, **kwargs):
201201
- This command only doctests public objects: those which are accessible
202202
from the top-level `__init__.py` file.
203203
204-
""" # noqa: E501
204+
"""
205205
try:
206206
# prevent obscure error later
207-
import scipy_doctest # noqa: F401
207+
import scipy_doctest
208208
except ModuleNotFoundError as e:
209209
raise ModuleNotFoundError("scipy-doctest not installed") from e
210210
if scipy_doctest.__version__ < '1.8.0':
@@ -247,7 +247,7 @@ def check_tutorials(*, parent_callback, pytest_args, **kwargs):
247247
- This command only doctests public objects: those which are accessible
248248
from the top-level `__init__.py` file.
249249
250-
""" # noqa: E501
250+
"""
251251
# handle all of
252252
# - `spin check-tutorials` (pytest_args == ())
253253
# - `spin check-tutorials path/to/rst`, and

numpy/__init__.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ from numpy.matrixlib import (
594594
matrix,
595595
)
596596

597-
__all__ = [ # noqa: RUF022
597+
__all__ = [
598598
# __numpy_submodules__
599599
"char", "core", "ctypeslib", "dtypes", "exceptions", "f2py", "fft", "lib", "linalg",
600600
"ma", "polynomial", "random", "rec", "strings", "test", "testing", "typing",
@@ -876,7 +876,7 @@ type _CastingKind = L["no", "equiv", "safe", "same_kind", "same_value", "unsafe"
876876

877877
type _OrderKACF = L["K", "A", "C", "F"] | None
878878
type _OrderACF = L["A", "C", "F"] | None
879-
type _OrderCF = L["C", "F"] | None # noqa: PYI047
879+
type _OrderCF = L["C", "F"] | None
880880

881881
type _ModeKind = L["raise", "wrap", "clip"]
882882
type _PartitionKind = L["introselect"]
@@ -2767,9 +2767,9 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
27672767
@overload
27682768
def __abs__[ArrayT: NDArray[bool_ | integer | floating | timedelta64 | object_]](self: ArrayT, /) -> ArrayT: ...
27692769

2770-
def __invert__[ArrayT: NDArray[bool_ | integer | object_]](self: ArrayT, /) -> ArrayT: ... # noqa: PYI019
2771-
def __neg__[ArrayT: _ArrayNumeric](self: ArrayT, /) -> ArrayT: ... # noqa: PYI019
2772-
def __pos__[ArrayT: _ArrayNumeric](self: ArrayT, /) -> ArrayT: ... # noqa: PYI019
2770+
def __invert__[ArrayT: NDArray[bool_ | integer | object_]](self: ArrayT, /) -> ArrayT: ...
2771+
def __neg__[ArrayT: _ArrayNumeric](self: ArrayT, /) -> ArrayT: ...
2772+
def __pos__[ArrayT: _ArrayNumeric](self: ArrayT, /) -> ArrayT: ...
27732773

27742774
# Binary ops
27752775

numpy/_core/arrayprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _make_options_dict(precision=None, threshold=None, edgeitems=None,
7878

7979
if legacy is False:
8080
options['legacy'] = sys.maxsize
81-
elif legacy == False: # noqa: E712
81+
elif legacy == False:
8282
warnings.warn(
8383
f"Passing `legacy={legacy!r}` is deprecated.",
8484
FutureWarning, stacklevel=3

numpy/_core/fromnumeric.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# ruff: noqa: ANN401
21
from _typeshed import Incomplete
32
from collections.abc import Sequence
43
from typing import (

numpy/_core/multiarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import functools
1010

1111
from . import _multiarray_umath, overrides
12-
from ._multiarray_umath import * # noqa: F403
12+
from ._multiarray_umath import *
1313

1414
# These imports are needed for backward compatibility,
1515
# do not change them. issue gh-15518
@@ -899,7 +899,7 @@ def vdot(a, b, /):
899899
>>> 1*4 + 4*1 + 5*2 + 6*2
900900
30
901901
902-
""" # noqa: E501
902+
"""
903903
return (a, b)
904904

905905

numpy/_core/records.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# ruff: noqa: ANN401
21
# pyright: reportSelfClsParameterName=false
32
from _typeshed import Incomplete, StrOrBytesPath
43
from collections.abc import Buffer, Iterable, Sequence

numpy/_core/tests/test_array_coercion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ class TestSpecialAttributeLookupFailure:
840840

841841
class WeirdArrayLike:
842842
@property
843-
def __array__(self, dtype=None, copy=None): # noqa: PLR0206
843+
def __array__(self, dtype=None, copy=None):
844844
raise RuntimeError("oops!")
845845

846846
class WeirdArrayInterface:

numpy/_core/tests/test_casting_unittests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def test_time_to_time(self, from_dt, to_dt,
470470
orig_arr = values.view(from_dt)
471471
orig_out = np.empty_like(expected_out)
472472

473-
if casting == Casting.unsafe and (to_dt == "m8" or to_dt == "M8"): # noqa: PLR1714
473+
if casting == Casting.unsafe and (to_dt == "m8" or to_dt == "M8"):
474474
# Casting from non-generic to generic units is an error and should
475475
# probably be reported as an invalid cast earlier.
476476
with pytest.raises(ValueError):

numpy/_core/tests/test_nep50_promotions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ def test_weak_promotion_scalar_path(op):
112112
# Integer path:
113113
res = op(np.uint8(3), 5)
114114
assert res == op(3, 5)
115-
assert res.dtype == np.uint8 or res.dtype == bool # noqa: PLR1714
115+
assert res.dtype == np.uint8 or res.dtype == bool
116116

117117
with pytest.raises(OverflowError):
118118
op(np.uint8(3), 1000)
119119

120120
# Float path:
121121
res = op(np.float32(3), 5.)
122122
assert res == op(3., 5.)
123-
assert res.dtype == np.float32 or res.dtype == bool # noqa: PLR1714
123+
assert res.dtype == np.float32 or res.dtype == bool
124124

125125

126126
def test_nep50_complex_promotion():

numpy/_core/tests/test_scalarmath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def test_modular_power(self):
275275
a = 5
276276
b = 4
277277
c = 10
278-
expected = pow(a, b, c) # noqa: F841
278+
expected = pow(a, b, c)
279279
for t in (np.int32, np.float32, np.complex64):
280280
# note that 3-operand power only dispatches on the first argument
281281
assert_raises(TypeError, operator.pow, t(a), b, c)

0 commit comments

Comments
 (0)