Skip to content
Snippets Groups Projects
Commit b0af7bfb authored by Kaushik Kulkarni's avatar Kaushik Kulkarni
Browse files

take to_numpy before comparing actx's scalars

parent c1d90703
No related branches found
No related tags found
No related merge requests found
......@@ -257,7 +257,7 @@ def test_actx_stack(actx_factory):
ndofs = 5000
args = [np.random.randn(ndofs) for i in range(10)]
assert_close_to_numpy(
assert_close_to_numpy_in_containers(
actx, lambda _np, *_args: _np.stack(_args), args)
......@@ -656,9 +656,8 @@ def test_container_arithmetic(actx_factory):
bcast_result = ary_dof + bcast_dc_of_dofs
bcast_dc_of_dofs + ary_dof
res = bcast_result.mass - 2*ary_of_dofs
assert np.linalg.norm(actx.to_numpy(res[0][0]) < 1e-8)
assert actx.to_numpy(actx.np.linalg.norm(bcast_result.mass
- 2*ary_of_dofs)) < 1e-8
mock_gradient = MyContainerDOFBcast(
name="yo",
......@@ -670,9 +669,8 @@ def test_container_arithmetic(actx_factory):
assert isinstance(grad_matvec_result.mass, DOFArray)
assert grad_matvec_result.momentum.shape == (3,)
res = grad_matvec_result.mass - 3*ary_of_dofs**2
assert np.linalg.norm(actx.to_numpy(res[0][0]) < 1e-8)
assert actx.to_numpy(actx.np.linalg.norm(grad_matvec_result.mass
- 3*ary_of_dofs**2)) < 1e-8
# }}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment