Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6bb3786
fix: support raster labels above uint16
stanbot8 Jul 24, 2026
560caf9
Fix instance_key dtype check rejecting object vs str string ids (#1270)
LucaMarconato Oct 8, 2026
4d19f7d
Fix spatialdata-plot-docs link in index.md (#1275)
jan-glx Oct 15, 2026
9ffe082
Add de.NBI survey link to readme (#1268)
LucaMarconato Oct 17, 2026
9907646
Fixes basic typing issues in rasterize.py
Tomaz-Vieira Sep 11, 2026
1d5dcbe
Adds AGENTS.md with guidelines on type narrowing
Tomaz-Vieira Oct 20, 2026
d4403ee
Fix de.NBI survey link in README (#1285)
jan-glx Oct 30, 2026
ce40138
docs: link the SpatialData specifications from the landing page (#1290)
jan-glx Nov 2, 2026
af431ef
docs: mark the design doc as superseded by the SpatialData specificat…
jan-glx Nov 6, 2026
90adc9c
Removes redundant check-ast hook (#1262)
Tomaz-Vieira Nov 9, 2026
6f6fb4c
docs: fix outdated statements in the SpatialData class docstring (#1273)
jan-glx Nov 9, 2026
dc61be9
docs: move to scverse-doc and adopt the shared scverse docs TOC (#1294)
Zethson Nov 9, 2026
f7cb1cc
docs: replace the PNG logo with an SVG version (#1296)
jan-glx Nov 9, 2026
df139eb
[pre-commit.ci] pre-commit autoupdate (#1198)
pre-commit-ci[bot] Nov 9, 2026
f1e74ce
build(deps): bump the actions-deps group across 1 directory with 8 up…
dependabot[bot] Nov 10, 2026
f23aa12
build(deps): bump the pre-commit group with 4 updates (#1245)
dependabot[bot] Nov 10, 2026
786864e
docs: re-enable nitpicky and fix broken cross-references (#1305)
jan-glx Nov 10, 2026
bf43e7c
build(deps): bump the pre-commit group with 2 updates (#1307)
dependabot[bot] Nov 10, 2026
d4427cf
fix (docs/user_guide.md): dropdowns, title, intro text (#1309)
ajkswamy Nov 11, 2026
bd410fa
fix: left join with no matching rows crashed queries on labels (#1266)
FarisHrvat Nov 11, 2026
81a5959
docs: queries return MultiPolygons whole (#1265)
FarisHrvat Nov 11, 2026
602aec0
docs: fix docstrings whose parameters don't match the signature (SIT-…
jan-glx Nov 11, 2026
2e5337c
fix: exclude claude skills from precommit md check (#1313)
ajkswamy Nov 11, 2026
55c05db
ci: add autofix.ci workflow (#1315)
flying-sheep Nov 12, 2026
22c1d09
style: switch to panache markdown formatting (#1314)
flying-sheep Nov 12, 2026
c359bf5
fix: resample multiscale labels with nearest neighbour in transform()…
Sizerta Nov 13, 2026
e9ea9c7
test: xfail rasterize labels above 2**53 (float64 precision)
jan-glx Nov 18, 2026
30b6ea1
test: xfail rasterize labels >= 2**53, incl. summed overlaps
jan-glx Nov 18, 2026
6076f99
Merge branch 'main' into fix/987-raster-label-dtype
jan-glx Nov 18, 2026
329721c
fix: raise for raster labels >= 2**53 instead of silently rounding
jan-glx Nov 18, 2026
2d26203
fix: aggregate images by multiscale labels (#1261)
Sizerta Nov 19, 2026
41a1681
Merge branch 'main' into fix/987-raster-label-dtype
jan-glx Nov 19, 2026
f596419
build(deps): bump docker/login-action from 4.7.0 to 4.8.0 in the acti…
dependabot[bot] Nov 20, 2026
a079cc3
docs: weekly Dependabot bumps of the tutorials submodule, fix 'Edit o…
jan-glx Nov 20, 2026
e9dc672
build(deps): bump docs/tutorials/notebooks from `90c40a7` to `02dc2af…
dependabot[bot] Nov 20, 2026
9a1fbca
build(deps): bump the pre-commit group with 3 updates (#1321)
dependabot[bot] Nov 20, 2026
b8e7bfe
build(deps): bump docs/tutorials/notebooks from `02dc2af` to `4cfe92d…
dependabot[bot] Nov 20, 2026
7aada08
build(deps): bump the pre-commit group with 2 updates (#1328)
dependabot[bot] Nov 20, 2026
7e388fb
docs: rework landing page, installation and quickstart; trim the chan…
jan-glx Nov 23, 2026
036d8eb
docs: restore the card grid on the landing page (#1331)
jan-glx Nov 23, 2026
1033a01
fix(Raster.parse, get_transformations) typing overloads (#1330)
ajkswamy Nov 23, 2026
e949102
ci: run scheduled tests weekly and let scheduled pre-release failures…
jan-glx Nov 23, 2026
2d6ece8
Merge branch 'main' into fix/987-raster-label-dtype
jan-glx Nov 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ updates:
actions-deps:
patterns:
- "*"
# docs/tutorials/notebooks -> scverse/spatialdata-tutorials
- package-ecosystem: gitsubmodule
directory: /
schedule:
interval: weekly
32 changes: 32 additions & 0 deletions .github/workflows/autofix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# The workflow name is mandated by autofix.ci.
# It needs to be a dedicated workflow, as autofix.ci times out on long runs.
name: autofix.ci

on:
pull_request:

env:
FORCE_COLOR: "1"
UV_COMPILE_BYTECODE: "1"

permissions:
contents: read

jobs:
lint:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
filter: blob:none
persist-credentials: false
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: true
- run: uv tool install hatch
- name: Run pre-commit hooks
run: uvx prek run --all-files --show-diff-on-failure --color=always
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4
if: ${{ !cancelled() }}
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: false
- name: Build package
run: uv build
- name: Check package
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.x"

Expand Down Expand Up @@ -83,13 +83,13 @@ jobs:

- name: Login to GitHub Container Registry
if: ${{ env.skip_build == 'false' }}
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
if: ${{ env.skip_build == 'false' }}
env:
IMAGE_TAG: ${{ env.REGISTRY }}/scverse/spatialdata:${{ env.IMAGE_TAG_SUFFIX }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: false
- name: Build package
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
33 changes: 13 additions & 20 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main]
schedule:
- cron: "0 5 1,15 * *"
- cron: "0 5 * * 1" # weekly, Monday 05:00 UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -23,13 +23,15 @@ jobs:
envs: ${{ steps.get-envs.outputs.envs }}
steps:
- &clone
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
fetch-depth: 0
persist-credentials: false
- &setup-uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
prune-cache: true
- name: Get test environments
id: get-envs
run: |
Expand All @@ -47,8 +49,8 @@ jobs:
test:
needs: get-environments
permissions:
id-token: write # for codecov OIDC
contents: read
id-token: write # for codecov OIDC
contents: read

strategy:
fail-fast: false
Expand All @@ -58,7 +60,8 @@ jobs:

name: ${{ matrix.env.label }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
# Pre-release failures must not block PRs, but scheduled runs should go red (and notify) so upstream breakage is noticed early.
continue-on-error: ${{ contains(matrix.env.name, 'pre') && github.event_name != 'schedule' }}
env:
UV_PYTHON: ${{ matrix.env.python }}

Expand All @@ -82,30 +85,20 @@ jobs:
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
- name: Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
fail_ci_if_error: true
use_oidc: true

lint:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- *clone
- *setup-uv
- run: uv tool install hatch
- run: uvx prek run --all-files --show-diff-on-failure --color=always

# One required check for branch protection, so it does not need updating whenever the matrix changes.
check:
name: Tests pass in all hatch environments
if: always()
needs:
- get-environments
- test
- lint
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
- uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
with:
jobs: ${{ toJSON(needs) }}
15 changes: 15 additions & 0 deletions .panache.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#:schema https://panache.bz/panache.schema.json
flavor = "myst"
extend-exclude = [".claude/"]

[format]
wrap = "preserve"
smart-punctuation = "unicode"
tab-stops = "preserve"

# MyST syntax extensions from `scverse_doc.config.MYST_ENABLE_EXTENSIONS`
[extensions]
myst-colon-fence = true # colon_fence
definition-lists = true # deflist
tex-math-dollars = true # dollarmath, amsmath
raw-html = true # html_image, html_admonition
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v2.5.10
rev: v2.6.7
hooks:
- id: biome-format
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
groups: [format]
# further file exclusions and other options are configured in biome.jsonc
- repo: https://github.com/jolars/panache-pre-commit
rev: v3.18.0
hooks:
- id: panache-format
groups: [format]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.28.1
rev: v2.30.6
hooks:
- id: pyproject-fmt
groups: [format]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.4
rev: v0.17.5
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -39,7 +45,6 @@ repos:
rev: v6.0.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
groups: [format]
- id: mixed-line-ending
Expand All @@ -53,7 +58,7 @@ repos:
args: [--assume-in-merge]

- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.29.0
rev: v1.32.0
hooks:
- id: zizmor
args: [--no-progress, --fix]
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build:
os: ubuntu-24.04
tools:
python: "3.14"
nodejs: latest
jobs:
post_checkout:
# unshallow so the version can be derived from the git tag
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"editorconfig.editorconfig",
"charliermarsh.ruff",
"biomejs.biome",
"jolars.panache",
],
}
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"[python][json][jsonc]": {
"[python][json][jsonc][yaml][markdown]": {
"editor.formatOnSave": true,
},
"[python]": {
Expand All @@ -9,9 +9,12 @@
"source.organizeImports": "always",
},
},
"[json][jsonc]": {
"[json][jsonc][yaml]": {
"editor.defaultFormatter": "biomejs.biome",
},
"[markdown]": {
"editor.defaultFormatter": "jolars.panache",
},
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["-vv", "--color=yes"],
Expand Down
67 changes: 67 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# AGENTS.md

## Typing guidelines

- Avoid `typing.cast` and `# type: ignore`, especially as workarounds for narrowing problems; use the style above
instead. If one is truly unavoidable, keep it as narrow as possible and add a comment explaining why
(e.g. `# FIXME: ...`).
- Avoid creating functions that return unions (except if it's something like `T | None`). If a function has different
paths to return different types, it should probably be two functions or at least an overload.

### Union narrowing style

Narrow unions by asserting what a value is **not**, then use `typing.assert_type` to state (and have the type checker
verify) what it is:

```python
from typing import assert_type

transformation: BaseTransformation | dict = ...

# Don't
assert isinstance(transformation, BaseTransformation)

# Do
assert not isinstance(transformation, dict)
assert_type(transformation, BaseTransformation)
```

When all branches of a union have been handled, use `typing.assert_never` instead of a generic “should not reach here”
error, so the type checker tells us if a new type is added to the union and not handled:

```python
from typing import assert_never

if isinstance(data, DataArray):
...
elif isinstance(data, DataTree):
...
else:
assert_never(data) # instead of: raise RuntimeError("Should not reach here")
```

#### Why

Because of Python’s (multiple-)inheritance model, a positive `isinstance` assertion can never be rejected by a type
checker, even when it contradicts the declared type:

```python
a: int = 123
assert isinstance(a, list) # accepted; the checker infers `a: <subclass of int and list>`
```

So a positive assertion can silently force a value to a type it should never have.

#### Examples

```python
transformations: BaseTransformation | dict[str, BaseTransformation] = get_transformation(element, get_all=True)
assert not isinstance(transformations, BaseTransformation)
assert_type(transformations, dict[str, BaseTransformation])
```

Optional values are already narrowed “negatively”, so keep using `is not None`:

```python
assert target_depth is not None
```
Loading