Skip to content

Commit dbd835f

Browse files
j-c-cgarrettwrong
authored andcommitted
test_coef dtype patch for osx.
1 parent fa66a28 commit dbd835f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_coef.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def dtype(request):
4848
return request.param
4949

5050

51-
@pytest.fixture(params=DTYPES, ids=lambda x: f"dtype={x}", scope="module")
51+
@pytest.fixture(params=DTYPES, ids=lambda x: f"basis_dtype={x}", scope="module")
5252
def basis_dtype(request):
5353
"""
5454
Dtypes for basis
@@ -416,11 +416,16 @@ def test_shifts(coef_fixture, basis, rots):
416416
shifts = np.column_stack((rots, rots[::-1]))
417417

418418
# Compare
419+
min_dtype = (
420+
np.float32
421+
if (basis.dtype == np.float32 or coef_fixture.dtype == np.float32)
422+
else np.float64
423+
)
419424
np.testing.assert_allclose(
420425
coef_fixture.shift(shifts),
421426
basis.shift(coef_fixture, shifts),
422427
rtol=1e-05,
423-
atol=utest_tolerance(basis.dtype),
428+
atol=utest_tolerance(min_dtype),
424429
)
425430

426431

0 commit comments

Comments
 (0)