Skip to content

Commit 45d0edf

Browse files
committed
fixing up appveyor and travis problems
1 parent 82b1457 commit 45d0edf

File tree

2 files changed

+2
-39
lines changed

2 files changed

+2
-39
lines changed

nibabel/cmdline/diff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def are_values_different(*values):
5252
try: # we sometimes don't want NaN values
5353
if np.any(np.isnan(value0)) and np.any(np.isnan(value)): # if they're both NaN
5454
break
55-
elif np.any(np.isnan(value0)) or np.any(np.isnan(value)): # if only 1 or the other is NaN
55+
elif np.any(np.isnan(value0)) or np.any(np.isnan(value)): # if only 1 is NaN
5656
return True
5757

5858
except TypeError:
5959
pass
6060

6161
if type(value0) != type(value): # if types are different, then we consider them different
6262
return True
63-
elif isinstance(value0, np.ndarray) and np.any(value0 != value): # if they're a numpy array, special test
63+
elif isinstance(value0, np.ndarray) and np.any(value0 != value): # special test for ndarray
6464
return True
6565
elif value0 != value:
6666
return True

nibabel/tests/test_scripts.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
from glob import glob
1616

1717
import numpy as np
18-
import difflib
1918

2019
import nibabel as nib
21-
from nibabel.cmdline.diff import diff_headers
2220
from ..tmpdirs import InTemporaryDirectory
2321
from ..loadsave import load
2422
from ..orientations import flip_axis, aff2axcodes, inv_ornt_aff
@@ -71,43 +69,8 @@ def check_nib_ls_example4d(opts=[], hdrs_str="", other_str=""):
7169

7270

7371
def check_nib_diff_examples():
74-
# test nib-diff script
75-
# fnames = [pjoin(DATA_PATH, f)
76-
# for f in ('standard.nii.gz', 'example4d.nii.gz')]
77-
# target_output = """\
78-
# These files are different.
79-
# Field standard.nii.gz example4d.nii.gz
80-
# regular b'' b'r'
81-
# dim_info 0 57
82-
# dim [3, 4, 5, 7, 1, 1, 1, 1] [4, 128, 96, 24, 2, 1, 1, 1]
83-
# datatype 2 4
84-
# bitpix 8 16
85-
# pixdim [1.0, 1.0, 3.0, 2.0, 1.0, 1.0, 1.0, 1.0] [-1.0, 2.0, 2.0, 2.1999991, 2000.0, 1.0, 1.0, 1.0]
86-
# slice_end 0 23
87-
# xyzt_units 0 10
88-
# cal_max 0.0 1162.0
89-
# descrip b'' b'FSL3.3? v2.25 NIfTI-1 Single file format'
90-
# qform_code 0 1
91-
# sform_code 2 1
92-
# quatern_b 0.0 -1.9451068140294884e-26
93-
# quatern_c 0.0 -0.9967085123062134
94-
# quatern_d 0.0 -0.0810687392950058
95-
# qoffset_x 0.0 117.8551025390625
96-
# qoffset_y 0.0 -35.72294235229492
97-
# qoffset_z 0.0 -7.248798370361328
98-
# srow_x [1.0, 0.0, 0.0, 0.0] [-2.0, 6.7147157e-19, 9.0810245e-18, 117.8551]
99-
# srow_y [0.0, 3.0, 0.0, 0.0] [-6.7147157e-19, 1.9737115, -0.35552824, -35.722942]
100-
# srow_z [0.0, 0.0, 2.0, 0.0] [8.2554809e-18, 0.32320762, 2.1710818, -7.2487984]
101-
# DATA(md5) 0a2576dd6badbb25bfb3b12076df986b b0abbc492b4fd533b2c80d82570062cf"""
10272
fnames2 = [pjoin(DATA_PATH, f)
10373
for f in ('example4d.nii.gz', 'example4d.nii.gz')]
104-
# code, stdout, stderr = run_command(['nib-diff'] + fnames, check_code=False)
105-
# # n1, n2 = 2300, 2400
106-
# # stdout, target_output = stdout[n1:n2], target_output[n1:n2]
107-
# delta_diff = difflib.context_diff(stdout, target_output)
108-
# print(''.join(delta_diff))
109-
# assert_equal(stdout, target_output)
110-
11174
code, stdout, stderr = run_command(['nib-diff'] + fnames2, check_code=False)
11275
assert_equal(stdout, "These files are identical.")
11376

0 commit comments

Comments
 (0)