|
1 | 1 | import pickle
|
| 2 | +from typing import Any |
2 | 3 |
|
3 | 4 | import numpy as np
|
| 5 | +import numpy.typing as npt |
4 | 6 | import pytest
|
5 | 7 |
|
6 | 8 | from zarr import Array, AsyncArray
|
|
32 | 34 | )
|
33 | 35 | @pytest.mark.parametrize("offset", [0, 10])
|
34 | 36 | def test_sharding(
|
35 |
| - store: Store, array_fixture: np.ndarray, index_location: ShardingCodecIndexLocation, offset: int |
| 37 | + store: Store, |
| 38 | + array_fixture: npt.NDArray[Any], |
| 39 | + index_location: ShardingCodecIndexLocation, |
| 40 | + offset: int, |
36 | 41 | ) -> None:
|
37 | 42 | """
|
38 | 43 | Test that we can create an array with a sharding codec, write data to that array, and get
|
@@ -80,7 +85,7 @@ def test_sharding(
|
80 | 85 | indirect=["array_fixture"],
|
81 | 86 | )
|
82 | 87 | def test_sharding_partial(
|
83 |
| - store: Store, array_fixture: np.ndarray, index_location: ShardingCodecIndexLocation |
| 88 | + store: Store, array_fixture: npt.NDArray[Any], index_location: ShardingCodecIndexLocation |
84 | 89 | ) -> None:
|
85 | 90 | data = array_fixture
|
86 | 91 | spath = StorePath(store)
|
@@ -123,7 +128,7 @@ def test_sharding_partial(
|
123 | 128 | @pytest.mark.parametrize("index_location", ["start", "end"])
|
124 | 129 | @pytest.mark.parametrize("store", ("local", "memory"), indirect=["store"])
|
125 | 130 | def test_sharding_partial_read(
|
126 |
| - store: Store, array_fixture: np.ndarray, index_location: ShardingCodecIndexLocation |
| 131 | + store: Store, array_fixture: npt.NDArray[Any], index_location: ShardingCodecIndexLocation |
127 | 132 | ) -> None:
|
128 | 133 | data = array_fixture
|
129 | 134 | spath = StorePath(store)
|
@@ -160,7 +165,7 @@ def test_sharding_partial_read(
|
160 | 165 | @pytest.mark.parametrize("index_location", ["start", "end"])
|
161 | 166 | @pytest.mark.parametrize("store", ("local", "memory"), indirect=["store"])
|
162 | 167 | def test_sharding_partial_overwrite(
|
163 |
| - store: Store, array_fixture: np.ndarray, index_location: ShardingCodecIndexLocation |
| 168 | + store: Store, array_fixture: npt.NDArray[Any], index_location: ShardingCodecIndexLocation |
164 | 169 | ) -> None:
|
165 | 170 | data = array_fixture[:10, :10, :10]
|
166 | 171 | spath = StorePath(store)
|
@@ -212,7 +217,7 @@ def test_sharding_partial_overwrite(
|
212 | 217 | @pytest.mark.parametrize("store", ("local", "memory"), indirect=["store"])
|
213 | 218 | def test_nested_sharding(
|
214 | 219 | store: Store,
|
215 |
| - array_fixture: np.ndarray, |
| 220 | + array_fixture: npt.NDArray[Any], |
216 | 221 | outer_index_location: ShardingCodecIndexLocation,
|
217 | 222 | inner_index_location: ShardingCodecIndexLocation,
|
218 | 223 | ) -> None:
|
|
0 commit comments