Skip to content

Commit

Permalink
TEST+PL: Fix python3 string issues and linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomastweets committed Aug 17, 2016
1 parent a87853d commit 9a13fd2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 38 deletions.
1 change: 0 additions & 1 deletion nibabel/brainvoyager/bv_vmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .bv import (BvError, BvFileHeader, BvFileImage, parse_BV_header,
pack_BV_header, calc_BV_header_size, combine_st, parse_st)
from ..spatialimages import HeaderDataError
from ..batteryrunners import Report
import numpy as np


Expand Down
1 change: 0 additions & 1 deletion nibabel/brainvoyager/bv_vtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from __future__ import division
from .bv import BvError, BvFileHeader, BvFileImage
from ..spatialimages import HeaderDataError
from ..batteryrunners import Report

VTC_HDR_DICT_PROTO = (
('version', 'h', 3),
Expand Down
26 changes: 13 additions & 13 deletions nibabel/brainvoyager/tests/test_bv.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,47 +65,47 @@
('another_counter_integer', 0),
('some_unsigned_long_integer', 2712847316),
('some_float', 1.0),
('some_zero_terminated_string', 'HelloWorld!'),
('some_zero_terminated_string', b'HelloWorld!'),
('some_conditional_integer', 0),
('another_conditional_integer', 23),
('some_nested_field',
[OrderedDict([('a_number', 1),
('a_float', 1.65),
('a_string', 'test.txt'),
('a_string', b'test.txt'),
('nested_counter_integer', 2),
('fdr_table_info',
[OrderedDict([('another_float', 0.0),
('another_string', 'sample')]),
('another_string', b'sample')]),
OrderedDict([('another_float', 0.0),
('another_string', 'sample')])])]),
('another_string', b'sample')])])]),
OrderedDict([('a_number', 1),
('a_float', 1.65),
('a_string', 'test.txt'),
('a_string', b'test.txt'),
('nested_counter_integer', 2),
('fdr_table_info',
[OrderedDict([('another_float', 0.0),
('another_string', 'sample')]),
('another_string', b'sample')]),
OrderedDict([('another_float', 0.0),
('another_string', 'sample')])])]),
('another_string', b'sample')])])]),
OrderedDict([('a_number', 1),
('a_float', 1.65),
('a_string', 'test.txt'),
('a_string', b'test.txt'),
('nested_counter_integer', 2),
('fdr_table_info',
[OrderedDict([('another_float', 0.0),
('another_string', 'sample')]),
('another_string', b'sample')]),
OrderedDict([('another_float', 0.0),
('another_string', 'sample')])])]),
('another_string', b'sample')])])]),
OrderedDict([('a_number', 1),
('a_float', 1.65),
('a_string', 'test.txt'),
('a_string', b'test.txt'),
('nested_counter_integer', 2),
('fdr_table_info',
[OrderedDict([('another_float', 0.0),
('another_string', 'sample')]),
('another_string', b'sample')]),
OrderedDict([('another_float', 0.0),
('another_string',
'sample')])])])]),
b'sample')])])])]),
('another_nested_field', [])])

TEST_HDR_PACKED = \
Expand Down
34 changes: 17 additions & 17 deletions nibabel/brainvoyager/tests/test_bv_vmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
('dim_x', 256),
('dim_y', 256),
('dim_z', 256),
('vtc_filename', 'test.vtc'),
('prt_filename', ''),
('voi_filename', ''),
('vtc_filename', b'test.vtc'),
('prt_filename', b''),
('voi_filename', b''),
('maps',
[OrderedDict([('type_of_map', 1),
('map_threshold', 1.649999976158142),
('upper_threshold', 8.0),
('map_name', 'Testmap'),
('map_name', b'Testmap'),
('pos_min_r', 255),
('pos_min_g', 0),
('pos_min_b', 0),
Expand All @@ -110,7 +110,7 @@
('neg_max_g', 0),
('neg_max_b', 255),
('use_vmp_color', 0),
('lut_filename', '<default>'),
('lut_filename', b'<default>'),
('transparent_color_factor', 1.0),
('nr_of_lags', 0),
('display_min_lag', 0),
Expand Down Expand Up @@ -148,14 +148,14 @@
('dim_x', 256),
('dim_y', 256),
('dim_z', 256),
('vtc_filename', 'test.vtc'),
('prt_filename', ''),
('voi_filename', ''),
('vtc_filename', b'test.vtc'),
('prt_filename', b''),
('voi_filename', b''),
('maps',
[OrderedDict([('type_of_map', 1),
('map_threshold', 1.649999976158142),
('upper_threshold', 8.0),
('map_name', 'Testmap'),
('map_name', b'Testmap'),
('pos_min_r', 255),
('pos_min_g', 0),
('pos_min_b', 0),
Expand All @@ -169,7 +169,7 @@
('neg_max_g', 0),
('neg_max_b', 255),
('use_vmp_color', 0),
('lut_filename', '<default>'),
('lut_filename', b'<default>'),
('transparent_color_factor', 1.0),
('nr_of_lags', 0),
('display_min_lag', 0),
Expand All @@ -188,7 +188,7 @@
OrderedDict([('type_of_map', 1),
('map_threshold', 1.649999976158142),
('upper_threshold', 8.0),
('map_name', 'Testmap'),
('map_name', b'Testmap'),
('pos_min_r', 255),
('pos_min_g', 0),
('pos_min_b', 0),
Expand All @@ -202,7 +202,7 @@
('neg_max_g', 0),
('neg_max_b', 255),
('use_vmp_color', 0),
('lut_filename', '<default>'),
('lut_filename', b'<default>'),
('transparent_color_factor', 1.0),
('nr_of_lags', 0),
('display_min_lag', 0),
Expand Down Expand Up @@ -242,14 +242,14 @@
('dim_x', 256),
('dim_y', 256),
('dim_z', 256),
('vtc_filename', '/path/to/test.vtc'),
('prt_filename', ''),
('voi_filename', ''),
('vtc_filename', b'/path/to/test.vtc'),
('prt_filename', b''),
('voi_filename', b''),
('maps',
[OrderedDict([('type_of_map', 3),
('map_threshold', 0.16120874881744385),
('upper_threshold', 0.800000011920929),
('map_name', '<CROSS-CORRELATION>'),
('map_name', b'<CROSS-CORRELATION>'),
('pos_min_r', 0),
('pos_min_g', 0),
('pos_min_b', 100),
Expand All @@ -263,7 +263,7 @@
('neg_max_g', 200),
('neg_max_b', 100),
('use_vmp_color', 0),
('lut_filename', '<default>'),
('lut_filename', b'<default>'),
('transparent_color_factor', 1.0),
('nr_of_lags', 8),
('display_min_lag', 0),
Expand Down
8 changes: 4 additions & 4 deletions nibabel/brainvoyager/tests/test_bv_vmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
('gap_thickness', 0.0),
('nr_of_past_spatial_trans', 2),
('past_spatial_trans',
[OrderedDict([('name', 'NoName'),
[OrderedDict([('name', b'NoName'),
('type', 2),
('source_file', '/home/test.vmr'),
('source_file', b'/home/test.vmr'),
('nr_of_trans_val', 16),
('trans_val',
[OrderedDict([('value', 1.0)]),
Expand All @@ -91,9 +91,9 @@
OrderedDict([('value', 0.0)]),
OrderedDict([('value', 0.0)]),
OrderedDict([('value', 1.0)])])]),
OrderedDict([('name', 'NoName'),
OrderedDict([('name', b'NoName'),
('type', 2),
('source_file', '/home/test_TRF.vmr'),
('source_file', b'/home/test_TRF.vmr'),
('nr_of_trans_val', 16),
('trans_val',
[OrderedDict([('value', 1.0)]),
Expand Down
4 changes: 2 additions & 2 deletions nibabel/brainvoyager/tests/test_bv_vtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

BVVTC_EXAMPLE_HDRS = [
OrderedDict([('version', 3),
('fmr', 'test.fmr'),
('fmr', b'test.fmr'),
('nr_prts', 1),
('prts', [OrderedDict([('filename', 'test.prt')])]),
('prts', [OrderedDict([('filename', b'test.prt')])]),
('current_prt', 0),
('datatype', 2),
('volumes', 5),
Expand Down

0 comments on commit 9a13fd2

Please sign in to comment.