Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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‎

Lines changed: 2 additions & 2 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /