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

Test _SlowFieldAdapter

parent c88eadc1
No related branches found
No related tags found
1 merge request!368Add more automatic checks for operators
Pipeline #63060 failed
...@@ -187,9 +187,7 @@ class _SlowFieldAdapter(LinearOperator): ...@@ -187,9 +187,7 @@ class _SlowFieldAdapter(LinearOperator):
self._check_input(x, mode) self._check_input(x, mode)
if isinstance(x, MultiField): if isinstance(x, MultiField):
return x[self._name] 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): def __repr__(self):
return '_SlowFieldAdapter' return '_SlowFieldAdapter'
......
...@@ -319,3 +319,10 @@ def testPartialExtractor(seed): ...@@ -319,3 +319,10 @@ def testPartialExtractor(seed):
tgt = ift.MultiDomain.make(tgt) tgt = ift.MultiDomain.make(tgt)
op = ift.PartialExtractor(dom, tgt) op = ift.PartialExtractor(dom, tgt)
ift.extra.consistency_check(op) 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment