diff --git a/nifty5/operators/simple_linear_operators.py b/nifty5/operators/simple_linear_operators.py index ba7c3eecc8e52cd050827492089084e94adac4fd..f8c7c75d99ab69eb312c3bb22958301c66a8fb93 100644 --- a/nifty5/operators/simple_linear_operators.py +++ b/nifty5/operators/simple_linear_operators.py @@ -187,9 +187,7 @@ class _SlowFieldAdapter(LinearOperator): self._check_input(x, mode) if isinstance(x, MultiField): return x[self._name] - else: - return MultiField.from_dict({self._name: x}, - domain=self._tgt(mode)) + return MultiField.from_dict({self._name: x}, domain=self._tgt(mode)) def __repr__(self): return '_SlowFieldAdapter' diff --git a/test/test_operators/test_adjoint.py b/test/test_operators/test_adjoint.py index f89fdedcda14f9729fb8c7341fac173764a5e6bf..9e37ee82a8c76fff443c142c2abc45df763cf1fb 100644 --- a/test/test_operators/test_adjoint.py +++ b/test/test_operators/test_adjoint.py @@ -319,3 +319,10 @@ def testPartialExtractor(seed): tgt = ift.MultiDomain.make(tgt) op = ift.PartialExtractor(dom, tgt) ift.extra.consistency_check(op) + + +@pmp('seed', [12, 3]) +def testSlowFieldAdapter(seed): + dom = {'a': ift.RGSpace(1), 'b': ift.RGSpace(2)} + op = ift.operators.simple_linear_operators._SlowFieldAdapter(dom, 'a') + ift.extra.consistency_check(op)