Skip to content

Commit e2573f7

Browse files
[pre-commit.ci] pre-commit autoupdate (#884)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/rbubley/mirrors-prettier: v3.5.1 → v3.5.3](rbubley/mirrors-prettier@v3.5.1...v3.5.3) - [github.com/astral-sh/ruff-pre-commit: v0.9.6 → v0.11.5](astral-sh/ruff-pre-commit@v0.9.6...v0.11.5) * fix precommit * add lower bound xarray-dataclasses * fix typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Luca Marconato <m.lucalmer@gmail.com>
1 parent 88664ab commit e2573f7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99
skip: []
1010
repos:
1111
- repo: https://github.com/rbubley/mirrors-prettier
12-
rev: v3.5.1
12+
rev: v3.5.3
1313
hooks:
1414
- id: prettier
1515
- repo: https://github.com/pre-commit/mirrors-mypy
@@ -19,7 +19,7 @@ repos:
1919
additional_dependencies: [numpy, types-requests]
2020
exclude: tests/|docs/
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.9.6
22+
rev: v0.11.5
2323
hooks:
2424
- id: ruff
2525
args: [--fix, --exit-non-zero-on-fix]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dependencies = [
4646
"xarray>=2024.10.0",
4747
"xarray-schema",
4848
"xarray-spatial>=0.3.5",
49+
"xarray-dataclasses>=1.8.0",
4950
"zarr<3",
5051
]
5152

src/spatialdata/_core/query/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _process_data_tree_query_result(query_result: DataTree) -> DataTree | None:
142142

143143
# rechunk the data to avoid irregular chunks
144144
coords = list(result["scale0"].coords.keys())
145-
result = result.chunk({c: "auto" for c in coords})
145+
result = result.chunk(dict.fromkeys(coords, "auto"))
146146

147147
from dask.array.core import _check_regular_chunks
148148

@@ -156,7 +156,7 @@ def _process_data_tree_query_result(query_result: DataTree) -> DataTree | None:
156156
# reported here: https://github.com/scverse/spatialdata/issues/821#issuecomment-2632201695
157157
# seemingly due to this bug: https://github.com/dask/dask/issues/11713
158158
CHUNK_SIZE = 1024
159-
rechunk_strategy = {c: CHUNK_SIZE for c in coords}
159+
rechunk_strategy = dict.fromkeys(coords, CHUNK_SIZE)
160160
if "c" in coords:
161161
rechunk_strategy["c"] = result["scale0"]["image"].chunks[0][0]
162162
result = result.chunk(rechunk_strategy)

tests/models/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def test_model_invalid_names(self, full_sdata, element_type: str, name: str):
446446
def test_model_not_unique_names(self, full_sdata, element_type: str, names: list[str]):
447447
element = next(iter(getattr(full_sdata, element_type).values()))
448448
with pytest.raises(ValidationError, match="Key `.*` is not unique"):
449-
SpatialData(**{element_type: {name: element for name in names}})
449+
SpatialData(**{element_type: dict.fromkeys(names, element)})
450450

451451
@pytest.mark.parametrize("model", [TableModel])
452452
@pytest.mark.parametrize("region", [["sample_1"] * 5 + ["sample_2"] * 5])

0 commit comments

Comments
 (0)