Skip to content

Commit 8c17f1a

Browse files
committed
TEST: Coerce close_up_to_column_sign args to arrays before checking for equality
1 parent f4a1f52 commit 8c17f1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nipype/algorithms/tests/test_CompCor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
def close_up_to_column_sign(a, b, rtol=1e-05, atol=1e-08, equal_nan=False):
1414
"""SVD can produce sign flips on a per-column basis."""
15+
a = np.asanyarray(a)
16+
b = np.asanyarray(b)
1517
kwargs = dict(rtol=rtol, atol=atol, equal_nan=equal_nan)
1618
if np.allclose(a, b, **kwargs):
1719
return True
@@ -33,8 +35,6 @@ def close_up_to_column_sign(a, b, rtol=1e-05, atol=1e-08, equal_nan=False):
3335
],
3436
)
3537
def test_close_up_to_column_sign(a, b, close):
36-
a = np.asanyarray(a)
37-
b = np.asanyarray(b)
3838
assert close_up_to_column_sign(a, b) == close
3939
# Sign flips of all columns never changes result
4040
assert close_up_to_column_sign(a, -b) == close

0 commit comments

Comments
 (0)