Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#852)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](astral-sh/ruff-pre-commit@v0.8.6...v0.9.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 13, 2025
1 parent b2b8e40 commit bddb1f3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
Expand Down
2 changes: 1 addition & 1 deletion docs/_ext/typed_returns.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _process_return(lines: Iterable[str]) -> Iterator[str]:
m = re.fullmatch(r"(?P<param>\w+)\s+:\s+(?P<type>[\w.]+)", line)
if m:
# Once this is in scanpydoc, we can use the fancy hover stuff
yield f'**{m["param"]}** : :class:`~{m["type"]}`'
yield f"**{m['param']}** : :class:`~{m['type']}`"
else:
yield line

Expand Down
4 changes: 2 additions & 2 deletions ehrapy/_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def file_format_data(self, file_format: str):
_type_check(file_format, "file_format_data", str)
file_format_options = {"csv", "h5ad"}
if file_format not in file_format_options:
raise ValueError(f"Cannot set file_format_data to {file_format}. " f"Must be one of {file_format_options}")
raise ValueError(f"Cannot set file_format_data to {file_format}. Must be one of {file_format_options}")
self._file_format_data = file_format

@property
Expand Down Expand Up @@ -237,7 +237,7 @@ def cache_compression(self) -> str | None:
@cache_compression.setter
def cache_compression(self, cache_compression: str | None):
if cache_compression not in {"lzf", "gzip", None}:
raise ValueError(f"`cache_compression` ({cache_compression}) " "must be in {'lzf', 'gzip', None}")
raise ValueError(f"`cache_compression` ({cache_compression}) must be in {{'lzf', 'gzip', None}}")
self._cache_compression = cache_compression

@property
Expand Down
2 changes: 1 addition & 1 deletion ehrapy/anndata/_feature_specifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def infer_feature_types(

if verbose:
logger.warning(
f"{'Features' if len(uncertain_features) >1 else 'Feature'} {str(uncertain_features)[1:-1]} {'were' if len(uncertain_features) >1 else 'was'} detected as categorical features stored numerically."
f"{'Features' if len(uncertain_features) > 1 else 'Feature'} {str(uncertain_features)[1:-1]} {'were' if len(uncertain_features) > 1 else 'was'} detected as categorical features stored numerically."
f"Please verify and correct using `ep.ad.replace_feature_types` if necessary."
)

Expand Down
2 changes: 1 addition & 1 deletion ehrapy/core/meta_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def print_version_and_date(*, file=None): # pragma: no cover
if file is None:
file = sys.stdout
print(
f"Running ehrapy {__version__}, " f"on {datetime.now():%Y-%m-%d %H:%M}.",
f"Running ehrapy {__version__}, on {datetime.now():%Y-%m-%d %H:%M}.",
file=file,
)

Expand Down
10 changes: 8 additions & 2 deletions ehrapy/plot/_scanpy_pl_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,10 @@ def tsne(adata, **kwargs) -> Axes | list[Axes] | None: # pragma: no cover
.. image:: /_static/docstring_previews/tsne_1.png
>>> ep.pl.tsne(
... adata, color=["day_icu_intime", "service_unit"], wspace=0.5, title=["Day of ICU admission", "Service unit"]
... adata,
... color=["day_icu_intime", "service_unit"],
... wspace=0.5,
... title=["Day of ICU admission", "Service unit"],
... )
.. image:: /_static/docstring_previews/tsne_2.png
Expand Down Expand Up @@ -1233,7 +1236,10 @@ def umap(adata: AnnData, **kwargs) -> Axes | list[Axes] | None: # pragma: no co
.. image:: /_static/docstring_previews/umap_1.png
>>> ep.pl.umap(
... adata, color=["day_icu_intime", "service_unit"], wspace=0.5, title=["Day of ICU admission", "Service unit"]
... adata,
... color=["day_icu_intime", "service_unit"],
... wspace=0.5,
... title=["Day of ICU admission", "Service unit"],
... )
.. image:: /_static/docstring_previews/umap_2.png
Expand Down
6 changes: 3 additions & 3 deletions tests/preprocessing/test_quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ def test_qc_lab_measurements_multiple_measurements():
def test_mcar_test_method_output_types(mar_adata, method, expected_output_type):
"""Tests if mcar_test returns the correct output type for different methods."""
output = mcar_test(mar_adata, method=method)
assert isinstance(
output, expected_output_type
), f"Output type for method '{method}' should be {expected_output_type}, got {type(output)} instead."
assert isinstance(output, expected_output_type), (
f"Output type for method '{method}' should be {expected_output_type}, got {type(output)} instead."
)


def test_mar_data_identification(mar_adata):
Expand Down

0 comments on commit bddb1f3

Please sign in to comment.