diff --git a/.github/workflows/test.yaml.rej b/.github/workflows/test.yaml.rej index e165fb8..90337b2 100644 --- a/.github/workflows/test.yaml.rej +++ b/.github/workflows/test.yaml.rej @@ -13,4 +13,4 @@ diff a/.github/workflows/test.yaml b/.github/workflows/test.yaml (rejected hunks + python: "3.12" pip-flags: "--pre" name: PRE-RELEASE DEPENDENCIES - + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06fb549..930c6fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,80 +1,80 @@ fail_fast: false default_language_version: - python: python3 - node: 16.14.2 + python: python3 + node: 16.14.2 default_stages: - - commit - - push + - commit + - push minimum_pre_commit_version: 2.16.0 repos: - - repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - - repo: https://github.com/asottile/blacken-docs - rev: 1.18.0 - hooks: - - id: blacken-docs - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort - - repo: https://github.com/asottile/yesqa - rev: v1.5.0 - hooks: - - id: yesqa - additional_dependencies: - - flake8-tidy-imports - - flake8-docstrings - - flake8-rst-docstrings - - flake8-comprehensions - - flake8-bugbear - - flake8-blind-except - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: detect-private-key - - id: check-ast - - id: end-of-file-fixer - - id: mixed-line-ending - args: [--fix=lf] - - id: trailing-whitespace - - id: check-case-conflict - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 - hooks: - - id: autoflake - args: - - --in-place - - --remove-all-unused-imports - - --remove-unused-variable - - --ignore-init-module-imports - - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 - hooks: - - id: flake8 - additional_dependencies: - - flake8-tidy-imports - - flake8-docstrings - - flake8-rst-docstrings - - flake8-comprehensions - - flake8-bugbear - - flake8-blind-except - - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 - hooks: - - id: pyupgrade - args: [--py3-plus, --py38-plus, --keep-runtime-typing] - - repo: local - hooks: - - id: forbid-to-commit - name: Don't commit rej files - entry: | - Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates. - Fix the merge conflicts manually and remove the .rej files. - language: fail - files: '.*\.rej$' + - repo: https://github.com/psf/black + rev: 24.8.0 + hooks: + - id: black + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + - repo: https://github.com/asottile/blacken-docs + rev: 1.18.0 + hooks: + - id: blacken-docs + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + - repo: https://github.com/asottile/yesqa + rev: v1.5.0 + hooks: + - id: yesqa + additional_dependencies: + - flake8-tidy-imports + - flake8-docstrings + - flake8-rst-docstrings + - flake8-comprehensions + - flake8-bugbear + - flake8-blind-except + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: detect-private-key + - id: check-ast + - id: end-of-file-fixer + - id: mixed-line-ending + args: [--fix=lf] + - id: trailing-whitespace + - id: check-case-conflict + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 + hooks: + - id: autoflake + args: + - --in-place + - --remove-all-unused-imports + - --remove-unused-variable + - --ignore-init-module-imports + - repo: https://github.com/PyCQA/flake8 + rev: 7.1.1 + hooks: + - id: flake8 + additional_dependencies: + - flake8-tidy-imports + - flake8-docstrings + - flake8-rst-docstrings + - flake8-comprehensions + - flake8-bugbear + - flake8-blind-except + - repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + args: [--py3-plus, --py38-plus, --keep-runtime-typing] + - repo: local + hooks: + - id: forbid-to-commit + name: Don't commit rej files + entry: | + Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates. + Fix the merge conflicts manually and remove the .rej files. + language: fail + files: '.*\.rej$' diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1bf3915..23a5340 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,16 +1,16 @@ # https://docs.readthedocs.io/en/stable/config-file/v2.html version: 2 build: - os: ubuntu-20.04 - tools: - python: "3.10" + os: ubuntu-20.04 + tools: + python: "3.10" sphinx: - configuration: docs/conf.py - # disable this for more lenient docs builds - fail_on_warning: false + configuration: docs/conf.py + # disable this for more lenient docs builds + fail_on_warning: false python: - install: - - method: pip - path: . - extra_requirements: - - doc + install: + - method: pip + path: . + extra_requirements: + - doc diff --git a/README.md.rej b/README.md.rej index c0d7307..12b1777 100644 --- a/README.md.rej +++ b/README.md.rej @@ -1,10 +1,10 @@ diff a/README.md b/README.md (rejected hunks) @@ -17,7 +17,7 @@ Please refer to the [documentation][link-docs]. In particular, the - + ## Installation - + -You need to have Python 3.9 or newer installed on your system. If you don't have +You need to have Python 3.10 or newer installed on your system. If you don't have Python installed, we recommend installing [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge). - + There are several alternative options to install cellcharter: diff --git a/docs/conf.py.rej b/docs/conf.py.rej index 48c15c7..218b8d5 100644 --- a/docs/conf.py.rej +++ b/docs/conf.py.rej @@ -1,6 +1,6 @@ diff a/docs/conf.py b/docs/conf.py (rejected hunks) @@ -36,10 +36,10 @@ needs_sphinx = "4.0" - + html_context = { "display_github": True, # Integrate GitHub - "github_user": "marcovarrone", # Username @@ -12,5 +12,5 @@ diff a/docs/conf.py b/docs/conf.py (rejected hunks) + "github_version": "main", + "conf_py_path": "/docs/", } - + # -- General configuration --------------------------------------------------- diff --git a/docs/index.md.rej b/docs/index.md.rej index 14a8d31..922185b 100644 --- a/docs/index.md.rej +++ b/docs/index.md.rej @@ -1,9 +1,9 @@ diff a/docs/index.md b/docs/index.md (rejected hunks) @@ -8,7 +8,6 @@ - + api.md changelog.md -template_usage.md contributing.md references.md - + diff --git a/src/cellcharter/gr/_utils.py b/src/cellcharter/gr/_utils.py index 2301a94..9ff8ec9 100644 --- a/src/cellcharter/gr/_utils.py +++ b/src/cellcharter/gr/_utils.py @@ -1,4 +1,5 @@ """Graph utilities.""" + from __future__ import annotations from anndata import AnnData diff --git a/src/cellcharter/tl/_autok.py b/src/cellcharter/tl/_autok.py index 91a4628..2d42746 100644 --- a/src/cellcharter/tl/_autok.py +++ b/src/cellcharter/tl/_autok.py @@ -101,9 +101,7 @@ def fit(self, adata: ad.AnnData, use_rep: str = None): X = ( adata.obsm[use_rep] if use_rep is not None - else adata.obsm["X_cellcharter"] - if "X_cellcharter" in adata.obsm - else adata.X + else adata.obsm["X_cellcharter"] if "X_cellcharter" in adata.obsm else adata.X ) set_logging_level(logging.WARNING) @@ -194,9 +192,7 @@ def predict(self, adata: ad.AnnData, use_rep: str = None, k: int = None) -> pd.C X = ( adata.obsm[use_rep] if use_rep is not None - else adata.obsm["X_cellcharter"] - if "X_cellcharter" in adata.obsm - else adata.X + else adata.obsm["X_cellcharter"] if "X_cellcharter" in adata.obsm else adata.X ) return pd.Categorical(self.best_models[k].predict(X), categories=np.arange(k))