Commit b2746955 authored by Philipp Arras's avatar Philipp Arras
Browse files

Cleanup

parent 0cba5f1f
Pipeline #75655 passed with stages
in 9 minutes and 11 seconds
......@@ -23,7 +23,7 @@ import nifty6 as ift
from ..common import setup_function, teardown_function
def test_contraction_operator(): # actually this tests .sum() -> clarification
def test_operator_sum():
x1 = ift.RGSpace((9,), distances=2.)
x2 = ift.RGSpace((2, 12), distances=(0.3,))
dom1 = ift.makeDomain(x1)
......@@ -47,9 +47,9 @@ def test_contraction_operator(): # actually this tests .sum() -> clarification
assert_allclose(res4.val, res6)
res7 = f2.sum(spaces=1)
res8 = op3(f2)
res9 = arr2.sum(axis=(1,2))
res9 = arr2.sum(axis=(1, 2))
assert_allclose(res7.val, res8.val)
assert_allclose(res7.val,res9)
assert_allclose(res7.val, res9)
for op in [op1, op2, op3]:
ift.extra.consistency_check(op, domain_dtype=np.float64,
target_dtype=np.float64)
......
......@@ -35,17 +35,17 @@ def test_integration_operator():
op3 = ift.ScalingOperator(dom2, 1).integrate(spaces=1)
res1 = f1.integrate()
res2 = op1(f1)
res3 = (f1.val*x1.dvol).sum() #richtig?
res3 = (f1.val*x1.dvol).sum()
assert_allclose(res1.val, res2.val)
assert_allclose(res1.val, res3)
res4 = f2.integrate()
res5 = op2(f2)
res6 = (f2.val*x1.dvol*x2.dvol).sum() # richtig?
res6 = (f2.val*x1.dvol*x2.dvol).sum()
assert_allclose(res4.val, res5.val)
assert_allclose(res4.val, res6)
res7 = f2.integrate(spaces=1)
res8 = op3(f2)
res9 = (f2.val*x2.dvol).sum(axis=(1,2))
res9 = (f2.val*x2.dvol).sum(axis=(1, 2))
assert_allclose(res7.val, res8.val)
assert_allclose(res7.val, res9)
for op in [op1, op2, op3]:
......
......@@ -22,6 +22,7 @@ import nifty6 as ift
from ..common import setup_function, teardown_function
def test_vdot_operator():
dom = ift.makeDomain(ift.RGSpace(8))
fa_1 = ift.FieldAdapter(dom, 'f1')
......@@ -36,4 +37,3 @@ def test_vdot_operator():
assert_allclose(res1.val, res2.val)
assert_allclose(res1.val, res3)
ift.extra.check_jacobian_consistency(op1, f)
#another Test for linearization?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment