|
47 | 47 | if TYPE_CHECKING: |
48 | 48 | from collections.abc import Iterable |
49 | 49 |
|
| 50 | + import numcodecs.abc |
| 51 | + |
50 | 52 | from zarr.abc.codec import Codec |
51 | 53 | from zarr.core.buffer import NDArrayLikeOrScalar |
52 | 54 | from zarr.core.chunk_key_encodings import ChunkKeyEncoding |
@@ -870,7 +872,7 @@ async def create( |
870 | 872 | overwrite: bool = False, |
871 | 873 | path: PathLike | None = None, |
872 | 874 | chunk_store: StoreLike | None = None, |
873 | | - filters: list[dict[str, JSON]] | None = None, # TODO: type has changed |
| 875 | + filters: Iterable[dict[str, JSON] | numcodecs.abc.Codec] | None = None, |
874 | 876 | cache_metadata: bool | None = None, |
875 | 877 | cache_attrs: bool | None = None, |
876 | 878 | read_only: bool | None = None, |
@@ -1008,11 +1010,6 @@ async def create( |
1008 | 1010 | _handle_zarr_version_or_format(zarr_version=zarr_version, zarr_format=zarr_format) |
1009 | 1011 | or _default_zarr_format() |
1010 | 1012 | ) |
1011 | | - zdtype = parse_data_type(dtype, zarr_format=zarr_format) |
1012 | | - if zarr_format == 2: |
1013 | | - default_filters, default_compressor = _get_default_chunk_encoding_v2(zdtype) |
1014 | | - if not filters: |
1015 | | - filters = default_filters # type: ignore[assignment] |
1016 | 1013 |
|
1017 | 1014 | if synchronizer is not None: |
1018 | 1015 | warnings.warn("synchronizer is not yet implemented", RuntimeWarning, stacklevel=2) |
@@ -1064,7 +1061,7 @@ async def create( |
1064 | 1061 | store_path, |
1065 | 1062 | shape=shape, |
1066 | 1063 | chunks=chunks, |
1067 | | - dtype=zdtype, |
| 1064 | + dtype=dtype, |
1068 | 1065 | compressor=compressor, |
1069 | 1066 | fill_value=fill_value, |
1070 | 1067 | overwrite=overwrite, |
|
0 commit comments