Commit ced9298f authored by Philipp Arras's avatar Philipp Arras
Browse files

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
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()
......@@ -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:
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]))
with pytest.raises(NotImplementedError):
cfm.add_fluctuations_matern(ift.RGSpace(4), *(3*[cfg]))
cfm.add_fluctuations(ift.RGSpace(4), *(4*[cfg]), index=ind)
Supports Markdown
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