Skip to content

Commit c12e031

Browse files
author
Ben Cipollini
committed
fix: prints
1 parent f3cd2fb commit c12e031

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nibabel/tests/test_round_trip.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ def check_arr(test_id, V_in, in_type, out_type, scaling_type):
188188
abs_max_diff,
189189
abs_fails.sum(),
190190
abs_fails.size))
191-
print("\ttop[fails][:2] = %s" % str(top[abs_fails][:2])) # up to 2
192-
print("\tarr[fails][:2] = %s" % str(arr[abs_fails][:2])) # up to 2
193191

194192
if np.any(rel_fails):
195193
rel_max_diff = (rel_err - rel_thresh)[rel_fails].max()
@@ -199,12 +197,15 @@ def check_arr(test_id, V_in, in_type, out_type, scaling_type):
199197
rel_max_diff,
200198
rel_fails.sum(),
201199
rel_fails.size))
202-
print("\ttop[fails][:2] = %s" % str(top[abs_fails][:2])) # up to 2
203-
print("\tarr[fails][:2] = %s" % str(arr[abs_fails][:2])) # up to 2
200+
# Print up to two entries of raw and round trip data.
201+
all_fails = np.logical_and(abs_fails, rel_fails)
202+
print("\ttop[fails][:2] = %s" % str(top[all_fails][:2]))
203+
print("\tarr[fails][:2] = %s" % str(arr[all_fails][:2]))
204+
print("\tarr_dash[fails][:2] = %s" % str(arr_dash[all_fails][:2]))
205+
print("\tarr_dash_L[fails][:2] = %s" % str(arr_dash_L[all_fails][:2]))
204206
print("")
205207

206208
# To help debugging failures with --pdb-failure
207-
all_fails = np.logical_or(abs_fails, rel_fails)
208209
fail_i = np.nonzero(all_fails)
209210

210211
assert_true(this_test, "types == %s, %s; see stdout for details" % (

0 commit comments

Comments
 (0)