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

Add tests for pass through calls of scanpy functions #792

Open
eroell opened this issue Aug 26, 2024 · 1 comment
Open

Add tests for pass through calls of scanpy functions #792

eroell opened this issue Aug 26, 2024 · 1 comment
Assignees
Labels
ci Continuous Integration testing Testing

Comments

@eroell
Copy link
Collaborator

eroell commented Aug 26, 2024

Description of feature

We are right now not testing the pass through calls of scanpy functions work smoothly. As we are using the public scanpy API and watch scanpy closely, I don't expect this to cause a lot of troubles.

Nonetheless it would be great to check during CI that this remains the case I think - else these functions are hardly covered during testing.

E.g. we could check

from types import MappingProxyType
from unittest.mock import patch

import ehrapy as ep  # import your_pass_through_function


def test_pass_through_function(adata_mini):
    with patch("scanpy.pp.neighbors") as mock_scanpy_neighbors:

        ep.pp.neighbors(adata_mini)

        mock_scanpy_neighbors.assert_called_once_with(
            adata=adata_mini,
            n_neighbors=15,
            n_pcs=None,
            use_rep=None,
            knn=True,
            random_state=0,
            method="umap",
            transformer=None,
            metric="euclidean",
            metric_kwds=MappingProxyType({}),
            key_added=None,
            copy=False
            )

Thoughts @Zethson?

@eroell eroell added the enhancement New feature or request label Aug 26, 2024
@eroell eroell self-assigned this Aug 26, 2024
@eroell eroell added testing Testing and removed enhancement New feature or request labels Aug 26, 2024
@eroell
Copy link
Collaborator Author

eroell commented Aug 30, 2024

Or have a test function which merely calls they scanpy function, ensuring all of them run once.
Also test against scanpy main, for earlier checks on development.

This includes modifying the testing CI wait for Python3.12 support PR

@eroell eroell added the ci Continuous Integration label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration testing Testing
Projects
None yet
Development

No branches or pull requests

1 participant