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

Make behaviour of extract_part compatible with logic for constant ops

parent 08f62b23
......@@ -251,8 +251,10 @@ class MultiField(Operator):
def extract_part(self, subset):
if subset is self._domain:
return self
return MultiField.from_dict({key: self[key] for key in subset.keys()
if key in self})
dct = {key: self[key] for key in subset.keys() if key in self}
if len(dct) == 0:
return None
return MultiField.from_dict(dct)
def unite(self, other):
"""Merges two MultiFields on potentially different MultiDomains.
......
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