|
26 | 26 | NDBuffer, |
27 | 27 | default_buffer_prototype, |
28 | 28 | ) |
29 | | -from zarr.core.chunk_grids import RegularChunkGrid, _auto_partition, normalize_chunks |
| 29 | +from zarr.core.chunk_grids import RegularChunkGrid, normalize_chunks |
30 | 30 | from zarr.core.chunk_key_encodings import ( |
31 | 31 | ChunkKeyEncoding, |
32 | 32 | DefaultChunkKeyEncoding, |
@@ -3478,7 +3478,7 @@ async def create_array( |
3478 | 3478 | storage_options: dict[str, Any] | None = None, |
3479 | 3479 | overwrite: bool = False, |
3480 | 3480 | config: ArrayConfig | ArrayConfigParams | None = None, |
3481 | | - data: np.ndarray | None = None, |
| 3481 | + data: npt.ArrayLike | None = None, |
3482 | 3482 | ) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]: |
3483 | 3483 | """Create an array. |
3484 | 3484 |
|
@@ -3580,20 +3580,17 @@ async def create_array( |
3580 | 3580 | config=config_parsed, |
3581 | 3581 | ) |
3582 | 3582 | else: |
3583 | | - shard_shape_parsed, chunk_shape_parsed = _auto_partition( |
3584 | | - shape, dtype, shard_shape, chunk_shape |
3585 | | - ) |
3586 | | - if shard_shape_parsed is not None: |
3587 | | - sharding_codec = ShardingCodec(chunk_shape=chunk_shape_parsed, codecs=sub_codecs) |
| 3583 | + if shard_shape is not None: |
| 3584 | + sharding_codec = ShardingCodec(chunk_shape=chunk_shape, codecs=sub_codecs) |
3588 | 3585 | sharding_codec.validate( |
3589 | | - shape=chunk_shape_parsed, |
| 3586 | + shape=chunk_shape, |
3590 | 3587 | dtype=dtype, |
3591 | | - chunk_grid=RegularChunkGrid(chunk_shape=shard_shape_parsed), |
| 3588 | + chunk_grid=RegularChunkGrid(chunk_shape=shard_shape), |
3592 | 3589 | ) |
3593 | 3590 | codecs = (sharding_codec,) |
3594 | | - chunks_out = shard_shape_parsed |
| 3591 | + chunks_out = shard_shape |
3595 | 3592 | else: |
3596 | | - chunks_out = chunk_shape_parsed |
| 3593 | + chunks_out = chunk_shape |
3597 | 3594 | codecs = sub_codecs |
3598 | 3595 |
|
3599 | 3596 | result = await AsyncArray._create_v3( |
|
0 commit comments