File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed
Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 6161 ZarrFormat ,
6262 _default_zarr_format ,
6363 _warn_order_kwarg ,
64+ ceildiv ,
6465 concurrent_map ,
6566 parse_shapelike ,
6667 product ,
9495 Selection ,
9596 VIndex ,
9697 _iter_grid ,
97- ceildiv ,
9898 check_fields ,
9999 check_no_multi_fields ,
100100 is_pure_fancy_indexing ,
Original file line number Diff line number Diff line change 1818 ChunkCoords ,
1919 ChunkCoordsLike ,
2020 ShapeLike ,
21+ ceildiv ,
2122 parse_named_configuration ,
2223 parse_shapelike ,
2324)
24- from zarr .core .indexing import ceildiv
2525
2626if TYPE_CHECKING :
2727 from collections .abc import Iterator
Original file line number Diff line number Diff line change 22
33import asyncio
44import functools
5+ import math
56import operator
67import warnings
78from collections .abc import Iterable , Mapping , Sequence
@@ -69,6 +70,12 @@ def product(tup: ChunkCoords) -> int:
6970 return functools .reduce (operator .mul , tup , 1 )
7071
7172
73+ def ceildiv (a : float , b : float ) -> int :
74+ if a == 0 :
75+ return 0
76+ return math .ceil (a / b )
77+
78+
7279T = TypeVar ("T" , bound = tuple [Any , ...])
7380V = TypeVar ("V" )
7481
Original file line number Diff line number Diff line change 2626import numpy as np
2727import numpy .typing as npt
2828
29- from zarr .core .common import product
29+ from zarr .core .common import ceildiv , product
30+ from zarr .core .metadata import T_ArrayMetadata
3031
3132if TYPE_CHECKING :
3233 from zarr .core .array import Array , AsyncArray
3334 from zarr .core .buffer import NDArrayLikeOrScalar
3435 from zarr .core .chunk_grids import ChunkGrid
3536 from zarr .core .common import ChunkCoords
36- from zarr . core . metadata import T_ArrayMetadata
37+
3738
3839IntSequence = list [int ] | npt .NDArray [np .intp ]
3940ArrayOfIntOrBool = npt .NDArray [np .intp ] | npt .NDArray [np .bool_ ]
@@ -95,12 +96,6 @@ class Indexer(Protocol):
9596 def __iter__ (self ) -> Iterator [ChunkProjection ]: ...
9697
9798
98- def ceildiv (a : float , b : float ) -> int :
99- if a == 0 :
100- return 0
101- return math .ceil (a / b )
102-
103-
10499_ArrayIndexingOrder : TypeAlias = Literal ["lexicographic" ]
105100
106101
Original file line number Diff line number Diff line change 4141from zarr .core .buffer import NDArrayLike , NDArrayLikeOrScalar , default_buffer_prototype
4242from zarr .core .chunk_grids import _auto_partition
4343from zarr .core .chunk_key_encodings import ChunkKeyEncodingParams
44- from zarr .core .common import JSON , ZarrFormat
44+ from zarr .core .common import JSON , ZarrFormat , ceildiv
4545from zarr .core .dtype import (
4646 DateTime64 ,
4747 Float32 ,
5959from zarr .core .dtype .npy .common import NUMPY_ENDIANNESS_STR , endianness_from_numpy_str
6060from zarr .core .dtype .npy .string import UTF8Base
6161from zarr .core .group import AsyncGroup
62- from zarr .core .indexing import BasicIndexer , ceildiv
62+ from zarr .core .indexing import BasicIndexer
6363from zarr .core .metadata .v2 import ArrayV2Metadata
6464from zarr .core .metadata .v3 import ArrayV3Metadata
6565from zarr .core .sync import sync
You can’t perform that action at this time.
0 commit comments