Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 12, 2024
1 parent 2cd82a1 commit b7d801b
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml.rej
Original file line number Diff line number Diff line change
Expand Up @@ -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

150 changes: 75 additions & 75 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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$'
22 changes: 11 additions & 11 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions README.md.rej
Original file line number Diff line number Diff line change
@@ -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:
4 changes: 2 additions & 2 deletions docs/conf.py.rej
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,5 +12,5 @@ diff a/docs/conf.py b/docs/conf.py (rejected hunks)
+ "github_version": "main",
+ "conf_py_path": "/docs/",
}

# -- General configuration ---------------------------------------------------
4 changes: 2 additions & 2 deletions docs/index.md.rej
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions src/cellcharter/gr/_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Graph utilities."""

from __future__ import annotations

from anndata import AnnData
Expand Down
8 changes: 2 additions & 6 deletions src/cellcharter/tl/_autok.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit b7d801b

Please sign in to comment.