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
8371ff35
Commit
8371ff35
authored
May 06, 2021
by
Gordian Edenhofer
Browse files
test_correlated_fields.py: Test no zm explicitly
parent
13f0d6d5
Pipeline
#101018
passed with stages
in 12 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_correlated_fields.py
View file @
8371ff35
...
...
@@ -86,6 +86,35 @@ def test_init(total_N, offset_std, asperity, flexibility, ind, matern):
cfm
.
finalize
(
prior_info
=
0
)
@
pmp
(
'sspace'
,
spaces
)
@
pmp
(
'asperity'
,
[
None
,
(
1
,
1
)])
@
pmp
(
'flexibility'
,
[
None
,
(
1
,
1
)])
@
pmp
(
'matern'
,
[
True
,
False
])
def
test_constant_zero_mode
(
sspace
,
asperity
,
flexibility
,
matern
):
if
flexibility
is
None
and
asperity
is
not
None
:
pytest
.
skip
()
cfg
=
1
,
1
cfm
=
ift
.
CorrelatedFieldMaker
(
''
)
if
matern
:
cfm
.
add_fluctuations_matern
(
sspace
,
*
(
3
*
[
cfg
]))
else
:
cfm
.
add_fluctuations
(
sspace
,
*
(
4
*
[
cfg
]))
cfm
.
set_amplitude_total_offset
(
0
,
None
)
cf
=
cfm
.
finalize
(
prior_info
=
0
)
r
=
ift
.
from_random
(
cf
.
domain
).
to_dict
()
r_xi
=
np
.
copy
(
r
[
"xi"
].
val
)
r_xi
[
0
]
=
1.
r
[
"xi"
]
=
ift
.
Field
(
r
[
"xi"
].
domain
,
r_xi
)
r
=
ift
.
MultiField
.
from_dict
(
r
)
cf_r
=
cf
(
r
)
rtol
=
1e-7
if
isinstance
(
sspace
,
(
ift
.
HPSpace
,
ift
.
GLSpace
)):
rtol
=
1e-2
assert_allclose
(
cf_r
.
s_integrate
(),
sspace
.
total_volume
,
rtol
=
rtol
)
@
pmp
(
'sspace'
,
spaces
)
@
pmp
(
'N'
,
[
0
,
2
])
def
testAmplitudesInvariants
(
sspace
,
N
):
...
...
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