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

Performance tweak

parent 9f326661
Pipeline #31628 failed with stages
in 3 minutes and 49 seconds
......@@ -17,7 +17,6 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from ..operators import LinearOperator
from ..sugar import full
class SelectionOperator(LinearOperator):
......@@ -46,11 +45,5 @@ class SelectionOperator(LinearOperator):
if mode == self.TIMES:
return x[self._key].copy()
result = {}
for key, val in self.domain.items():
if key != self._key:
result[key] = full(val, 0.)
result[key] = x.copy()
from ..multi import MultiField
return MultiField(result)
return MultiField({self._key: x})
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