Skip to content

Commit 3ee9480

Browse files
MNT: run ruff check --fix and ruff format
Also fix remaining issues manually.
1 parent 04dd1f4 commit 3ee9480

File tree

130 files changed

+166
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+166
-161
lines changed

nibabel/_compression.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99
"""Constants and types for dealing transparently with compression"""
10+
1011
from __future__ import annotations
1112

1213
import bz2

nibabel/affines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33
"""Utility routines for working with points and affine transforms"""
4+
45
from functools import reduce
56

67
import numpy as np

nibabel/analyze.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
can be loaded with and without a default flip, so the saved zoom will not
8282
constrain the affine.
8383
"""
84+
8485
from __future__ import annotations
8586

8687
import numpy as np

nibabel/arrayproxy.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
2626
See :mod:`nibabel.tests.test_proxy_api` for proxy API conformance checks.
2727
"""
28+
2829
from __future__ import annotations
2930

3031
import typing as ty
@@ -74,21 +75,19 @@ class ArrayLike(ty.Protocol):
7475
shape: tuple[int, ...]
7576

7677
@property
77-
def ndim(self) -> int:
78-
... # pragma: no cover
78+
def ndim(self) -> int: ... # pragma: no cover
7979

8080
# If no dtype is passed, any dtype might be returned, depending on the array-like
8181
@ty.overload
82-
def __array__(self, dtype: None = ..., /) -> np.ndarray[ty.Any, np.dtype[ty.Any]]:
83-
... # pragma: no cover
82+
def __array__(
83+
self, dtype: None = ..., /
84+
) -> np.ndarray[ty.Any, np.dtype[ty.Any]]: ... # pragma: no cover
8485

8586
# Any dtype might be passed, and *that* dtype must be returned
8687
@ty.overload
87-
def __array__(self, dtype: _DType, /) -> np.ndarray[ty.Any, _DType]:
88-
... # pragma: no cover
88+
def __array__(self, dtype: _DType, /) -> np.ndarray[ty.Any, _DType]: ... # pragma: no cover
8989

90-
def __getitem__(self, key, /) -> npt.NDArray:
91-
... # pragma: no cover
90+
def __getitem__(self, key, /) -> npt.NDArray: ... # pragma: no cover
9291

9392

9493
class ArrayProxy(ArrayLike):

nibabel/arraywriters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def __init__(self, array, out_dtype=None)
2828
something else to make sense of conversions between float and int, or between
2929
larger ints and smaller.
3030
"""
31+
3132
import numpy as np
3233

3334
from .casting import best_float, floor_exact, int_abs, shared_range, type_info

nibabel/benchmarks/butils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Benchmarking utilities
2-
"""
1+
"""Benchmarking utilities"""
32

43
from .. import get_info
54

nibabel/brikhead.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
am aware) always be >= 1. This permits sub-brick indexing common in AFNI
2727
programs (e.g., example4d+orig'[0]').
2828
"""
29+
2930
import os
3031
import re
3132
from copy import deepcopy

nibabel/casting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Most routines work round some numpy oddities in floating point precision and
44
casting. Others work round numpy casting to and from python ints
55
"""
6+
67
from __future__ import annotations
78

89
import warnings

nibabel/cifti2/cifti2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
http://www.nitrc.org/projects/cifti
1818
"""
19+
1920
import re
2021
from collections import OrderedDict
2122
from collections.abc import Iterable, MutableMapping, MutableSequence

nibabel/cifti2/cifti2_axes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
... bm_cortex)))
119119
<class 'nibabel.cifti2.cifti2.Cifti2Header'>
120120
"""
121+
121122
import abc
122123
from operator import xor
123124

0 commit comments

Comments
 (0)