Skip to content

Commit a2c2b48

Browse files
committed
wip
1 parent 2c42a46 commit a2c2b48

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report xml --
262262
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
263263
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"
264264

265+
[tool.hatch.envs.time_travel]
266+
description = "Test environment for tests against older zarr-python versions"
267+
dependencies = [
268+
"hatch ==1.14.1"
269+
]
270+
features=["test"]
271+
265272
[tool.ruff]
266273
line-length = 100
267274
force-exclude = true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from pathlib import Path
2+
3+
import numpy as np
4+
import pytest
5+
from numcodecs import GZip
6+
7+
from zarr.core.group import GroupMetadata, create_hierarchy
8+
from zarr.core.metadata.v2 import ArrayV2Metadata
9+
from zarr.storage import LocalStore
10+
11+
12+
@pytest.fixture
13+
def hierarchy_model(request: pytest.FixtureRequest) -> dict[str, ArrayV2Metadata | GroupMetadata]:
14+
dtype = np.uint8()
15+
return {
16+
"": GroupMetadata(attributes={"foo": "bar"}, zarr_format=2),
17+
"/array": ArrayV2Metadata(
18+
shape=(10, 10),
19+
dtype=dtype,
20+
chunks=(10, 10),
21+
compressor=GZip(),
22+
fill_value=1,
23+
order="C",
24+
filters=[GZip()],
25+
),
26+
}
27+
28+
29+
async def test_copy(
30+
tmp_path: Path, hierarchy_model: dict[str, ArrayV2Metadata | GroupMetadata]
31+
) -> None:
32+
# create the hierarchy
33+
store = LocalStore(tmp_path)
34+
[x async for x in create_hierarchy(store=store, nodes=hierarchy_model)]
35+
breakpoint()
File renamed without changes.

0 commit comments

Comments
 (0)