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

Added approximate KNN backend #791

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

nicolassidoux
Copy link
Collaborator

I had to from scanpy.neighbors._types import KnnTransformerLike, _KnownTransformer to make transformer argument of neighbors() consistent with scanpy. But _types is protected...

@nicolassidoux nicolassidoux linked an issue Aug 24, 2024 that may be closed by this pull request
@nicolassidoux nicolassidoux marked this pull request as ready for review August 24, 2024 14:04
@Zethson Zethson requested a review from eroell August 25, 2024 22:15
@eroell
Copy link
Collaborator

eroell commented Aug 26, 2024

@Zethson what is your stance on importing private variables from scanpy, as we are doing elsewhere too?

I remember in the past you've added a fix of a previously imported, external private variable by defining the required variable ourselves.

I lean towards doing this here too

ehrapy/preprocessing/_scanpy_pp_api.py Outdated Show resolved Hide resolved
ehrapy/preprocessing/_scanpy_pp_api.py Outdated Show resolved Hide resolved
ehrapy/preprocessing/_scanpy_pp_api.py Outdated Show resolved Hide resolved
ehrapy/preprocessing/_scanpy_pp_api.py Outdated Show resolved Hide resolved
transformer
Approximate kNN search implementation following the API of
:class:`~sklearn.neighbors.KNeighborsTransformer`.
See :doc:`/how-to/knn-transformers` for more details.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link breaks in our documentation as this was from the scanpy doc; but we could insert the full scanpy doc link instead https://scanpy.readthedocs.io/en/latest/how-to/knn-transformers.html & make a quick comment that this is scanpy but works the same for ehrapy

`'pynndescent'`
:class:`~pynndescent.pynndescent_.PyNNDescentTransformer`
`'rapids'`
A transformer based on :class:`cuml.neighbors.NearestNeighbors`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here can either add "deprecated since scanpy version 1.10.0" such that its clear where 1.10.0 comes from, or hide this from the beginning as its deprecated already?
Then, would also need to remove from _KnownTransformer if we write this ourselves see question on what to do about private variables below

@Zethson
Copy link
Member

Zethson commented Aug 26, 2024

@Zethson what is your stance on importing private variables from scanpy, as we are doing elsewhere too?

I remember in the past you've added a fix of a previously imported, external private variable by defining the required variable ourselves.

I lean towards doing this here too

Yeah, we should try to avoid importing internals so I think that's a good option.

@eroell
Copy link
Collaborator

eroell commented Aug 26, 2024

Thank you so much @nicolassidoux !
One thing I realized here was that we should add tests for the pass through function calls of scanpy...

But this is from our side so far a lacking suite of tests (as we as of now have been closely eyeing scanpy), and hence no test suite at this point to add to here :)

@eroell
Copy link
Collaborator

eroell commented Oct 18, 2024

ready for me to take a quick look again or are you still doing stuff? :)

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

Successfully merging this pull request may close these issues.

Add approximate KNN backend
3 participants