From d42f919b5b0aac86f19937d4d4d02bf2e4d8bdbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michaela=20M=C3=BCller?= <51025211+mumichae@users.noreply.github.com> Date: Wed, 10 Jan 2024 00:33:50 +0100 Subject: [PATCH] Update dependencies (#396) * pin pandas 2 and adapt breaking code * update scanorama * set minimum python version to 3.8 --- .github/workflows/deployment.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- scib/metrics/cell_cycle.py | 8 ++++++-- scib/metrics/trajectory.py | 2 +- setup.cfg | 28 ++++++++++++++-------------- tests/conftest.py | 4 ++-- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 40dcd0da..912eaf9d 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.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: '3.10' - name: Install pip dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfdc02bd..5207f21c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: '3.10' - uses: actions/cache@v3 with: @@ -32,7 +32,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python: [3.7, 3.9] + python: ['3.8', '3.10'] os: [ubuntu-latest, macos-latest] steps: @@ -74,7 +74,7 @@ jobs: strategy: matrix: r: [4.2] - python: [3.9] + python: ['3.10'] os: [ubuntu-latest] steps: - uses: actions/checkout@v3 @@ -112,7 +112,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python: [3.7, 3.9] + python: ['3.8', '3.10'] os: [ubuntu-latest] steps: diff --git a/scib/metrics/cell_cycle.py b/scib/metrics/cell_cycle.py index cc806378..b3d92845 100644 --- a/scib/metrics/cell_cycle.py +++ b/scib/metrics/cell_cycle.py @@ -122,8 +122,12 @@ def cell_cycle( if agg_func is None: return pd.DataFrame( - [batches, scores_before, scores_after, scores_final], - columns=["batch", "before", "after", "score"], + { + "batch": pd.Series(batches, dtype=str), + "before": pd.Series(scores_before, dtype=float), + "after": pd.Series(scores_after, dtype=float), + "score": pd.Series(scores_final, dtype=float), + } ) else: return agg_func(scores_final) diff --git a/scib/metrics/trajectory.py b/scib/metrics/trajectory.py index fb298be0..79faa80f 100644 --- a/scib/metrics/trajectory.py +++ b/scib/metrics/trajectory.py @@ -121,7 +121,7 @@ def get_root(adata_pre, adata_post, ct_key, pseudotime_key="dpt_pseudotime", dpt csgraph=adata_post.obsp["connectivities"], directed=False, return_labels=True ) - start_clust = adata_pre.obs.groupby([ct_key]).mean()[pseudotime_key].idxmin() + start_clust = adata_pre.obs.groupby(ct_key)[pseudotime_key].mean().idxmin() min_dpt = adata_pre.obs[adata_pre.obs[ct_key] == start_clust].index which_max_neigh = ( adata_post.obs["neighborhood"] diff --git a/setup.cfg b/setup.cfg index dc521b52..1ba96b16 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,36 +17,36 @@ 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.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 [bdist_wheel] build_number = 1 [options] -packages = +packages = scib scib.metrics -python_requires = >=3.7 -install_requires = +python_requires = >=3.8 +install_requires = numpy - pandas<2 + pandas>=2 seaborn matplotlib numba @@ -65,7 +65,7 @@ install_requires = zip_safe = False [options.package_data] -scib = +scib = resources/*.txt knn_graph/* @@ -76,10 +76,10 @@ dev = build; twine; isort; bump2version; pre-commit docs = sphinx; sphinx_rtd_theme; myst_parser; sphinx-automodapi louvain = python-igraph; louvain>=0.8 bbknn = bbknn ==1.3.9 -scanorama = scanorama ==1.7.0 +scanorama = scanorama >=1.7.4 mnn = mnnpy ==0.1.9.5 scgen = scgen >=2.1.0 -scvi = scvi-tools >=0.16.1 +scvi = scvi-tools >=0.16 trvae = trvae ==1.1.2 trvaep = trvaep ==0.1.0 desc = desc ==2.0.3 @@ -95,7 +95,7 @@ skip_glob = docs/* line-length = 120 target-version = py38 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/conftest.py b/tests/conftest.py index 2aa8f769..7195a252 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -44,8 +44,8 @@ def adata_pbmc_template(): adata_concat = adata_ref.concatenate(adata, batch_categories=["ref", "new"]) adata_concat.obs.louvain = adata_concat.obs.louvain.astype("category") # fix category ordering - adata_concat.obs.louvain.cat.reorder_categories( - adata_ref.obs.louvain.cat.categories, inplace=True + adata_concat.obs["louvain"] = adata_concat.obs["louvain"].cat.set_categories( + adata_ref.obs["louvain"].cat.categories ) adata_concat.obs["celltype"] = adata_concat.obs["louvain"]