Skip to content

Commit

Permalink
Fix computation of expanded selector union.
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedov committed Feb 12, 2015
1 parent baf2fc5 commit 4c73c1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions neurokernel/plsel.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ def union(cls, *sels):
"""

out = cls('')
out._expanded = \
tuple(sorted(reduce(lambda a, b: set(a.expanded).union(b.expanded), sels)))
tmp = set()
for s in sels:
tmp = tmp.union(s.expanded)
out._expanded = tuple(sorted(tmp))
try:
out._max_levels = max([s.max_levels for s in sels if s.nonempty])
except ValueError:
Expand Down

0 comments on commit 4c73c1f

Please sign in to comment.