It's not generally a slow process. There's a sorting going on in the method which is going to be removed soon (see NeuralEnsemble/python-neo#545) and ignoring that, it's an O(N) function. Now, N is the number of signals first in a Group/Segment, and then for the whole Block, so all in all the entire reading process reads through the DataArrays twice. Since we're reading all the DataArrays in a Block anyway, we might as well collect them before descending into a Group and use a per-block collection/grouping of signals.
The
_group_signals()
method is called once per Group/Segment https://github.com/G-Node/python-neo/blob/6bda7897756be1b950efdf708bd4a1197deed86e/neo/io/nixio.py#L283and then a final time in each Block to find "groupless" signals: https://github.com/G-Node/python-neo/blob/6bda7897756be1b950efdf708bd4a1197deed86e/neo/io/nixio.py#L242
It's not generally a slow process. There's a sorting going on in the method which is going to be removed soon (see NeuralEnsemble/python-neo#545) and ignoring that, it's an O(N) function. Now, N is the number of signals first in a Group/Segment, and then for the whole Block, so all in all the entire reading process reads through the DataArrays twice. Since we're reading all the DataArrays in a Block anyway, we might as well collect them before descending into a Group and use a per-block collection/grouping of signals.