Skip to content

Commit f8b725f

Browse files
authored
Merge pull request #60 from oesteban/sty/W504
MAINT: Better config on setup.py (binary operator starting line)
2 parents 81e7a67 + d39340f commit f8b725f

File tree

5 files changed

+33
-17
lines changed

5 files changed

+33
-17
lines changed

nitransforms/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def _to_hdf5(self, group):
155155

156156
def __eq__(self, other):
157157
"""Overload equals operator."""
158-
return (np.allclose(self.affine, other.affine, rtol=EQUALITY_TOL) and
159-
self.shape == other.shape)
158+
return (np.allclose(self.affine, other.affine, rtol=EQUALITY_TOL)
159+
and self.shape == other.shape)
160160

161161
def __ne__(self, other):
162162
"""Overload not equal operator."""

nitransforms/io/afni.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def from_image(cls, imgobj):
134134
shape = hdr.get_data_shape()
135135

136136
if (
137-
len(shape) != 5 or
138-
shape[-2] != 1 or
139-
not shape[-1] in (2, 3)
137+
len(shape) != 5
138+
or shape[-2] != 1
139+
or not shape[-1] in (2, 3)
140140
):
141141
raise TransformFileError(
142142
'Displacements field "%s" does not come from AFNI.' %

nitransforms/io/itk.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def __str__(self):
4242
'Transform: AffineTransform_float_3_3',
4343
'Parameters: {}'.format(' '.join(
4444
['%g' % p
45-
for p in sa['parameters'][:3, :3].reshape(-1).tolist() +
46-
sa['parameters'][:3, 3].tolist()])),
45+
for p in sa['parameters'][:3, :3].reshape(-1).tolist()
46+
+ sa['parameters'][:3, 3].tolist()])),
4747
'FixedParameters: {:g} {:g} {:g}'.format(*sa['offset']),
4848
'',
4949
]
@@ -241,10 +241,10 @@ def from_string(cls, string):
241241
if l.strip()]
242242

243243
if (
244-
not lines or
245-
not lines[0].startswith('#') or
246-
'Insight Transform File V1.0' not in lines[0]
247-
):
244+
not lines
245+
or not lines[0].startswith('#')
246+
or 'Insight Transform File V1.0' not in lines[0]
247+
):
248248
raise TransformFileError('Unknown Insight Transform File format.')
249249

250250
string = '\n'.join(lines[1:])
@@ -264,9 +264,9 @@ def from_image(cls, imgobj):
264264
shape = hdr.get_data_shape()
265265

266266
if (
267-
len(shape) != 5 or
268-
shape[-2] != 1 or
269-
not shape[-1] in (2, 3)
267+
len(shape) != 5
268+
or shape[-2] != 1
269+
or not shape[-1] in (2, 3)
270270
):
271271
raise TransformFileError(
272272
'Displacements field "%s" does not come from ITK.' %

nitransforms/tests/test_nonlinear.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from ..io.base import TransformFileError
1212
from ..nonlinear import DisplacementsFieldTransform, load as nlload
1313
from ..io.itk import ITKDisplacementsField
14-
from ..io.afni import AFNIDisplacementsField
1514

1615
TESTS_BORDER_TOLERANCE = 0.05
1716
APPLY_NONLINEAR_CMD = {

setup.cfg

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,22 @@ console_scripts =
3333
nt = nitransforms.cli:main
3434

3535
[flake8]
36-
max-line-length = 100
37-
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
36+
max-line-length = 99
37+
doctests = False
38+
ignore =
39+
E266
40+
W503
41+
exclude=*build/
42+
per-file-ignores =
43+
**/__init__.py : F401
44+
docs/conf.py : E265
45+
46+
[tool:pytest]
47+
norecursedirs = .git
48+
addopts = -svx --doctest-modules
49+
doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE ELLIPSIS
50+
env =
51+
PYTHONHASHSEED=0
52+
filterwarnings =
53+
ignore::DeprecationWarning
54+
junit_family=xunit2

0 commit comments

Comments
 (0)