Skip to content

Evaluate a purely functional sequence for label -> location mapping / filtering in Python LabelIndex #212

@benknoll-umn

Description

@benknoll-umn

Currently LabelIndex in Python uses a [self._labels[i].location for i in self._indices] for creating the locations sequence.
This has the effect of creating a new list the same length for each label index upon the first function call that uses the locations. Should test the performance implications and whether there's value in using a functional Sequence class implementation i.e.

def __getitem__(self, i):
        if isinstance(i, slice):
            return [map(lambda x: self._labels[x].location, self._indices[i])]
        return self._labels[self._indices[i]].location

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions