Skip to content

Commit ae3bca5

Browse files
committed
Merge branch 'v3' into generalize-stateful-store
* v3: (21 commits) Default zarr.open to open_group if shape is not provided (#2158) feat: metadata-only support for storage transformers metadata (#2180) fix(async): set default concurrency to 10 tasks (#2256) chore(deps): drop support for python 3.10 and numpy 1.24 (#2217) feature(store): add LoggingStore wrapper (#2231) Apply assorted ruff/flake8-simplify rules (SIM) (#2259) Add array storage helpers (#2065) Apply ruff/flake8-annotations rule ANN204 (#2258) No need to run DeepSource any more - we use ruff (#2261) Remove unnecessary lambda expression (#2260) Enforce ruff/flake8-comprehensions rules (C4) (#2239) Use `map(str, *)` in `test_accessed_chunks` (#2229) Replace Gitter with Zulip (#2254) Enforce ruff/flake8-pytest-style rules (PT) (#2236) Fix multiple identical imports (#2241) Enforce ruff/flake8-return rules (RET) (#2237) Enforce ruff/flynt rules (FLY) (#2240) Fix fill_value handling for complex dtypes (#2200) Update V2 codec pipeline to use concrete classes (#2244) Apply and enforce more ruff rules (#2053) ...
2 parents 27efef0 + 1560d21 commit ae3bca5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1369
-477
lines changed

.deepsource.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ contact_links:
33
- name: ✨ Propose a new major feature
44
url: https://github.com/zarr-developers/zarr-specs
55
about: A new major feature should be discussed in the Zarr specifications repository.
6-
- name: ❓ Discuss something on gitter
7-
url: https://gitter.im/zarr-developers/community
8-
about: For questions like "How do I do X with Zarr?", you can move to our Gitter channel.
6+
- name: ❓ Discuss something on ZulipChat
7+
url: https://ossci.zulipchat.com/
8+
about: For questions like "How do I do X with Zarr?", you can move to our ZulipChat.
99
- name: ❓ Discuss something on GitHub Discussions
1010
url: https://github.com/zarr-developers/zarr-python/discussions
1111
about: For questions like "How do I do X with Zarr?", you can move to GitHub Discussions.

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
python-version: ['3.10', '3.11', '3.12']
25-
numpy-version: ['1.24', '1.26', '2.0']
24+
python-version: ['3.11', '3.12']
25+
numpy-version: ['1.25', '1.26', '2.0']
2626
dependency-set: ["minimal", "optional"]
2727

2828
steps:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ fixture/
8484
.DS_Store
8585
tests/.hypothesis
8686
.hypothesis/
87+
88+
zarr/version.py

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.10"
6+
python: "3.12"
77

88
sphinx:
99
configuration: docs/conf.py

bench/compress_normal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
a,
1717
chunks=1000000,
1818
compression="blosc",
19-
compression_opts=dict(cname="lz4", clevel=5, shuffle=2),
19+
compression_opts={"cname": "lz4", "clevel": 5, "shuffle": 2},
2020
)
2121
print(z)
2222

docs/release.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ Documentation
11421142
* Update docs to use ``python -m pytest``.
11431143
By :user:`Ray Bell <raybellwaves>` :issue:`923`.
11441144

1145-
* Fix versionadded tag in zarr.core.Array docstring.
1145+
* Fix versionadded tag in zarr.Array docstring.
11461146
By :user:`Juan Nunez-Iglesias <jni>` :issue:`852`.
11471147

11481148
* Doctest seem to be stricter now, updating tostring() to tobytes().
@@ -1896,7 +1896,7 @@ Enhancements
18961896
:user:`John Kirkham <jakirkham>`, :issue:`92`, :issue:`122`.
18971897

18981898
* **Viewing an array as a different dtype**. The ``Array`` class has a new
1899-
:func:`zarr.core.Array.astype` method, which is a convenience that enables an
1899+
:func:`zarr.Array.astype` method, which is a convenience that enables an
19001900
array to be viewed as a different dtype. By :user:`John Kirkham <jakirkham>`,
19011901
:issue:`94`, :issue:`96`.
19021902

docs/tutorial.rst

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Zarr has several functions for creating arrays. For example::
1818
>>> import zarr
1919
>>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4')
2020
>>> z
21-
<zarr.core.Array (10000, 10000) int32>
21+
<zarr.Array (10000, 10000) int32>
2222

2323
The code above creates a 2-dimensional array of 32-bit integers with 10000 rows
2424
and 10000 columns, divided into chunks where each chunk has 1000 rows and 1000
@@ -168,7 +168,7 @@ compression ratio. Zarr arrays provide a ``info`` property which can be used to
168168
print some diagnostics, e.g.::
169169

170170
>>> z.info
171-
Type : zarr.core.Array
171+
Type : zarr.Array
172172
Data type : int32
173173
Shape : (10000, 10000)
174174
Chunk shape : (1000, 1000)
@@ -260,7 +260,7 @@ Here is an example using a delta filter with the Blosc compressor::
260260
>>> data = np.arange(100000000, dtype='i4').reshape(10000, 10000)
261261
>>> z = zarr.array(data, chunks=(1000, 1000), filters=filters, compressor=compressor)
262262
>>> z.info
263-
Type : zarr.core.Array
263+
Type : zarr.Array
264264
Data type : int32
265265
Shape : (10000, 10000)
266266
Chunk shape : (1000, 1000)
@@ -302,15 +302,15 @@ Groups can also contain arrays, e.g.::
302302

303303
>>> z1 = bar.zeros('baz', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
304304
>>> z1
305-
<zarr.core.Array '/foo/bar/baz' (10000, 10000) int32>
305+
<zarr.Array '/foo/bar/baz' (10000, 10000) int32>
306306

307307
Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py,
308308
Zarr groups also implement the ``create_dataset()`` and ``require_dataset()``
309309
methods, e.g.::
310310

311311
>>> z = bar.create_dataset('quux', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
312312
>>> z
313-
<zarr.core.Array '/foo/bar/quux' (10000, 10000) int32>
313+
<zarr.Array '/foo/bar/quux' (10000, 10000) int32>
314314

315315
Members of a group can be accessed via the suffix notation, e.g.::
316316

@@ -323,7 +323,7 @@ call, e.g.::
323323
>>> root['foo/bar']
324324
<zarr.hierarchy.Group '/foo/bar'>
325325
>>> root['foo/bar/baz']
326-
<zarr.core.Array '/foo/bar/baz' (10000, 10000) int32>
326+
<zarr.Array '/foo/bar/baz' (10000, 10000) int32>
327327

328328
The :func:`zarr.hierarchy.Group.tree` method can be used to print a tree
329329
representation of the hierarchy, e.g.::
@@ -344,7 +344,7 @@ sub-directories, e.g.::
344344
<zarr.hierarchy.Group '/'>
345345
>>> z = root.zeros('foo/bar/baz', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
346346
>>> z
347-
<zarr.core.Array '/foo/bar/baz' (10000, 10000) int32>
347+
<zarr.Array '/foo/bar/baz' (10000, 10000) int32>
348348

349349
Groups can be used as context managers (in a ``with`` statement).
350350
If the underlying store has a ``close`` method, it will be called on exit.
@@ -388,7 +388,7 @@ property. E.g.::
388388

389389
>>> bar.info
390390
Name : /foo/bar
391-
Type : zarr.core.Array
391+
Type : zarr.Array
392392
Data type : int64
393393
Shape : (1000000,)
394394
Chunk shape : (100000,)
@@ -403,7 +403,7 @@ property. E.g.::
403403

404404
>>> baz.info
405405
Name : /foo/baz
406-
Type : zarr.core.Array
406+
Type : zarr.Array
407407
Data type : float32
408408
Shape : (1000, 1000)
409409
Chunk shape : (100, 100)
@@ -472,7 +472,7 @@ Note that although this functionality is similar to some of the advanced
472472
indexing capabilities available on NumPy arrays and on h5py datasets, **the Zarr
473473
API for advanced indexing is different from both NumPy and h5py**, so please
474474
read this section carefully. For a complete description of the indexing API,
475-
see the documentation for the :class:`zarr.core.Array` class.
475+
see the documentation for the :class:`zarr.Array` class.
476476

477477
Indexing with coordinate arrays
478478
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -880,10 +880,10 @@ Here is an example using S3Map to read an array created previously::
880880
>>> root = zarr.group(store=store)
881881
>>> z = root['foo/bar/baz']
882882
>>> z
883-
<zarr.core.Array '/foo/bar/baz' (21,) |S1>
883+
<zarr.Array '/foo/bar/baz' (21,) |S1>
884884
>>> z.info
885885
Name : /foo/bar/baz
886-
Type : zarr.core.Array
886+
Type : zarr.Array
887887
Data type : |S1
888888
Shape : (21,)
889889
Chunk shape : (7,)
@@ -1150,7 +1150,7 @@ your array, then you can use an array with a fixed-length bytes dtype. E.g.::
11501150

11511151
>>> z = zarr.zeros(10, dtype='S6')
11521152
>>> z
1153-
<zarr.core.Array (10,) |S6>
1153+
<zarr.Array (10,) |S6>
11541154
>>> z[0] = b'Hello'
11551155
>>> z[1] = b'world!'
11561156
>>> z[:]
@@ -1166,7 +1166,7 @@ A fixed-length unicode dtype is also available, e.g.::
11661166
>>> text_data = greetings * 10000
11671167
>>> z = zarr.array(text_data, dtype='U20')
11681168
>>> z
1169-
<zarr.core.Array (120000,) <U20>
1169+
<zarr.Array (120000,) <U20>
11701170
>>> z[:]
11711171
array(['¡Hola mundo!', 'Hej Världen!', 'Servus Woid!', ...,
11721172
'Helló, világ!', 'Zdravo svete!', 'เฮลโลเวิลด์'],
@@ -1182,7 +1182,7 @@ E.g. using ``VLenUTF8``::
11821182
>>> import numcodecs
11831183
>>> z = zarr.array(text_data, dtype=object, object_codec=numcodecs.VLenUTF8())
11841184
>>> z
1185-
<zarr.core.Array (120000,) object>
1185+
<zarr.Array (120000,) object>
11861186
>>> z.filters
11871187
[VLenUTF8()]
11881188
>>> z[:]
@@ -1194,7 +1194,7 @@ is a short-hand for ``dtype=object, object_codec=numcodecs.VLenUTF8()``, e.g.::
11941194

11951195
>>> z = zarr.array(text_data, dtype=str)
11961196
>>> z
1197-
<zarr.core.Array (120000,) object>
1197+
<zarr.Array (120000,) object>
11981198
>>> z.filters
11991199
[VLenUTF8()]
12001200
>>> z[:]
@@ -1210,7 +1210,7 @@ e.g.::
12101210
>>> bytes_data = [g.encode('utf-8') for g in greetings] * 10000
12111211
>>> z = zarr.array(bytes_data, dtype=bytes)
12121212
>>> z
1213-
<zarr.core.Array (120000,) object>
1213+
<zarr.Array (120000,) object>
12141214
>>> z.filters
12151215
[VLenBytes()]
12161216
>>> z[:]
@@ -1225,7 +1225,7 @@ integer. E.g.::
12251225
>>> categorize = numcodecs.Categorize(greetings, dtype=object)
12261226
>>> z = zarr.array(text_data, dtype=object, object_codec=categorize)
12271227
>>> z
1228-
<zarr.core.Array (120000,) object>
1228+
<zarr.Array (120000,) object>
12291229
>>> z.filters
12301230
[Categorize(dtype='|O', astype='|u1', labels=['¡Hola mundo!', 'Hej Världen!', 'Servus Woid!', ...])]
12311231
>>> z[:]
@@ -1275,7 +1275,7 @@ and stores the same primitive type (a.k.a. a ragged array), the
12751275

12761276
>>> z = zarr.empty(4, dtype=object, object_codec=numcodecs.VLenArray(int))
12771277
>>> z
1278-
<zarr.core.Array (4,) object>
1278+
<zarr.Array (4,) object>
12791279
>>> z.filters
12801280
[VLenArray(dtype='<i8')]
12811281
>>> z[0] = np.array([1, 3, 5])
@@ -1291,7 +1291,7 @@ primitive dtype such as 'i4' or 'f8'. E.g.::
12911291

12921292
>>> z = zarr.empty(4, dtype='array:i8')
12931293
>>> z
1294-
<zarr.core.Array (4,) object>
1294+
<zarr.Array (4,) object>
12951295
>>> z.filters
12961296
[VLenArray(dtype='<i8')]
12971297
>>> z[0] = np.array([1, 3, 5])
@@ -1367,7 +1367,7 @@ ratios, depending on the correlation structure within the data. E.g.::
13671367
>>> a = np.arange(100000000, dtype='i4').reshape(10000, 10000).T
13681368
>>> c = zarr.array(a, chunks=(1000, 1000))
13691369
>>> c.info
1370-
Type : zarr.core.Array
1370+
Type : zarr.Array
13711371
Data type : int32
13721372
Shape : (10000, 10000)
13731373
Chunk shape : (1000, 1000)
@@ -1381,7 +1381,7 @@ ratios, depending on the correlation structure within the data. E.g.::
13811381
Chunks initialized : 100/100
13821382
>>> f = zarr.array(a, chunks=(1000, 1000), order='F')
13831383
>>> f.info
1384-
Type : zarr.core.Array
1384+
Type : zarr.Array
13851385
Data type : int32
13861386
Shape : (10000, 10000)
13871387
Chunk shape : (1000, 1000)
@@ -1549,7 +1549,7 @@ with thread synchronization::
15491549
>>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4',
15501550
... synchronizer=zarr.ThreadSynchronizer())
15511551
>>> z
1552-
<zarr.core.Array (10000, 10000) int32>
1552+
<zarr.Array (10000, 10000) int32>
15531553

15541554
This array is safe to read or write within a multi-threaded program.
15551555

@@ -1563,7 +1563,7 @@ some networked file systems). E.g.::
15631563
... chunks=(1000, 1000), dtype='i4',
15641564
... synchronizer=synchronizer)
15651565
>>> z
1566-
<zarr.core.Array (10000, 10000) int32>
1566+
<zarr.Array (10000, 10000) int32>
15671567

15681568
This array is safe to read or write from multiple processes.
15691569

@@ -1631,7 +1631,7 @@ arrays, as long as the units are specified. E.g.::
16311631

16321632
>>> z = zarr.array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='M8[D]')
16331633
>>> z
1634-
<zarr.core.Array (3,) datetime64[D]>
1634+
<zarr.Array (3,) datetime64[D]>
16351635
>>> z[:]
16361636
array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='datetime64[D]')
16371637
>>> z[0]

0 commit comments

Comments
 (0)