Skip to content

Commit 4e2abf0

Browse files
committed
TEST: Fix tests for PY312, NP2
1 parent 66001b1 commit 4e2abf0

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

nitransforms/io/afni.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _is_oblique(affine, thres=OBLIQUITY_THRESHOLD_DEG):
237237
True
238238
239239
"""
240-
return (obliquity(affine).max() * 180 / pi) > thres
240+
return float(obliquity(affine).max() * 180 / pi) > thres
241241

242242

243243
def _afni_deobliqued_grid(oblique, shape):

nitransforms/io/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ class LinearParameters(LinearTransformStruct):
7676
Examples
7777
--------
7878
>>> lp = LinearParameters()
79-
>>> np.all(lp.structarr['parameters'] == np.eye(4))
79+
>>> np.array_equal(lp.structarr['parameters'], np.eye(4))
8080
True
8181
8282
>>> p = np.diag([2., 2., 2., 1.])
8383
>>> lp = LinearParameters(p)
84-
>>> np.all(lp.structarr['parameters'] == p)
84+
>>> np.array_equal(lp.structarr['parameters'], p)
8585
True
8686
8787
"""

nitransforms/tests/test_version.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
"""Test _version.py."""
22
import sys
33
from collections import namedtuple
4-
from pkg_resources import DistributionNotFound
54
from importlib import reload
5+
import pytest
66
import nitransforms
77

8+
try:
9+
from pkg_resources import DistributionNotFound
10+
except ImportError:
11+
pytest.skip(allow_module_level=True)
12+
813

914
def test_version_scm0(monkeypatch):
1015
"""Retrieve the version via setuptools_scm."""

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ test =
4949
pytest-cov
5050
pytest-env
5151
codecov
52+
lxml
5253
tests =
5354
%(test)s
5455

0 commit comments

Comments
 (0)