Skip to content

Commit 39a2963

Browse files
committed
PL: Bowing to the style gods
1 parent cc724ef commit 39a2963

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

nibabel/benchmarks/bench_array_to_file.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919

2020
import numpy as np
2121

22-
from six import BytesIO
23-
2422
from .butils import print_git_title
2523

2624
from numpy.testing import measure
2725

28-
from nibabel.volumeutils import array_to_file
26+
from nibabel.volumeutils import array_to_file # NOQA
2927

3028

3129
def bench_array_to_file():

nibabel/benchmarks/bench_arrayproxy_slicing.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# Each test involves loading an image of shape SHAPE, and then slicing it
3939
# NITERS times
4040
NITERS = 50
41-
SHAPE = (100, 100, 100, 100)
41+
SHAPE = (100, 100, 100, 100)
4242

4343
# One test is run for each combination of SLICEOBJS, KEEP_OPENS, and HAVE_IGZIP
4444

@@ -61,8 +61,11 @@
6161

6262
@contextlib.contextmanager
6363
def patch_indexed_gzip(have_igzip):
64-
with mock.patch('nibabel.openers.HAVE_INDEXED_GZIP', have_igzip), \
65-
mock.patch('nibabel.arrayproxy.HAVE_INDEXED_GZIP', have_igzip):
64+
65+
atts = ['nibabel.openers.HAVE_INDEXED_GZIP',
66+
'nibabel.arrayproxy.HAVE_INDEXED_GZIP']
67+
68+
with mock.patch(atts[0], have_igzip), mock.patch(atts[1], have_igzip):
6669
yield
6770

6871

@@ -78,12 +81,12 @@ def bench_arrayproxy_slicing():
7881
# because if keep_file_open is False, HAVE_INDEXED_GZIP has no effect
7982
tests = [t for t in tests if not (t[0] and not t[1])]
8083

81-
testfile = 'testfile.nii'
84+
testfile = 'testfile.nii'
8285
testfilegz = 'test.nii.gz'
8386

8487
def get_test_label(test):
8588
have_igzip = test[0]
86-
keep_open = test[1]
89+
keep_open = test[1]
8790

8891
if not (have_igzip and keep_open):
8992
return 'gzip'
@@ -166,9 +169,9 @@ def testfunc():
166169
gc.collect()
167170

168171
if memory_usage is not None:
169-
membaseline = max(memory_usage(lambda : None))
170-
testmem = max(memory_usage(testfunc)) - membaseline
171-
basemem = max(memory_usage(basefunc)) - membaseline
172+
membaseline = max(memory_usage(lambda: None))
173+
testmem = max(memory_usage(testfunc)) - membaseline
174+
basemem = max(memory_usage(basefunc)) - membaseline
172175
else:
173176
testmem = np.nan
174177
basemem = np.nan

nibabel/benchmarks/bench_finite_range.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from numpy.testing import measure
2626

27-
from nibabel.volumeutils import finite_range
27+
from nibabel.volumeutils import finite_range # NOQA
2828

2929

3030
def bench_finite_range():

nibabel/pkg_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
try:
55
from ConfigParser import RawConfigParser as ConfigParser
66
except ImportError:
7-
from configparser import RawConfigParser as ConfigParser # python 3
7+
from configparser import RawConfigParser as ConfigParser # python 3
88

99
COMMIT_INFO_FNAME = 'COMMIT_INFO.txt'
1010

0 commit comments

Comments
 (0)