Skip to content
Snippets Groups Projects
Commit 6b172fa1 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add test

parent 94e7b58a
No related branches found
No related tags found
2 merge requests!583Restructure tensors,!568Operator abs
Pipeline #81610 passed
......@@ -57,7 +57,7 @@ def _reciprocal_helper(v):
def _abs_helper(v):
if np.issubdtype(v.dtype, np.complexfloating):
raise TypeError("Argument must not be complex")
raise TypeError("Argument must not be complex because abs(z) is not holomorphic")
return (np.abs(v), np.where(v == 0, np.nan, np.sign(v)))
......
......@@ -110,6 +110,13 @@ def testAdder(space, seed, neg):
ift.extra.check_operator(op, f, ntries=ntries)
def testAbs(space, seed):
with ift.random.Context(seed):
f = ift.from_random(space, 'normal')
op = abs(ift.ScalingOperator(space, 1.))
ift.extra.check_operator(op, f, ntries=ntries)
@pmp('target', [ift.RGSpace(64, distances=.789, harmonic=True),
ift.RGSpace([10, 10], distances=.789, harmonic=True)])
@pmp('causal', [True, False])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment