Commit e7b34733 authored by Lukas Platz's avatar Lukas Platz
Browse files

add adjoint and repr test

parent b2e8cde0
Pipeline #96772 passed with stages
in 11 minutes and 56 seconds
......@@ -217,6 +217,23 @@ def testZeroPadder(space, factor, dtype, central):
ift.extra.check_linear_operator(op, dtype, dtype)
@pmp('space', [0, 2])
@pmp('factor', [1, 2, 2.7])
@pmp('offset', [False, True])
def testOffsetZeroPadder(space, factor, offset, dtype):
dom = (ift.RGSpace(4), ift.UnstructuredDomain(5), ift.RGSpace(3, 4),
ift.HPSpace(2))
newshape = [int(factor*ll) for ll in dom[space].shape]
if offset and factor > 1:
offset_val = (1,) * len(dom[space].shape)
else:
offset_val = None
op = ift.OffsetFieldZeroPadder(dom, newshape, space, offset_val)
ift.extra.check_linear_operator(op, dtype, dtype)
@pmp('args', [[ift.RGSpace((13, 52, 40)), (4, 6, 25), None],
[ift.RGSpace((128, 128)), (45, 48), 0],
[ift.RGSpace(13), (7,), None],
......
......@@ -180,6 +180,23 @@ def testZeroPadder(space, factor, dtype, central):
_check_repr(ift.FieldZeroPadder(dom, newshape, space, central))
@pmp('space', [0, 2])
@pmp('factor', [1, 2, 2.7])
@pmp('offset', [False, True])
def testOffsetZeroPadder(space, factor, offset, dtype):
dom = (ift.RGSpace(4), ift.UnstructuredDomain(5), ift.RGSpace(3, 4),
ift.HPSpace(2))
newshape = [int(factor*ll) for ll in dom[space].shape]
if offset and factor > 1:
offset_val = (1,) * len(dom[space].shape)
else:
offset_val = None
op = ift.OffsetFieldZeroPadder(dom, newshape, space, offset_val)
_check_repr(op)
@pmp('args', [[ift.RGSpace(
(13, 52, 40)), (4, 6, 25), None], [ift.RGSpace(
(128, 128)), (45, 48), 0], [ift.RGSpace(13), (7,), None], [
......
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