Skip to content

Commit

Permalink
Merge branch 'main' into bkmartinjr/fastercsx
Browse files Browse the repository at this point in the history
  • Loading branch information
bkmartinjr committed Nov 15, 2024
2 parents bc866f8 + ddc72c1 commit 6242085
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
exclude: ^doc/source/
repos:
- repo: https://github.com/psf/black
rev: "24.4.2"
rev: "24.10.0"
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.7.4
hooks:
- id: ruff
args: ["--config=apis/python/pyproject.toml"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
1 change: 1 addition & 0 deletions apis/python/notebooks/tutorial_exp_query.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"source": [
"import tarfile\n",
"import tempfile\n",
"\n",
"sparse_uri = tempfile.mktemp()\n",
"with tarfile.open(\"data/pbmc3k-sparse.tgz\") as handle:\n",
" handle.extractall(sparse_uri)\n",
Expand Down
1 change: 1 addition & 0 deletions apis/python/notebooks/tutorial_soma_append_mode.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
],
"source": [
"import scanpy as sc\n",
"\n",
"import tiledbsoma\n",
"import tiledbsoma.io\n",
"import tiledbsoma.logging\n",
Expand Down
2 changes: 2 additions & 0 deletions apis/python/notebooks/tutorial_soma_objects.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"source": [
"import tarfile\n",
"import tempfile\n",
"\n",
"dense_uri = tempfile.mktemp()\n",
"with tarfile.open(\"data/pbmc3k-dense.tgz\") as handle:\n",
" handle.extractall(dense_uri)\n",
Expand Down Expand Up @@ -1459,6 +1460,7 @@
"source": [
"import tarfile\n",
"import tempfile\n",
"\n",
"sparse_uri = tempfile.mktemp()\n",
"with tarfile.open(\"data/pbmc3k-sparse.tgz\") as handle:\n",
" handle.extractall(sparse_uri)\n",
Expand Down
1 change: 1 addition & 0 deletions apis/python/notebooks/tutorial_soma_reading.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"source": [
"import tarfile\n",
"import tempfile\n",
"\n",
"sparse_uri = tempfile.mktemp()\n",
"with tarfile.open(\"data/pbmc3k-sparse.tgz\") as handle:\n",
" handle.extractall(sparse_uri)\n",
Expand Down
3 changes: 2 additions & 1 deletion apis/python/notebooks/tutorial_soma_shape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,11 @@
"metadata": {},
"outputs": [],
"source": [
"import tiledbsoma.io\n",
"import tarfile\n",
"import tempfile\n",
"\n",
"import tiledbsoma.io\n",
"\n",
"uri = tempfile.mktemp()\n",
"with tarfile.open(\"data/pbmc3k-sparse-pre-1.15.tgz\") as handle:\n",
" handle.extractall(uri)\n",
Expand Down
20 changes: 9 additions & 11 deletions apis/python/notebooks/tutorial_spatial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,25 @@
"metadata": {},
"outputs": [],
"source": [
"import shlex\n",
"from functools import partial\n",
"import numpy as np\n",
"from os import makedirs, remove\n",
"from os.path import basename, exists, join\n",
"import shlex\n",
"from os.path import exists, join\n",
"from shutil import rmtree\n",
"from subprocess import check_call\n",
"from sys import stderr\n",
"from urllib.parse import urlparse\n",
"err = partial(print, file=stderr)\n",
"\n",
"import matplotlib.patches as mplp\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import scanpy as sc\n",
"from matplotlib.collections import PatchCollection\n",
"\n",
"from tiledbsoma.experimental import from_visium\n",
"from tiledbsoma import Experiment\n",
"import tiledbsoma\n",
"from tiledbsoma import Experiment\n",
"from tiledbsoma.experimental import from_visium\n",
"\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.patches as mplp\n",
"from matplotlib.collections import PatchCollection"
"err = partial(print, file=stderr)\n"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion apis/python/src/tiledbsoma/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def slice_to_numeric_range(
start = domain_start if slc.start is None else max(slc.start, domain_start)
stop = domain_stop if slc.stop is None else min(slc.stop, domain_stop)

if stop < start:
# Lint says the left-hand and right-hand sides are both unions
if stop < start: # type: ignore[operator]
# With the above, we have guaranteed that at least one bound will
# include the domain. If we get here, that means that the other bound
# never included it (e.g. stop == slc.stop < domain_start == start).
Expand Down

0 comments on commit 6242085

Please sign in to comment.