Skip to content

Commit cd92102

Browse files
committed
ENH: some PEP8 (long lines), typos, removed not needed decorator
Thanks MB for the review
1 parent faf7dc5 commit cd92102

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

bin/nib-ls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def proc_file(f, opts):
187187
if opts.header_fields:
188188
# signals "all fields"
189189
if opts.header_fields == 'all':
190-
# TODO: might vary across file types, thus prior sensing would be needed
190+
# TODO: might vary across file types, thus prior sensing
191+
# would be needed
191192
header_fields = h.keys()
192193
else:
193194
header_fields = opts.header_fields.split(',')

nibabel/tests/test_scripts.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def script_test(func):
5353
DATA_PATH = abspath(pjoin(dirname(__file__), 'data'))
5454

5555

56-
@script_test
57-
def _test_nib_ls_example4d(opts=[], hdrs_str=""):
56+
def check_nib_ls_example4d(opts=[], hdrs_str=""):
5857
# test nib-ls script
5958
fname = pjoin(DATA_PATH, 'example4d.nii.gz')
6059
expected_re = (" (int16|[<>]i2) \[128, 96, 24, 2\] "
@@ -67,15 +66,17 @@ def _test_nib_ls_example4d(opts=[], hdrs_str=""):
6766

6867
@script_test
6968
def test_nib_ls():
70-
yield _test_nib_ls_example4d
71-
yield _test_nib_ls_example4d, ['-H', 'dim,bitpix'], " \[ 4 128 96 24 2 1 1 1\] 16"
69+
yield check_nib_ls_example4d
70+
yield check_nib_ls_example4d, \
71+
['-H', 'dim,bitpix'], " \[ 4 128 96 24 2 1 1 1\] 16"
7272

7373
@script_test
7474
def test_nib_ls_multiple():
7575
# verify that correctly lists/formats for multiple files
7676
fnames = [
7777
pjoin(DATA_PATH, f)
78-
for f in ('example4d.nii.gz', 'example_nifti2.nii.gz', 'small.mnc', 'nifti2.hdr')
78+
for f in ('example4d.nii.gz', 'example_nifti2.nii.gz',
79+
'small.mnc', 'nifti2.hdr')
7980
]
8081
code, stdout, stderr = run_command(['nib-ls'] + fnames)
8182
stdout_lines = stdout.split('\n')

nibabel/tests/test_testing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_assert_re_in():
148148
assert_re_in(".*", "")
149149
assert_re_in(".*", ["any"])
150150

151-
# should do match not search
151+
# Should do match not search
152152
assert_re_in("ab", "abc")
153153
assert_raises(AssertionError, assert_re_in, "ab", "cab")
154154
assert_raises(AssertionError, assert_re_in, "ab$", "abc")
@@ -161,5 +161,5 @@ def test_assert_re_in():
161161
assert_re_in("ab", ("", "abc", "laskdjf"))
162162
assert_raises(AssertionError, assert_re_in, "ab$", ("ddd", ""))
163163

164-
# shouldn't "match" the emty list
164+
# Shouldn't "match" the empty list
165165
assert_raises(AssertionError, assert_re_in, "", [])

0 commit comments

Comments
 (0)