Skip to content

Commit

Permalink
update (#756)
Browse files Browse the repository at this point in the history
* update

* update

* update
  • Loading branch information
giovp committed Oct 5, 2023
1 parent 8cd2355 commit 6e9f0a9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Expand Up @@ -7,18 +7,18 @@ default_stages:
minimum_pre_commit_version: 2.9.3
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
rev: v1.5.1
hooks:
- id: mypy
additional_dependencies: [numpy, pandas, types-requests]
exclude: .scripts/ci/download_data.py|squidpy/datasets/_(dataset|image).py # See https://github.com/pre-commit/mirrors-mypy/issues/33
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black
additional_dependencies: [toml]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
rev: v3.0.3
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -51,12 +51,12 @@ repos:
name: Check executable files use .sh extension
types: [shell, executable]
- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.282
rev: v0.0.292
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -59,7 +59,7 @@ dependencies = [
"numba>=0.56.4",
"numpy>=1.23.0",
"omnipath>=1.0.7",
"pandas>=1.5.0",
"pandas>=2.1.0",
"Pillow>=8.0.0",
"scanpy>=1.9.3",
"scikit-image>=0.19,<=0.20",
Expand Down
9 changes: 7 additions & 2 deletions src/squidpy/gr/_ligrec.py
Expand Up @@ -508,8 +508,13 @@ def find_min_gene_in_complex(_complex: str | None) -> str | None:
return complexes[0]

df = self._data[complexes].mean()

return str(df.index[df.argmin()])
try:
return str(df.index[df.argmin()])
except ValueError as e:
if "attempt to get argmin of an empty sequence" in str(e):
return str(df.index[0])
else:
logg.error(e)

if TYPE_CHECKING:
assert isinstance(self._interactions, pd.DataFrame)
Expand Down
2 changes: 1 addition & 1 deletion src/squidpy/gr/_ppatterns.py
Expand Up @@ -418,7 +418,7 @@ def co_occurrence(
labs_splits = tuple(s for s in np.array_split(labs, n_splits, axis=0) if len(s)) # type: ignore[arg-type]
# create idx array including unique combinations and self-comparison
x, y = np.triu_indices_from(np.empty((n_splits, n_splits))) # type: ignore[arg-type]
idx_splits = [(i, j) for i, j in zip(x, y)]
idx_splits = list(zip(x, y))

n_jobs = _get_n_cores(n_jobs)
start = logg.info(
Expand Down
2 changes: 1 addition & 1 deletion src/squidpy/im/_container.py
Expand Up @@ -883,7 +883,7 @@ def uncrop(

scales.discard(None)
if len(scales) != 1:
raise ValueError(f"Unable to uncrop images of different scales `{sorted((scales))}`.")
raise ValueError(f"Unable to uncrop images of different scales `{sorted(scales)}`.")
scale, *_ = scales

if shape is None:
Expand Down
Binary file modified tests/_data/ligrec_no_numba.pickle
Binary file not shown.
Binary file modified tests/_data/paul15_means.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/plotting/test_graph.py
Expand Up @@ -117,7 +117,7 @@ def test_plot_cbar_kwargs(self, adata: AnnData):
gr.spatial_neighbors(adata)
gr.nhood_enrichment(adata, cluster_key=C_KEY)

pl.nhood_enrichment(adata, cluster_key=C_KEY, cbar_kwargs={"label": "FOOBARBAZQUUX", "filled": False})
pl.nhood_enrichment(adata, cluster_key=C_KEY, cbar_kwargs={"label": "FOOBARBAZQUUX"})


class TestLigrec(PlotTester, metaclass=PlotTesterMeta):
Expand Down

0 comments on commit 6e9f0a9

Please sign in to comment.