Skip to content

Commit 090349c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into gpu-codecs
2 parents d24d027 + a0c56fb commit 090349c

36 files changed

+332
-102
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Check changelog entries
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check-changelogs:
8+
name: Check changelog entries
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
16+
17+
- name: Check changelog entries
18+
run: uv run --no-sync python ci/check_changelog_entries.py

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2024 Zarr Developers <https://github.com/zarr-developers>
3+
Copyright (c) 2015-2025 Zarr Developers <https://github.com/zarr-developers>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
File renamed without changes.
File renamed without changes.

changes/3264.bugfix.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Expand the range of types accepted by ``parse_data_type`` to include strings and Sequences.
2+
- Move the functionality of ``parse_data_type`` to a new function called ``parse_dtype``. This change
3+
ensures that nomenclature is consistent across the codebase. ``parse_data_type`` remains, so this
4+
change is not breaking.

changes/3273.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a section on codecs to the migration guide.

changes/3280.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a regression introduced in 3.1.0 that prevented ``inf``, ``-inf``, and ``nan`` values
2+
from being stored in ``attributes``.

changes/3287.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes Group.nmembers() ignoring depth when using consolidated metadata.

ci/check_changelog_entries.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
Check changelog entries have the correct filename structure.
3+
"""
4+
5+
import sys
6+
from pathlib import Path
7+
8+
VALID_CHANGELOG_TYPES = ["feature", "bugfix", "doc", "removal", "misc"]
9+
CHANGELOG_DIRECTORY = (Path(__file__).parent.parent / "changes").resolve()
10+
11+
12+
def is_int(s: str) -> bool:
13+
try:
14+
int(s)
15+
except ValueError:
16+
return False
17+
else:
18+
return True
19+
20+
21+
if __name__ == "__main__":
22+
print(f"Looking for changelog entries in {CHANGELOG_DIRECTORY}")
23+
entries = CHANGELOG_DIRECTORY.glob("*")
24+
entries = [e for e in entries if e.name not in [".gitignore", "README.md"]]
25+
print(f"Found {len(entries)} entries")
26+
print()
27+
28+
bad_suffix = [e for e in entries if e.suffix != ".rst"]
29+
bad_issue_no = [e for e in entries if not is_int(e.name.split(".")[0])]
30+
bad_type = [e for e in entries if e.name.split(".")[1] not in VALID_CHANGELOG_TYPES]
31+
32+
if len(bad_suffix) or len(bad_issue_no) or len(bad_type):
33+
if len(bad_suffix):
34+
print("Changelog entries without .rst suffix")
35+
print("-------------------------------------")
36+
print("\n".join([p.name for p in bad_suffix]))
37+
print()
38+
if len(bad_issue_no):
39+
print("Changelog entries without integer issue number")
40+
print("----------------------------------------------")
41+
print("\n".join([p.name for p in bad_issue_no]))
42+
print()
43+
if len(bad_type):
44+
print("Changelog entries without valid type")
45+
print("------------------------------------")
46+
print("\n".join([p.name for p in bad_type]))
47+
print(f"Valid types are: {VALID_CHANGELOG_TYPES}")
48+
print()
49+
sys.exit(1)
50+
51+
sys.exit(0)

docs/user-guide/data_types.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -412,17 +412,17 @@ attempt data type resolution against *every* data type class, and if, for some r
412412
type matches multiple Zarr data types, we treat this as an error and raise an exception.
413413

414414
If you have a NumPy data type and you want to get the corresponding ``ZDType`` instance, you can use
415-
the ``parse_data_type`` function, which will use the dynamic resolution described above. ``parse_data_type``
415+
the ``parse_dtype`` function, which will use the dynamic resolution described above. ``parse_dtype``
416416
handles a range of input types:
417417

418418
- NumPy data types:
419419

420420
.. code-block:: python
421421
422422
>>> import numpy as np
423-
>>> from zarr.dtype import parse_data_type
423+
>>> from zarr.dtype import parse_dtype
424424
>>> my_dtype = np.dtype('>M8[10s]')
425-
>>> parse_data_type(my_dtype, zarr_format=2)
425+
>>> parse_dtype(my_dtype, zarr_format=2)
426426
DateTime64(endianness='big', scale_factor=10, unit='s')
427427
428428
@@ -431,7 +431,7 @@ handles a range of input types:
431431
.. code-block:: python
432432
433433
>>> dtype_str = '>M8[10s]'
434-
>>> parse_data_type(dtype_str, zarr_format=2)
434+
>>> parse_dtype(dtype_str, zarr_format=2)
435435
DateTime64(endianness='big', scale_factor=10, unit='s')
436436
437437
- ``ZDType`` instances:
@@ -440,7 +440,7 @@ handles a range of input types:
440440
441441
>>> from zarr.dtype import DateTime64
442442
>>> zdt = DateTime64(endianness='big', scale_factor=10, unit='s')
443-
>>> parse_data_type(zdt, zarr_format=2) # Use a ZDType (this is a no-op)
443+
>>> parse_dtype(zdt, zarr_format=2) # Use a ZDType (this is a no-op)
444444
DateTime64(endianness='big', scale_factor=10, unit='s')
445445
446446
- Python dictionaries (requires ``zarr_format=3``). These dictionaries must be consistent with the
@@ -449,7 +449,7 @@ handles a range of input types:
449449
.. code-block:: python
450450
451451
>>> dt_dict = {"name": "numpy.datetime64", "configuration": {"unit": "s", "scale_factor": 10}}
452-
>>> parse_data_type(dt_dict, zarr_format=3)
452+
>>> parse_dtype(dt_dict, zarr_format=3)
453453
DateTime64(endianness='little', scale_factor=10, unit='s')
454-
>>> parse_data_type(dt_dict, zarr_format=3).to_json(zarr_format=3)
454+
>>> parse_dtype(dt_dict, zarr_format=3).to_json(zarr_format=3)
455455
{'name': 'numpy.datetime64', 'configuration': {'unit': 's', 'scale_factor': 10}}

0 commit comments

Comments
 (0)