Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
b2746955
Commit
b2746955
authored
May 27, 2020
by
Philipp Arras
Browse files
Cleanup
parent
0cba5f1f
Pipeline
#75655
passed with stages
in 9 minutes and 11 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_contraction_operator.py
View file @
b2746955
...
...
@@ -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
)
...
...
test/test_operators/test_integration.py
View file @
b2746955
...
...
@@ -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
]:
...
...
test/test_operators/test_vdot_operator.py
View file @
b2746955
...
...
@@ -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?
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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