Skip to content
Snippets Groups Projects
Commit e5f17f22 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add tests

parent c858374e
No related branches found
No related tags found
1 merge request!472Correlated field docstrings
Pipeline #75303 failed
......@@ -52,7 +52,11 @@ def testAmplitudesInvariants(sspace, N):
'freq', dofdex=dofdex3)
op = fa.finalize()
samples = [ift.from_random(op.domain, 'normal') for _ in range(100)]
for ampl in fa.normalized_amplitudes:
ift.extra.check_jacobian_consistency(ampl, ift.from_random(ampl.domain),
ntries=10)
samples = [ift.from_random(op.domain) for _ in range(100)]
tot_flm, _ = _stats(fa.total_fluctuation, samples)
offset_amp_std, _ = _stats(fa.amplitude_total_offset, samples)
intergated_fluct_std0, _ = _stats(fa.average_fluctuation(0), samples)
......
......@@ -161,3 +161,10 @@ def testNormalization(h_space, specialbinbounds, logarithmic, nbin):
op = ift.library.correlated_fields._Normalization(dom)
pos = 0.1 * ift.from_random(op.domain, 'normal')
ift.extra.check_jacobian_consistency(op, pos, ntries=10)
@pmp('N', [1, 3])
def testMomentMatchingJacobian(N):
op = ift.library.correlated_fields._LognormalMomentMatching(1, 0.2, '', N)
ift.extra.check_jacobian_consistency(op, ift.from_random(op.domain),
ntries=10)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment