Skip to content

Commit

Permalink
fix(async): set default concurrency to 10 tasks (#2256)
Browse files Browse the repository at this point in the history
* fix(async): set default concurrency to 10 tasks

* fixup
  • Loading branch information
jhamman authored Sep 26, 2024
1 parent 0e4cc7e commit 4515671
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/zarr/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions tests/v3/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -62,15 +62,15 @@ 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


@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
Expand Down

0 comments on commit 4515671

Please sign in to comment.