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

index.RevIndex is not a fully implemented Index class #1939

Open
ctb opened this issue Apr 10, 2022 · 2 comments
Open

index.RevIndex is not a fully implemented Index class #1939

ctb opened this issue Apr 10, 2022 · 2 comments

Comments

@ctb
Copy link
Contributor

ctb commented Apr 10, 2022

In #1936, I'm adding tests for basic features of the Index class, and RevIndex doesn't pass them. (RevIndex is the rust-based reverse index added in #1238.)

When uncommenting the build_revindex part of the index_obj fixture in tests/test_index_protocols.py from #1936, we see that select with the wrong ksize doesn't work:


self = <sourmash.index.revindex.RevIndex object at 0x7fd5d02b8cd0>, ksize = 21
moltype = None, kwargs = {}

    def select(self, ksize=None, moltype=None, **kwargs):
        if self.template:
            if ksize:
>               self.template.ksize = ksize
E               AttributeError: can't set attribute

src/sourmash/index/revindex.py:152: AttributeError

We might also want to do more specific tests of RevIndex in tests/test_index.py and/or add docs on its value, API, and intended use.

@luizirber
Copy link
Member

I think select wasn't around when I started implementing RevIndex...

(there is a LOT of fixes to be done in RevIndex, I don't think it even uses prefetch, search and gather to their full extent)

@ctb
Copy link
Contributor Author

ctb commented Apr 10, 2022

sure, no huhu or urgency:). But once we have more thorough API tests as in #1936, we could use them to fix up RevIndex!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants