From 86b72b0ce257bae8005743f16fb5ddd11c0c8a0f Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Wed, 25 Sep 2024 16:03:04 -0600 Subject: [PATCH 1/2] fix(async): set default concurrency to 10 tasks --- src/zarr/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zarr/core/config.py b/src/zarr/core/config.py index 45e4114389..735755616f 100644 --- a/src/zarr/core/config.py +++ b/src/zarr/core/config.py @@ -43,7 +43,7 @@ def reset(self) -> None: { "default_zarr_version": 3, "array": {"order": "C"}, - "async": {"concurrency": None, "timeout": None}, + "async": {"concurrency": 10, "timeout": None}, "json_indent": 2, "codec_pipeline": { "path": "zarr.codecs.pipeline.BatchedCodecPipeline", From 818fc73ef8ba7068ec1ee7e81f4904addfff6259 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Wed, 25 Sep 2024 16:09:58 -0600 Subject: [PATCH 2/2] fixup --- tests/v3/test_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/v3/test_config.py b/tests/v3/test_config.py index 115487ba87..c5ba6280a2 100644 --- a/tests/v3/test_config.py +++ b/tests/v3/test_config.py @@ -41,7 +41,7 @@ def test_config_defaults_set() -> None: { "default_zarr_version": 3, "array": {"order": "C"}, - "async": {"concurrency": None, "timeout": None}, + "async": {"concurrency": 10, "timeout": None}, "json_indent": 2, "codec_pipeline": { "path": "zarr.codecs.pipeline.BatchedCodecPipeline", @@ -62,7 +62,7 @@ def test_config_defaults_set() -> None: } ] assert config.get("array.order") == "C" - assert config.get("async.concurrency") is None + assert config.get("async.concurrency") == 10 assert config.get("async.timeout") is None assert config.get("codec_pipeline.batch_size") == 1 assert config.get("json_indent") == 2 @@ -70,7 +70,7 @@ def test_config_defaults_set() -> None: @pytest.mark.parametrize( "key, old_val, new_val", - [("array.order", "C", "F"), ("async.concurrency", None, 10), ("json_indent", 2, 0)], + [("array.order", "C", "F"), ("async.concurrency", 10, 20), ("json_indent", 2, 0)], ) def test_config_defaults_can_be_overridden(key: str, old_val: Any, new_val: Any) -> None: assert config.get(key) == old_val