There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

Commit ced9298f authored by Philipp Arras's avatar Philipp Arras

Add checks

parent d5b0b331
Pipeline #92508 passed with stages
in 11 minutes and 4 seconds
......@@ -633,7 +633,11 @@ class CorrelatedFieldMaker:
agnostic to changes in the volume of the target subdomain. This is in
steep contrast to the non-parametric amplitude operator in
:class:`~nifty7.library.correlated_fields.CorrelatedFieldMaker.add_fluctuations`.
Up to the Matern amplitude only works for `total_N == 0`.
"""
if self._total_N > 0:
raise NotImplementedError()
if harmonic_partner is None:
harmonic_partner = target_subdomain.get_default_codomain()
else:
......
......@@ -66,7 +66,7 @@ def testDistributor(dofdex, seed):
@pmp('flexibility', [None, (1, 1)])
@pmp('ind', [None, 1])
@pmp('matern', [True, False])
def test_init(total_N, asperity, flexibility, ind):
def test_init(total_N, asperity, flexibility, ind, matern):
if flexibility is None and asperity is not None:
pytest.skip()
cfg = 1, 1
......@@ -74,7 +74,11 @@ def test_init(total_N, asperity, flexibility, ind):
cfm = ift.CorrelatedFieldMaker.make(0, cfg, '', total_N, dofdex)
cfm.add_fluctuations(ift.RGSpace(4), cfg, flexibility, asperity, (-2, 0.1))
if matern:
cfm.add_fluctuations_matern(ift.RGSpace(4), *(3*[cfg]))
if total_N == 0:
cfm.add_fluctuations_matern(ift.RGSpace(4), *(3*[cfg]))
else:
with pytest.raises(NotImplementedError):
cfm.add_fluctuations_matern(ift.RGSpace(4), *(3*[cfg]))
else:
cfm.add_fluctuations(ift.RGSpace(4), *(4*[cfg]), index=ind)
cfm.finalize(0)
......
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