Skip to content

Commit

Permalink
resolve #1280
Browse files Browse the repository at this point in the history
  • Loading branch information
rgourdine committed Mar 15, 2024
1 parent f64b609 commit 122c1e2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion share/lib/python/neuron/rxd/nodelist.py
Expand Up @@ -17,7 +17,16 @@ def __init__(self, items):

def __call__(self, restriction):
"""returns a sub-NodeList consisting of nodes satisfying restriction"""
return NodeList([i for i in self if i.satisfies(restriction)])
r = []
for i in self:
try:
if i.satisfies(restriction):
r.append(i)
except RxDException:
pass
if len(r) == 0:
raise RxDException(f"unrecognized node condition: {restriction}")
return NodeList(r)

def __getitem__(self, key):
if isinstance(key, slice):
Expand Down

0 comments on commit 122c1e2

Please sign in to comment.