Skip to content

Commit 297a9f3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into tom/fix/info
2 parents 30c4e6a + ee112b9 commit 297a9f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+65
-21
lines changed

pyproject.toml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pypro
153153
run = "run-coverage --no-cov"
154154
run-verbose = "run-coverage --verbose"
155155
run-mypy = "mypy src"
156-
run-hypothesis = "pytest --hypothesis-profile ci tests/v3/test_properties.py tests/v3/test_store/test_stateful*"
156+
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
157157
list-env = "pip list"
158158

159159
[tool.hatch.envs.gputest]
@@ -173,7 +173,7 @@ run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov=tests"
173173
run = "run-coverage --no-cov"
174174
run-verbose = "run-coverage --verbose"
175175
run-mypy = "mypy src"
176-
run-hypothesis = "pytest --hypothesis-profile ci tests/v3/test_properties.py tests/v3/test_store/test_stateful*"
176+
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
177177
list-env = "pip list"
178178

179179
[tool.hatch.envs.docs]
@@ -282,18 +282,17 @@ ignore_errors = true
282282

283283
[[tool.mypy.overrides]]
284284
module = [
285-
"tests.v2.*",
286-
"tests.v3.package_with_entrypoint.*",
287-
"tests.v3.test_codecs.test_codecs",
288-
"tests.v3.test_codecs.test_transpose",
289-
"tests.v3.test_metadata.*",
290-
"tests.v3.test_store.*",
291-
"tests.v3.test_config",
292-
"tests.v3.test_group",
293-
"tests.v3.test_indexing",
294-
"tests.v3.test_properties",
295-
"tests.v3.test_sync",
296-
"tests.v3.test_v2",
285+
"tests.package_with_entrypoint.*",
286+
"tests.test_codecs.test_codecs",
287+
"tests.test_codecs.test_transpose",
288+
"tests.test_metadata.*",
289+
"tests.test_store.*",
290+
"tests.test_config",
291+
"tests.test_group",
292+
"tests.test_indexing",
293+
"tests.test_properties",
294+
"tests.test_sync",
295+
"tests.test_v2",
297296
]
298297
ignore_errors = true
299298

src/zarr/codecs/sharding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_chunk_slice(self, chunk_coords: ChunkCoords) -> tuple[int, int] | None:
129129
if (chunk_start, chunk_len) == (MAX_UINT_64, MAX_UINT_64):
130130
return None
131131
else:
132-
return (int(chunk_start), int(chunk_start) + int(chunk_len))
132+
return (int(chunk_start), int(chunk_len))
133133

134134
def set_chunk_slice(self, chunk_coords: ChunkCoords, chunk_slice: slice | None) -> None:
135135
localized_chunk = self._localize_chunk(chunk_coords)
@@ -203,7 +203,7 @@ def create_empty(
203203
def __getitem__(self, chunk_coords: ChunkCoords) -> Buffer:
204204
chunk_byte_slice = self.index.get_chunk_slice(chunk_coords)
205205
if chunk_byte_slice:
206-
return self.buf[chunk_byte_slice[0] : chunk_byte_slice[1]]
206+
return self.buf[chunk_byte_slice[0] : (chunk_byte_slice[0] + chunk_byte_slice[1])]
207207
raise KeyError
208208

209209
def __len__(self) -> int:

src/zarr/testing/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, cast
3+
from collections.abc import Callable, Coroutine
4+
from typing import TYPE_CHECKING, Any, TypeVar, cast
45

56
import pytest
67

@@ -37,8 +38,16 @@ def has_cupy() -> bool:
3738
return False
3839

3940

41+
T_Callable = TypeVar("T_Callable", bound=Callable[[], Coroutine[Any, Any, None]])
42+
43+
4044
# Decorator for GPU tests
41-
def gpu_test(func: Any) -> Any:
42-
return pytest.mark.gpu(
43-
pytest.mark.skipif(not has_cupy(), reason="CuPy not installed or no GPU available")(func)
45+
def gpu_test(func: T_Callable) -> T_Callable:
46+
return cast(
47+
T_Callable,
48+
pytest.mark.gpu(
49+
pytest.mark.skipif(not has_cupy(), reason="CuPy not installed or no GPU available")(
50+
func
51+
)
52+
),
4453
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)