Skip to content

Commit 7b8b0f9

Browse files
authored
Merge branch 'main' into fix/zeros-like-takes-kwargs
2 parents 26ad110 + 5ff3fbe commit 7b8b0f9

32 files changed

+307
-172
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ repos:
3737
- obstore>=0.5.1
3838
# Tests
3939
- pytest
40+
- hypothesis
4041
- repo: https://github.com/scientific-python/cookie
4142
rev: 2025.01.22
4243
hooks:

changes/2950.bufgix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Specifying the memory order of Zarr format 2 arrays using the ``order`` keyword argument has been fixed.

changes/2962.fix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Internally use `typesize` constructor parameter for :class:`numcodecs.blosc.Blosc` to improve compression ratios back to the v2-package levels.

changes/2978.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed sharding with GPU buffers.

changes/2998.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix structured `dtype` fill value serialization for consolidated metadata

changes/3027.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplified scalar indexing of size-1 arrays.

changes/3045.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the typing of ``dimension_names`` arguments throughout so that it now accepts iterables that contain `None` alongside `str`.

docs/user-guide/arrays.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ prints additional diagnostics, e.g.::
209209
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
210210
Compressors : (BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0),)
211211
No. bytes : 400000000 (381.5M)
212-
No. bytes stored : 9696520
213-
Storage ratio : 41.3
212+
No. bytes stored : 3558573
213+
Storage ratio : 112.4
214214
Chunks Initialized : 100
215215

216216
.. note::

pyproject.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test = [
8383
remote_tests = [
8484
'zarr[remote]',
8585
"botocore",
86-
"s3fs",
86+
"s3fs>=2023.10.0",
8787
"moto[s3,server]",
8888
"requests",
8989
]
@@ -104,7 +104,7 @@ docs = [
104104
# Optional dependencies to run examples
105105
'numcodecs[msgpack]',
106106
'rich',
107-
's3fs',
107+
's3fs>=2023.10.0',
108108
'astroid<4'
109109
]
110110

@@ -348,27 +348,27 @@ python_version = "3.11"
348348
ignore_missing_imports = true
349349
namespace_packages = false
350350

351-
352351
strict = true
353352
warn_unreachable = true
354-
355353
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
356354

355+
357356
[[tool.mypy.overrides]]
358357
module = [
359-
"zarr.v2.*",
358+
"tests.package_with_entrypoint.*",
359+
"zarr.testing.stateful",
360+
"tests.test_codecs.test_transpose",
361+
"tests.test_config"
360362
]
361-
ignore_errors = true
363+
strict = false
362364

365+
# TODO: Move the next modules up to the strict = false section
366+
# and fix the errors
363367
[[tool.mypy.overrides]]
364368
module = [
365-
"zarr.testing.stateful", # lots of hypothesis decorator errors
366-
"tests.package_with_entrypoint.*",
367369
"tests.test_codecs.test_codecs",
368-
"tests.test_codecs.test_transpose",
369370
"tests.test_metadata.*",
370371
"tests.test_store.*",
371-
"tests.test_config",
372372
"tests.test_group",
373373
"tests.test_indexing",
374374
"tests.test_properties",

src/zarr/api/asynchronous.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
JSON,
1717
AccessModeLiteral,
1818
ChunkCoords,
19+
DimensionNames,
1920
MemoryOrder,
2021
ZarrFormat,
2122
_default_zarr_format,
@@ -865,7 +866,7 @@ async def create(
865866
| None
866867
) = None,
867868
codecs: Iterable[Codec | dict[str, JSON]] | None = None,
868-
dimension_names: Iterable[str] | None = None,
869+
dimension_names: DimensionNames = None,
869870
storage_options: dict[str, Any] | None = None,
870871
config: ArrayConfigLike | None = None,
871872
**kwargs: Any,
@@ -1040,15 +1041,13 @@ async def create(
10401041
)
10411042
warnings.warn(UserWarning(msg), stacklevel=1)
10421043
config_dict["write_empty_chunks"] = write_empty_chunks
1043-
if order is not None:
1044-
if config is not None:
1045-
msg = (
1046-
"Both order and config keyword arguments are set. "
1047-
"This is redundant. When both are set, order will be ignored and "
1048-
"config will be used."
1049-
)
1050-
warnings.warn(UserWarning(msg), stacklevel=1)
1051-
config_dict["order"] = order
1044+
if order is not None and config is not None:
1045+
msg = (
1046+
"Both order and config keyword arguments are set. "
1047+
"This is redundant. When both are set, order will be ignored and "
1048+
"config will be used."
1049+
)
1050+
warnings.warn(UserWarning(msg), stacklevel=1)
10521051

10531052
config_parsed = ArrayConfig.from_dict(config_dict)
10541053

@@ -1062,6 +1061,7 @@ async def create(
10621061
overwrite=overwrite,
10631062
filters=filters,
10641063
dimension_separator=dimension_separator,
1064+
order=order,
10651065
zarr_format=zarr_format,
10661066
chunk_shape=chunk_shape,
10671067
chunk_key_encoding=chunk_key_encoding,

0 commit comments

Comments
 (0)