Skip to content

Commit cd3485c

Browse files
committed
type: Address fresh complaints
1 parent cfa3180 commit cd3485c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

nibabel/deprecated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __repr__(self) -> str:
4444
return f'<module proxy for {self._module_name}>'
4545

4646

47-
class FutureWarningMixin:
47+
class FutureWarningMixin(ty.Generic[P]):
4848
"""Insert FutureWarning for object creation
4949
5050
Examples

nibabel/nifti1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ class Nifti1Header(SpmAnalyzeHeader):
843843
single_magic = b'n+1'
844844

845845
# Quaternion threshold near 0, based on float32 precision
846-
quaternion_threshold = np.finfo(np.float32).eps * 3
846+
quaternion_threshold: np.floating = np.finfo(np.float32).eps * 3
847847

848848
def __init__(self, binaryblock=None, endianness=None, check=True, extensions=()):
849849
"""Initialize header from binary data block and extensions"""

nibabel/volumeutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
DT = ty.TypeVar('DT', bound=np.generic)
3636

3737
sys_is_le = sys.byteorder == 'little'
38-
native_code = '<' if sys_is_le else '>'
39-
swapped_code = '>' if sys_is_le else '<'
38+
native_code: ty.Literal['<', '>'] = '<' if sys_is_le else '>'
39+
swapped_code: ty.Literal['<', '>'] = '>' if sys_is_le else '<'
4040

4141
_endian_codes = ( # numpy code, aliases
4242
('<', 'little', 'l', 'le', 'L', 'LE'),

0 commit comments

Comments
 (0)