Skip to content

Commit

Permalink
STY: Apply ruff rule RUF100
Browse files Browse the repository at this point in the history
RUF100 Unused `noqa` directive
  • Loading branch information
DimitriPapadopoulos committed Oct 1, 2024
1 parent 7963366 commit 7765dde
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions nibabel/casting.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ class CastingError(Exception):
getattr(np, dtype)
for dtype in (
'int8', 'byte', 'int16', 'short', 'int32', 'intc', 'int_', 'int64', 'longlong',
'uint8', 'ubyte', 'uint16', 'ushort', 'uint32', 'uintc', 'uint', 'uint64', 'ulonglong', # noqa: E501
'float16', 'half', 'float32', 'single', 'float64', 'double', 'float96', 'float128', 'longdouble', # noqa: E501
'complex64', 'csingle', 'complex128', 'cdouble', 'complex192', 'complex256', 'clongdouble', # noqa: E501
'uint8', 'ubyte', 'uint16', 'ushort', 'uint32', 'uintc', 'uint', 'uint64', 'ulonglong',
'float16', 'half', 'float32', 'single', 'float64', 'double', 'float96', 'float128', 'longdouble',
'complex64', 'csingle', 'complex128', 'cdouble', 'complex192', 'complex256', 'clongdouble',
# other names of the built-in scalar types
'int_', 'float_', 'complex_', 'bytes_', 'str_', 'bool_', 'datetime64', 'timedelta64', # noqa: E501
'int_', 'float_', 'complex_', 'bytes_', 'str_', 'bool_', 'datetime64', 'timedelta64',
# other
'object_', 'void',
)
Expand Down
2 changes: 1 addition & 1 deletion nibabel/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@
.. _Digital Object Identifier: https://en.wikipedia.org/wiki/Digital_object_identifier
.. _zenodo: https://zenodo.org
""" # noqa: E501
"""
2 changes: 0 additions & 2 deletions nibabel/parrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
# Disable line length checking for PAR fragments in module docstring
# noqa: E501
"""Read images in PAR/REC format
This is yet another MRI image format generated by Philips scanners. It is an
Expand Down
4 changes: 2 additions & 2 deletions nibabel/pydicom_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
if have_dicom:
# Values not imported by default
import pydicom.values # type: ignore[import-not-found]
from pydicom.dicomio import dcmread as read_file # noqa:F401
from pydicom.sequence import Sequence # noqa:F401
from pydicom.dicomio import dcmread as read_file
from pydicom.sequence import Sequence

tag_for_keyword = pydicom.datadict.tag_for_keyword

Expand Down
4 changes: 2 additions & 2 deletions nibabel/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
get_data_path,
make_datasource,
)
from .test_environment import DATA_KEY, USER_KEY, with_environment # noqa: F401
from .test_environment import DATA_KEY, USER_KEY, with_environment


@pytest.fixture
def with_nimd_env(request, with_environment): # noqa: F811
def with_nimd_env(request, with_environment):
DATA_FUNCS = {}
DATA_FUNCS['home_dir_func'] = nibd.get_nipy_user_dir
DATA_FUNCS['sys_dir_func'] = nibd.get_nipy_system_dir
Expand Down
2 changes: 1 addition & 1 deletion nibabel/tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_help():
# needs special treatment since depends on fuse module which
# might not be available.
try:
import fuse # noqa: F401
import fuse
except Exception:
continue # do not test this one
code, stdout, stderr = run_command([cmd, '--help'])
Expand Down

0 comments on commit 7765dde

Please sign in to comment.