Skip to content

Commit

Permalink
speed up len() and .shape for neuronlists
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jun 27, 2018
1 parent 65be9f2 commit 3a044cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymaid/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,8 @@ def __next__(self):
return prange_iter(self.neurons, 0)

def __len__(self):
return len(self.neurons)
"""Use skeleton ID here, otherwise this is terribly slow."""
return len(self.skeleton_id)

def __getattr__(self, key):
if key == 'shape':
Expand Down

0 comments on commit 3a044cf

Please sign in to comment.