diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 912eaf9d..7474dda3 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -15,10 +15,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - name: Install pip dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c0bad02..b7e5bf5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,7 +112,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python: ['3.9', '3.11'] + python: ['3.10', '3.11'] os: [ubuntu-latest] steps: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 02dc5666..69d848c4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,9 +7,9 @@ version: 2 # Set the version of Python and other tools you might need build: - os: ubuntu-20.04 + os: ubuntu-24.04 tools: - python: '3.8' + python: '3.11' apt_packages: - r-base diff --git a/setup.cfg b/setup.cfg index 392c6ee5..23e359b4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,34 +17,34 @@ author = Malte D. Luecken, Maren Buettner, Daniel C. Strobl, Michaela F. Mueller author_email = malte.luecken@helmholtz-muenchen.de, michaela.mueller@helmholtz-muenchen.de license = MIT url = https://github.com/theislab/scib -project_urls = +project_urls = Pipeline = https://github.com/theislab/scib-pipeline Reproducibility = https://theislab.github.io/scib-reproducibility Bug Tracker = https://github.com/theislab/scib/issues -keywords = +keywords = benchmarking single cell data integration -classifiers = +classifiers = Development Status :: 3 - Alpha Intended Audience :: Developers Intended Audience :: Science/Research Topic :: Software Development :: Build Tools License :: OSI Approved :: MIT License Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 [bdist_wheel] build_number = 1 [options] -packages = +packages = scib scib.metrics -python_requires = >=3.8 -install_requires = +python_requires = >=3.9 +install_requires = numpy pandas>=2 seaborn @@ -65,7 +65,7 @@ install_requires = zip_safe = False [options.package_data] -scib = +scib = resources/*.txt knn_graph/* @@ -93,9 +93,9 @@ skip_glob = docs/* [tool.black] line-length = 120 -target-version = py38 +target-version = py311 include = \.pyi?$ -exclude = +exclude = .eggs .git .venv @@ -104,7 +104,7 @@ exclude = [flake8] max-line-length = 88 -ignore = +ignore = W503 W504 E501 @@ -126,7 +126,7 @@ ignore = RST304 C408 exclude = .git,__pycache__,build,docs/_build,dist -per-file-ignores = +per-file-ignores = scib/*: D tests/*: D */__init__.py: F401 diff --git a/tests/metrics/rpy2/test_kbet.py b/tests/metrics/rpy2/test_kbet.py index 8e8f2910..4990a6ce 100644 --- a/tests/metrics/rpy2/test_kbet.py +++ b/tests/metrics/rpy2/test_kbet.py @@ -1,3 +1,7 @@ +import numpy as np +import scanpy as sc +from tqdm import tqdm + import scib from tests.common import LOGGER, assert_near_exact @@ -7,4 +11,21 @@ def test_kbet(adata_pca): adata_pca, batch_key="batch", label_key="celltype", embed="X_pca", type_="full" ) LOGGER.info(f"score: {score}") - assert_near_exact(score, 0.556108994805538, diff=1e-02) + assert_near_exact(score, 0.55, diff=1e-01) + + +def test_kbet_random(adata_pca): + scores = [] + for _ in tqdm(range(5)): + adata_pca.obs["batch"] = adata_pca.obs["batch"].sample(frac=1).values + sc.pp.pca(adata_pca, n_comps=20, use_highly_variable=True) + score = scib.me.kBET( + adata_pca, + batch_key="batch", + label_key="celltype", + embed="X_pca", + type_="full", + ) + LOGGER.info(f"score: {score}") + scores.append(score) + assert_near_exact(np.mean(scores), 0.8, diff=1e-01)