Skip to content

Commit e915419

Browse files
STY: Apply ruff rule RUF100
RUF100 Unused `noqa` directive
1 parent c742552 commit e915419

File tree

10 files changed

+15
-17
lines changed

10 files changed

+15
-17
lines changed

nibabel/benchmarks/bench_array_to_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
"""
1212

1313
import sys
14-
from io import BytesIO # NOQA
14+
from io import BytesIO
1515

1616
import numpy as np
1717
from numpy.testing import measure
1818

19-
from nibabel.volumeutils import array_to_file # NOQA
19+
from nibabel.volumeutils import array_to_file
2020

2121
from .butils import print_git_title
2222

nibabel/benchmarks/bench_finite_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import numpy as np
1616
from numpy.testing import measure
1717

18-
from nibabel.volumeutils import finite_range # NOQA
18+
from nibabel.volumeutils import finite_range
1919

2020
from .butils import print_git_title
2121

nibabel/casting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ class CastingError(Exception):
5151
getattr(np, dtype)
5252
for dtype in (
5353
'int8', 'byte', 'int16', 'short', 'int32', 'intc', 'int_', 'int64', 'longlong',
54-
'uint8', 'ubyte', 'uint16', 'ushort', 'uint32', 'uintc', 'uint', 'uint64', 'ulonglong', # noqa: E501
55-
'float16', 'half', 'float32', 'single', 'float64', 'double', 'float96', 'float128', 'longdouble', # noqa: E501
56-
'complex64', 'csingle', 'complex128', 'cdouble', 'complex192', 'complex256', 'clongdouble', # noqa: E501
54+
'uint8', 'ubyte', 'uint16', 'ushort', 'uint32', 'uintc', 'uint', 'uint64', 'ulonglong',
55+
'float16', 'half', 'float32', 'single', 'float64', 'double', 'float96', 'float128', 'longdouble',
56+
'complex64', 'csingle', 'complex128', 'cdouble', 'complex192', 'complex256', 'clongdouble',
5757
# other names of the built-in scalar types
58-
'int_', 'float_', 'complex_', 'bytes_', 'str_', 'bool_', 'datetime64', 'timedelta64', # noqa: E501
58+
'int_', 'float_', 'complex_', 'bytes_', 'str_', 'bool_', 'datetime64', 'timedelta64',
5959
# other
6060
'object_', 'void',
6161
)

nibabel/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Ignore warning requesting help with nicom
77
with pytest.warns(UserWarning):
8-
import nibabel.nicom # noqa :401
8+
import nibabel.nicom
99

1010

1111
@pytest.fixture(scope='session', autouse=True)

nibabel/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@
108108
109109
.. _Digital Object Identifier: https://en.wikipedia.org/wiki/Digital_object_identifier
110110
.. _zenodo: https://zenodo.org
111-
""" # noqa: E501
111+
"""

nibabel/parrec.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# copyright and license terms.
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
9-
# Disable line length checking for PAR fragments in module docstring
10-
# noqa: E501
119
"""Read images in PAR/REC format
1210
1311
This is yet another MRI image format generated by Philips scanners. It is an

nibabel/pydicom_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
if have_dicom:
4545
# Values not imported by default
4646
import pydicom.values # type: ignore[import-not-found]
47-
from pydicom.dicomio import dcmread as read_file # noqa:F401
48-
from pydicom.sequence import Sequence # noqa:F401
47+
from pydicom.dicomio import dcmread as read_file
48+
from pydicom.sequence import Sequence
4949

5050
tag_for_keyword = pydicom.datadict.tag_for_keyword
5151

nibabel/tests/test_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
get_data_path,
2424
make_datasource,
2525
)
26-
from .test_environment import DATA_KEY, USER_KEY, with_environment # noqa: F401
26+
from .test_environment import DATA_KEY, USER_KEY, with_environment
2727

2828

2929
@pytest.fixture
30-
def with_nimd_env(request, with_environment): # noqa: F811
30+
def with_nimd_env(request, with_environment):
3131
DATA_FUNCS = {}
3232
DATA_FUNCS['home_dir_func'] = nibd.get_nipy_user_dir
3333
DATA_FUNCS['sys_dir_func'] = nibd.get_nipy_system_dir

nibabel/tests/test_scripts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def test_help():
196196
# needs special treatment since depends on fuse module which
197197
# might not be available.
198198
try:
199-
import fuse # noqa: F401
199+
import fuse
200200
except Exception:
201201
continue # do not test this one
202202
code, stdout, stderr = run_command([cmd, '--help'])

nibabel/xmlutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""Thin layer around xml.etree.ElementTree, to abstract nibabel xml support"""
1010

1111
from io import BytesIO
12-
from xml.etree.ElementTree import Element, SubElement, tostring # noqa
12+
from xml.etree.ElementTree import Element, SubElement, tostring
1313
from xml.parsers.expat import ParserCreate
1414

1515
from .filebasedimages import FileBasedHeader

0 commit comments

Comments
 (0)