Skip to content

Commit b163749

Browse files
committed
fix: restore files and fix formatting perfectly
1 parent 2e83994 commit b163749

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎changes/4531.feature.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Expose blosc.use_threads via zarr.config, allowing users to enable Blosc's internal threading for faster decoding of large single chunks.
1+
Expose `blosc.use_threads` via `zarr.config`, allowing users to enable Blosc's internal threading for faster decoding of large single chunks.

‎src/zarr/codecs/blosc.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from zarr.codecs._deprecated_enum import _coerce_enum_input, _DeprecatedStrEnumMeta
1414
from zarr.core.buffer.cpu import as_numpy_array_wrapper
1515
from zarr.core.common import JSON, NamedRequiredConfig, parse_named_configuration
16-
from zarr.core.config import config
1716
from zarr.core.dtype.common import HasItemSize
1817
from zarr.core.json_parse import parse_field
1918

@@ -102,7 +101,8 @@ class BloscCname(metaclass=_DeprecatedStrEnumMeta):
102101

103102

104103
# See https://zarr.readthedocs.io/en/stable/user-guide/performance.html#configuring-blosc
105-
numcodecs.blosc.use_threads = config.get("blosc.use_threads", False)
104+
numcodecs.blosc.use_threads = False
105+
106106

107107
def parse_typesize(data: JSON) -> int:
108108
parsed: int = parse_field(data, int, "typesize", error=TypeError)

‎src/zarr/core/config.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"""
2929

3030
from __future__ import annotations
31-
3231
import importlib
3332

3433
from typing import TYPE_CHECKING, Any, Literal, cast

‎tests/test_config.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,3 +483,11 @@ def test_deprecated_config(key: str) -> None:
483483
with pytest.raises(ValueError):
484484
with zarr.config.set({key: "foo"}):
485485
pass
486+
487+
488+
def test_blosc_use_threads_config() -> None:
489+
import numcodecs
490+
491+
assert numcodecs.blosc.use_threads is False
492+
with config.set({"blosc.use_threads": True}):
493+
assert numcodecs.blosc.use_threads is True

0 commit comments

Comments
 (0)