Skip to content
Snippets Groups Projects
Commit 0a124475 authored by Andreas Klöckner's avatar Andreas Klöckner Committed by Andreas Klöckner
Browse files

Add test_abs_complex


Co-authored-by: default avatarAlex Fikl <alexfikl@gmail.com>
parent deb2a813
No related branches found
No related tags found
No related merge requests found
......@@ -784,6 +784,17 @@ def test_container_equality(actx_factory):
assert isinstance(bcast_dc_of_dofs == bcast_dc_of_dofs_2, MyContainerDOFBcast)
def test_abs_complex(actx_factory):
actx = actx_factory()
a = np.random.randn(2000) + 1j * np.random.randn(2000)
abs_a_ref = np.abs(a)
abs_a = actx.np.abs(actx.from_numpy(a))
assert abs_a.dtype == abs_a_ref.dtype
np.testing.assert_allclose(actx.to_numpy(abs_a), abs_a_ref)
if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
......
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