Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
79dd9e2
define zarr-specific FutureWarning and DeprecationWarning
d-v-b May 25, 2025
b2e25cf
Merge branch 'main' of github.com:zarr-developers/zarr-python into re…
d-v-b Jun 30, 2025
7c644eb
make unstablespecificationwarning an instance of zarrfuturewarning
d-v-b Jun 30, 2025
c604075
use pytest.warns instead of pytest.raises
d-v-b Jun 30, 2025
b964ff6
Merge branch 'main' into refactor-warnings
d-v-b Jul 11, 2025
12bea9c
Merge branch 'main' into refactor-warnings
d-v-b Jul 11, 2025
8267c0c
Merge branch 'main' into refactor-warnings
d-v-b Jul 11, 2025
702ef09
Merge branch 'main' of https://github.com/zarr-developers/zarr-python…
d-v-b Jul 31, 2025
64e1405
changelog
d-v-b Jul 31, 2025
d322cad
ensure that all deprecations are ZarrDeprecations
d-v-b Aug 1, 2025
31e63aa
add docstrings and export warnings
d-v-b Aug 1, 2025
917fd3d
fix imports
d-v-b Aug 1, 2025
9055d3b
handle warnings in tests explicitly; make userwarnings ZarrUserWarning
d-v-b Aug 1, 2025
fee48d3
fix doctests by making them more realistic
d-v-b Aug 1, 2025
6a208eb
lint and fix typo
d-v-b Aug 1, 2025
8a2bb9e
Merge branch 'main' into refactor-warnings
d-v-b Aug 1, 2025
a235660
move unstable spec warning to errors
d-v-b Aug 1, 2025
8afdce9
Merge branch 'refactor-warnings' of https://github.com/d-v-b/zarr-pyt…
d-v-b Aug 1, 2025
33a9184
handle warnings in gpu tests
d-v-b Aug 1, 2025
fc72752
handle more warnings
d-v-b Aug 1, 2025
42b4cb5
handle another warning
d-v-b Aug 1, 2025
713bda9
Fix exports
d-v-b Aug 1, 2025
f483eb8
Update src/zarr/errors.py
d-v-b Aug 2, 2025
d029800
Update changes/3098.misc.rst
d-v-b Aug 2, 2025
94ab461
Merge branch 'main' into refactor-warnings
d-v-b Aug 4, 2025
c11328b
Merge branch 'main' into refactor-warnings
d-v-b Aug 4, 2025
fd76671
Merge branch 'main' into refactor-warnings
d-v-b Aug 4, 2025
b7861b7
Merge branch 'main' into refactor-warnings
d-v-b Aug 5, 2025
ba5be4f
Update src/zarr/errors.py
d-v-b Aug 5, 2025
df0eef4
add test to ensure that ambiguous group.open warns
d-v-b Aug 5, 2025
61ff062
update changelog
d-v-b Aug 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' of github.com:zarr-developers/zarr-python into re…
…factor-warnings
  • Loading branch information
d-v-b committed Jun 30, 2025
commit b2e25cf74f74acc2d6beb716402fcec1c7944f07
4 changes: 2 additions & 2 deletions src/zarr/api/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
create_hierarchy,
)
from zarr.core.metadata import ArrayMetadataDict, ArrayV2Metadata, ArrayV3Metadata
from zarr.core.metadata.v2 import _default_compressor, _default_filters
from zarr.errors import NodeTypeValidationError, ZarrDeprecationWarning
from zarr.errors import GroupNotFoundError, NodeTypeValidationError, ZarrDeprecationWarning

Check warning on line 43 in src/zarr/api/asynchronous.py

View check run for this annotation

Codecov / codecov/patch

src/zarr/api/asynchronous.py#L43

Added line #L43 was not covered by tests
from zarr.storage import StorePath
from zarr.storage._common import make_store_path

if TYPE_CHECKING:
Expand Down Expand Up @@ -535,7 +535,7 @@
await asyncio.gather(*aws)


@deprecated("Use AsyncGroup.tree instead.", category=ZarrDeprecationWarning)

Check warning on line 538 in src/zarr/api/asynchronous.py

View check run for this annotation

Codecov / codecov/patch

src/zarr/api/asynchronous.py#L538

Added line #L538 was not covered by tests
async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any:
"""Provide a rich display of the hierarchy.

Expand Down
2 changes: 2 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import zarr.codecs
import zarr.storage
from zarr.storage._local import LocalStore
from zarr.storage._zip import ZipStore

if TYPE_CHECKING:
import pathlib
Expand Down
36 changes: 2 additions & 34 deletions tests/test_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,41 +229,9 @@ def test_v2_non_contiguous(numpy_order: Literal["C", "F"], zarr_order: Literal["
assert (sub_arr).flags.c_contiguous


def test_default_compressor_deprecation_warning():
def test_default_compressor_deprecation_warning() -> None:
with pytest.warns(ZarrDeprecationWarning, match="default_compressor is deprecated"):
zarr.storage.default_compressor = "zarr.codecs.zstd.ZstdCodec()"


@pytest.mark.parametrize(
"dtype_expected",
[
["b", "zstd", None],
["i", "zstd", None],
["f", "zstd", None],
["|S1", "zstd", "vlen-bytes"],
["|U1", "zstd", "vlen-utf8"],
],
)
def test_default_filters_and_compressor(dtype_expected: Any) -> None:
with config.set(
{
"array.v2_default_compressor": {
"numeric": {"id": "zstd", "level": "0"},
"string": {"id": "zstd", "level": "0"},
"bytes": {"id": "zstd", "level": "0"},
},
"array.v2_default_filters": {
"numeric": [],
"string": [{"id": "vlen-utf8"}],
"bytes": [{"id": "vlen-bytes"}],
},
}
):
dtype, expected_compressor, expected_filter = dtype_expected
arr = zarr.create(shape=(3,), path="foo", store={}, zarr_format=2, dtype=dtype)
assert arr.metadata.compressor.codec_id == expected_compressor
if expected_filter is not None:
assert arr.metadata.filters[0].codec_id == expected_filter
zarr.storage.default_compressor = "zarr.codecs.zstd.ZstdCodec()" # type: ignore[attr-defined]


@pytest.mark.parametrize("fill_value", [None, (b"", 0, 0.0)], ids=["no_fill", "fill"])
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.