Skip to content

Commit 9a13fd2

Browse files
committed
TEST+PL: Fix python3 string issues and linting.
1 parent a87853d commit 9a13fd2

File tree

6 files changed

+36
-38
lines changed

6 files changed

+36
-38
lines changed

nibabel/brainvoyager/bv_vmr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from .bv import (BvError, BvFileHeader, BvFileImage, parse_BV_header,
1818
pack_BV_header, calc_BV_header_size, combine_st, parse_st)
1919
from ..spatialimages import HeaderDataError
20-
from ..batteryrunners import Report
2120
import numpy as np
2221

2322

nibabel/brainvoyager/bv_vtc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from __future__ import division
1717
from .bv import BvError, BvFileHeader, BvFileImage
1818
from ..spatialimages import HeaderDataError
19-
from ..batteryrunners import Report
2019

2120
VTC_HDR_DICT_PROTO = (
2221
('version', 'h', 3),

nibabel/brainvoyager/tests/test_bv.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,47 +65,47 @@
6565
('another_counter_integer', 0),
6666
('some_unsigned_long_integer', 2712847316),
6767
('some_float', 1.0),
68-
('some_zero_terminated_string', 'HelloWorld!'),
68+
('some_zero_terminated_string', b'HelloWorld!'),
6969
('some_conditional_integer', 0),
7070
('another_conditional_integer', 23),
7171
('some_nested_field',
7272
[OrderedDict([('a_number', 1),
7373
('a_float', 1.65),
74-
('a_string', 'test.txt'),
74+
('a_string', b'test.txt'),
7575
('nested_counter_integer', 2),
7676
('fdr_table_info',
7777
[OrderedDict([('another_float', 0.0),
78-
('another_string', 'sample')]),
78+
('another_string', b'sample')]),
7979
OrderedDict([('another_float', 0.0),
80-
('another_string', 'sample')])])]),
80+
('another_string', b'sample')])])]),
8181
OrderedDict([('a_number', 1),
8282
('a_float', 1.65),
83-
('a_string', 'test.txt'),
83+
('a_string', b'test.txt'),
8484
('nested_counter_integer', 2),
8585
('fdr_table_info',
8686
[OrderedDict([('another_float', 0.0),
87-
('another_string', 'sample')]),
87+
('another_string', b'sample')]),
8888
OrderedDict([('another_float', 0.0),
89-
('another_string', 'sample')])])]),
89+
('another_string', b'sample')])])]),
9090
OrderedDict([('a_number', 1),
9191
('a_float', 1.65),
92-
('a_string', 'test.txt'),
92+
('a_string', b'test.txt'),
9393
('nested_counter_integer', 2),
9494
('fdr_table_info',
9595
[OrderedDict([('another_float', 0.0),
96-
('another_string', 'sample')]),
96+
('another_string', b'sample')]),
9797
OrderedDict([('another_float', 0.0),
98-
('another_string', 'sample')])])]),
98+
('another_string', b'sample')])])]),
9999
OrderedDict([('a_number', 1),
100100
('a_float', 1.65),
101-
('a_string', 'test.txt'),
101+
('a_string', b'test.txt'),
102102
('nested_counter_integer', 2),
103103
('fdr_table_info',
104104
[OrderedDict([('another_float', 0.0),
105-
('another_string', 'sample')]),
105+
('another_string', b'sample')]),
106106
OrderedDict([('another_float', 0.0),
107107
('another_string',
108-
'sample')])])])]),
108+
b'sample')])])])]),
109109
('another_nested_field', [])])
110110

111111
TEST_HDR_PACKED = \

nibabel/brainvoyager/tests/test_bv_vmp.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@
8989
('dim_x', 256),
9090
('dim_y', 256),
9191
('dim_z', 256),
92-
('vtc_filename', 'test.vtc'),
93-
('prt_filename', ''),
94-
('voi_filename', ''),
92+
('vtc_filename', b'test.vtc'),
93+
('prt_filename', b''),
94+
('voi_filename', b''),
9595
('maps',
9696
[OrderedDict([('type_of_map', 1),
9797
('map_threshold', 1.649999976158142),
9898
('upper_threshold', 8.0),
99-
('map_name', 'Testmap'),
99+
('map_name', b'Testmap'),
100100
('pos_min_r', 255),
101101
('pos_min_g', 0),
102102
('pos_min_b', 0),
@@ -110,7 +110,7 @@
110110
('neg_max_g', 0),
111111
('neg_max_b', 255),
112112
('use_vmp_color', 0),
113-
('lut_filename', '<default>'),
113+
('lut_filename', b'<default>'),
114114
('transparent_color_factor', 1.0),
115115
('nr_of_lags', 0),
116116
('display_min_lag', 0),
@@ -148,14 +148,14 @@
148148
('dim_x', 256),
149149
('dim_y', 256),
150150
('dim_z', 256),
151-
('vtc_filename', 'test.vtc'),
152-
('prt_filename', ''),
153-
('voi_filename', ''),
151+
('vtc_filename', b'test.vtc'),
152+
('prt_filename', b''),
153+
('voi_filename', b''),
154154
('maps',
155155
[OrderedDict([('type_of_map', 1),
156156
('map_threshold', 1.649999976158142),
157157
('upper_threshold', 8.0),
158-
('map_name', 'Testmap'),
158+
('map_name', b'Testmap'),
159159
('pos_min_r', 255),
160160
('pos_min_g', 0),
161161
('pos_min_b', 0),
@@ -169,7 +169,7 @@
169169
('neg_max_g', 0),
170170
('neg_max_b', 255),
171171
('use_vmp_color', 0),
172-
('lut_filename', '<default>'),
172+
('lut_filename', b'<default>'),
173173
('transparent_color_factor', 1.0),
174174
('nr_of_lags', 0),
175175
('display_min_lag', 0),
@@ -188,7 +188,7 @@
188188
OrderedDict([('type_of_map', 1),
189189
('map_threshold', 1.649999976158142),
190190
('upper_threshold', 8.0),
191-
('map_name', 'Testmap'),
191+
('map_name', b'Testmap'),
192192
('pos_min_r', 255),
193193
('pos_min_g', 0),
194194
('pos_min_b', 0),
@@ -202,7 +202,7 @@
202202
('neg_max_g', 0),
203203
('neg_max_b', 255),
204204
('use_vmp_color', 0),
205-
('lut_filename', '<default>'),
205+
('lut_filename', b'<default>'),
206206
('transparent_color_factor', 1.0),
207207
('nr_of_lags', 0),
208208
('display_min_lag', 0),
@@ -242,14 +242,14 @@
242242
('dim_x', 256),
243243
('dim_y', 256),
244244
('dim_z', 256),
245-
('vtc_filename', '/path/to/test.vtc'),
246-
('prt_filename', ''),
247-
('voi_filename', ''),
245+
('vtc_filename', b'/path/to/test.vtc'),
246+
('prt_filename', b''),
247+
('voi_filename', b''),
248248
('maps',
249249
[OrderedDict([('type_of_map', 3),
250250
('map_threshold', 0.16120874881744385),
251251
('upper_threshold', 0.800000011920929),
252-
('map_name', '<CROSS-CORRELATION>'),
252+
('map_name', b'<CROSS-CORRELATION>'),
253253
('pos_min_r', 0),
254254
('pos_min_g', 0),
255255
('pos_min_b', 100),
@@ -263,7 +263,7 @@
263263
('neg_max_g', 200),
264264
('neg_max_b', 100),
265265
('use_vmp_color', 0),
266-
('lut_filename', '<default>'),
266+
('lut_filename', b'<default>'),
267267
('transparent_color_factor', 1.0),
268268
('nr_of_lags', 8),
269269
('display_min_lag', 0),

nibabel/brainvoyager/tests/test_bv_vmr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
('gap_thickness', 0.0),
7171
('nr_of_past_spatial_trans', 2),
7272
('past_spatial_trans',
73-
[OrderedDict([('name', 'NoName'),
73+
[OrderedDict([('name', b'NoName'),
7474
('type', 2),
75-
('source_file', '/home/test.vmr'),
75+
('source_file', b'/home/test.vmr'),
7676
('nr_of_trans_val', 16),
7777
('trans_val',
7878
[OrderedDict([('value', 1.0)]),
@@ -91,9 +91,9 @@
9191
OrderedDict([('value', 0.0)]),
9292
OrderedDict([('value', 0.0)]),
9393
OrderedDict([('value', 1.0)])])]),
94-
OrderedDict([('name', 'NoName'),
94+
OrderedDict([('name', b'NoName'),
9595
('type', 2),
96-
('source_file', '/home/test_TRF.vmr'),
96+
('source_file', b'/home/test_TRF.vmr'),
9797
('nr_of_trans_val', 16),
9898
('trans_val',
9999
[OrderedDict([('value', 1.0)]),

nibabel/brainvoyager/tests/test_bv_vtc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141

4242
BVVTC_EXAMPLE_HDRS = [
4343
OrderedDict([('version', 3),
44-
('fmr', 'test.fmr'),
44+
('fmr', b'test.fmr'),
4545
('nr_prts', 1),
46-
('prts', [OrderedDict([('filename', 'test.prt')])]),
46+
('prts', [OrderedDict([('filename', b'test.prt')])]),
4747
('current_prt', 0),
4848
('datatype', 2),
4949
('volumes', 5),

0 commit comments

Comments
 (0)