Skip to content

Commit 65106d9

Browse files
author
Mathieu Scheltienne
committed
better var name
1 parent e97c992 commit 65106d9

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

nibabel/casting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CastingError(Exception):
4646
'others': [bool, object, bytes, str, np.void],
4747
}
4848
# fmt: off
49-
sctypes_named = {
49+
sctypes_aliases = {
5050
getattr(np, dtype)
5151
for dtype in (
5252
'int8', 'byte', 'int16', 'short', 'int32', 'intc', 'int_', 'int64', 'longlong',

nibabel/spatialimages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
import numpy as np
140140

141141
from .arrayproxy import ArrayLike
142-
from .casting import sctypes_named
142+
from .casting import sctypes_aliases
143143
from .dataobj_images import DataobjImage
144144
from .filebasedimages import FileBasedHeader, FileBasedImage
145145
from .fileholders import FileMap
@@ -334,7 +334,7 @@ def _supported_np_types(klass: type[HasDtype]) -> set[type[np.generic]]:
334334
else:
335335
raise e
336336
supported = set()
337-
for np_type in sctypes_named:
337+
for np_type in sctypes_aliases:
338338
try:
339339
obj.set_data_dtype(np_type)
340340
except HeaderDataError:

nibabel/tests/test_analyze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from .. import imageglobals
2727
from ..analyze import AnalyzeHeader, AnalyzeImage
2828
from ..arraywriters import WriterError
29-
from ..casting import as_int, sctypes_named
29+
from ..casting import as_int, sctypes_aliases
3030
from ..nifti1 import Nifti1Header
3131
from ..optpkg import optional_package
3232
from ..spatialimages import HeaderDataError, HeaderTypeError, supported_np_types
@@ -52,7 +52,7 @@ def add_duplicate_types(supported_np_types):
5252
# Update supported numpy types with named scalar types that map to the same set of dtypes
5353
dtypes = {np.dtype(t) for t in supported_np_types}
5454
supported_np_types.update(
55-
scalar for scalar in sctypes_named if np.dtype(scalar) in dtypes
55+
scalar for scalar in sctypes_aliases if np.dtype(scalar) in dtypes
5656
)
5757

5858

nibabel/tests/test_spm99analyze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# files
2424
needs_scipy = unittest.skipUnless(have_scipy, 'scipy not available')
2525

26-
from ..casting import sctypes_named, shared_range, type_info
26+
from ..casting import sctypes_aliases, shared_range, type_info
2727
from ..spatialimages import HeaderDataError
2828
from ..spm99analyze import HeaderTypeError, Spm99AnalyzeHeader, Spm99AnalyzeImage
2929
from ..testing import (
@@ -39,7 +39,7 @@
3939
# For testing, we want all concrete classes of a type
4040
# Key on kind, rather than abstract base classes, since timedelta64 is a signedinteger
4141
sctypes = {}
42-
for sctype in sctypes_named:
42+
for sctype in sctypes_aliases:
4343
sctypes.setdefault(np.dtype(sctype).kind, []).append(sctype)
4444

4545
# Sort types to ensure that xdist doesn't complain about test order when we parametrize

0 commit comments

Comments
 (0)