Skip to content

Commit f60ae45

Browse files
committed
sty: use nibabels linting settings
1 parent 34bf558 commit f60ae45

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

.pep8speaks.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
scanner:
22
diff_only: True # If False, the entire file touched by the Pull Request is scanned for errors. If True, only the diff is scanned.
3-
linter: pycodestyle # Other option is flake8
4-
5-
pycodestyle: # Same as scanner.linter value. Other option is flake8
6-
max-line-length: 88 # Follow black's line length
7-
ignore: # Errors and warnings to ignore
8-
- E266 # Too many leading '#' for block comments
9-
- E402 # module level import not at top of file
10-
- W503 # line break before binary operator
3+
linter: flake8 # Other option is flake8
114

125

136
no_blank_comment: False # If True, no comment is made on PR without any errors.

nitransforms/patched.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import numpy as np
22
from nibabel.affines import voxel_sizes
33

4+
45
def obliquity(affine):
56
r"""
67
Estimate the *obliquity* an affine's axes represent.
@@ -24,6 +25,7 @@ def obliquity(affine):
2425
best_cosines = np.abs((affine[:-1, :-1] / vs).max(axis=1))
2526
return np.arccos(best_cosines)
2627

28+
2729
def shape_zoom_affine(shape, zooms, x_flip=True, y_flip=False):
2830
''' Get affine implied by given shape and zooms
2931
We get the translations from the center of the image (implied by
@@ -85,4 +87,4 @@ def shape_zoom_affine(shape, zooms, x_flip=True, y_flip=False):
8587
aff = np.eye(4)
8688
aff[:3, :3] = np.diag(zooms)
8789
aff[:3, -1] = -origin * zooms
88-
return aff
90+
return aff

nitransforms/tests/test_affines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from nibabel.eulerangles import euler2mat
44
from ..patched import obliquity
55

6+
67
def test_obliquity():
78
"""Check the calculation of inclination of an affine axes."""
89
from math import pi

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ tests =
2424
all =
2525
%(test)s
2626

27+
[flake8]
28+
max-line-length = 100
29+
ignore = D100,D101,D102,D103,D104,D105,D200,D201,D202,D204,D205,D208,D209,D210,D300,D301,D400,D401,D403,E24,E121,E123,E126,E226,E266,E402,E704,E731,F821,I100,I101,I201,N802,N803,N804,N806,W503,W504,W605

0 commit comments

Comments
 (0)