Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
benknoll-umn opened this issue Oct 12, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@benknoll-umn
Copy link
Member

benknoll-umn commented Oct 12, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant