Skip to content

Commit 6a7608d

Browse files
authored
Merge branch 'master' into sty/ruff
2 parents e1654e8 + 2e5dcb5 commit 6a7608d

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

niworkflows/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def find_resource_or_skip(resource):
5050
return pathlike
5151

5252

53+
@pytest.fixture(scope="session", autouse=True)
54+
def legacy_printoptions():
55+
from packaging.version import Version
56+
57+
if Version(np.__version__) >= Version("1.22"):
58+
np.set_printoptions(legacy="1.21")
59+
60+
5361
@pytest.fixture(autouse=True)
5462
def _add_np(doctest_namespace):
5563
from .testing import data_dir, data_dir_canary

niworkflows/interfaces/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,6 @@ def _run_interface(self, runtime):
729729

730730
output = np.vstack((self.inputs.class_labels, series.astype(str)))
731731
self._results['out_file'] = os.path.join(runtime.cwd, self.inputs.out_file)
732-
np.savetxt(self._results['out_file'], output, fmt=b'%s', delimiter='\t')
732+
np.savetxt(self._results['out_file'], output, fmt='%s', delimiter='\t')
733733

734734
return runtime

niworkflows/tests/test_confounds.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ def test_expansion_derivatives_and_powers():
101101
{
102102
'a': [-1, -2, -3, -4, -5],
103103
'a_power2': [1, 4, 9, 16, 25],
104-
'a_derivative1': [np.NaN, -1, -1, -1, -1],
105-
'a_derivative1_power2': [np.NaN, 1, 1, 1, 1],
106-
'b_derivative1': [np.NaN, 0, 0, 0, 0],
107-
'b_derivative1_power2': [np.NaN, 0, 0, 0, 0],
108-
'c_power2_derivative1': [np.NaN, 1, -1, 1, -1],
109-
'c_power2_derivative2': [np.NaN, np.NaN, -2, 2, -2],
104+
'a_derivative1': [np.nan, -1, -1, -1, -1],
105+
'a_derivative1_power2': [np.nan, 1, 1, 1, 1],
106+
'b_derivative1': [np.nan, 0, 0, 0, 0],
107+
'b_derivative1_power2': [np.nan, 0, 0, 0, 0],
108+
'c_power2_derivative1': [np.nan, 1, -1, 1, -1],
109+
'c_power2_derivative2': [np.nan, np.nan, -2, 2, -2],
110110
'd': [9, 7, 5, 3, 1],
111111
'e': [0, 0, 0, 0, 0],
112-
'f': [np.NaN, 6, 4, 2, 0],
112+
'f': [np.nan, 6, 4, 2, 0],
113113
}
114114
)
115115
exp_data = _expand_test(model_formula)
@@ -123,10 +123,10 @@ def test_expansion_na_robustness():
123123
model_formula = '(dd1(f))^^2'
124124
expected_data = pd.DataFrame(
125125
{
126-
'f': [np.NaN, 6, 4, 2, 0],
127-
'f_power2': [np.NaN, 36, 16, 4, 0],
128-
'f_derivative1': [np.NaN, np.NaN, -2, -2, -2],
129-
'f_derivative1_power2': [np.NaN, np.NaN, 4, 4, 4],
126+
'f': [np.nan, 6, 4, 2, 0],
127+
'f_power2': [np.nan, 36, 16, 4, 0],
128+
'f_derivative1': [np.nan, np.nan, -2, -2, -2],
129+
'f_derivative1_power2': [np.nan, np.nan, 4, 4, 4],
130130
}
131131
)
132132
exp_data = _expand_test(model_formula)

0 commit comments

Comments
 (0)