Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
e7b34733
Commit
e7b34733
authored
Feb 02, 2021
by
Lukas Platz
Browse files
add adjoint and repr test
parent
b2e8cde0
Pipeline
#96772
passed with stages
in 11 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_adjoint.py
View file @
e7b34733
...
...
@@ -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
],
...
...
test/test_operators/test_representation.py
View file @
e7b34733
...
...
@@ -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
],
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment