Skip to content

Commit 2e22746

Browse files
committed
Merge branch 'main' of github.com:zarr-developers/zarr-python into feat/lazy-indexing
2 parents c275d91 + 74a248d commit 2e22746

19 files changed

Lines changed: 265 additions & 59 deletions

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default_language_version:
1111

1212
repos:
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.14.10
14+
rev: v0.14.14
1515
hooks:
1616
- id: ruff-check
1717
args: ["--fix", "--show-fixes"]

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
</a>
1414
</td>
1515
</tr>
16+
<tr>
1617
<td></td>
1718
<td>
1819
<a href="https://anaconda.org/anaconda/zarr/">
@@ -23,9 +24,9 @@
2324
<tr>
2425
<td>Package Status</td>
2526
<td>
26-
<a href="https://pypi.org/project/zarr/">
27-
<img src="https://img.shields.io/pypi/status/zarr.svg" alt="status" />
28-
</a>
27+
<a href="https://pypi.org/project/zarr/">
28+
<img src="https://img.shields.io/pypi/status/zarr.svg" alt="status" />
29+
</a>
2930
</td>
3031
</tr>
3132
<tr>
@@ -47,17 +48,16 @@
4748
<tr>
4849
<td>Pre-commit Status</td>
4950
<td>
50-
<a href=""https://github.com/zarr-developers/zarr-python/blob/main/.pre-commit-config.yaml">
51+
<a href="https://github.com/zarr-developers/zarr-python/blob/main/.pre-commit-config.yaml">
5152
<img src="https://results.pre-commit.ci/badge/github/zarr-developers/zarr-python/main.svg" alt="pre-commit status" />
5253
</a>
5354
</td>
5455
</tr>
55-
5656
<tr>
5757
<td>Coverage</td>
5858
<td>
5959
<a href="https://codecov.io/gh/zarr-developers/zarr-python">
60-
<img src="https://codecov.io/gh/zarr-developers/zarr-python/branch/main/graph/badge.svg"/ alt="coverage">
60+
<img src="https://codecov.io/gh/zarr-developers/zarr-python/branch/main/graph/badge.svg" alt="coverage" />
6161
</a>
6262
</td>
6363
</tr>
@@ -70,27 +70,28 @@
7070
</td>
7171
</tr>
7272
<tr>
73-
<td>Developer Chat</td>
74-
<td>
75-
<a href="https://ossci.zulipchat.com/">
76-
<img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" />
77-
</a>
78-
</td>
73+
<td>Developer Chat</td>
74+
<td>
75+
<a href="https://ossci.zulipchat.com/">
76+
<img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" />
77+
</a>
78+
</td>
7979
</tr>
8080
<tr>
81-
<td>Funding</td>
82-
<td>
83-
<a href="https://chanzuckerberg.com/eoss/">
84-
<img src="https://img.shields.io/badge/funded%20by-EOSS-FF414B.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PHBhdGggZD0iTTIyLjA5OCAyMS4wNzRjLTEuMjM1Ljg2LTIuNjggMS4zOTktNC42ODggMS40MzgtMi40MjYuMDUtNC4yMzgtMS41NTEtNC40MDYtMy45MThhNC40NjUgNC40NjUgMCAwIDEgMS4xODctMy4zOCA0LjQ4IDQuNDggMCAwIDEgMy4yODYtMS40NDQgNC42NzQgNC42NzQgMCAwIDEgMS44OTQuMzc1cy0uMTU2IDEuMzItLjIxIDEuOTE0bDEuOTg3LjAxNS4zNTYtMi45NzYtLjU2My0uMzU2YTYuNTQxIDYuNTQxIDAgMCAwLTMuNDg0LS45NjkgNi41OTMgNi41OTMgMCAwIDAtNC43NSAyLjA4NiA2LjQxNSA2LjQxNSAwIDAgMC0xLjcxNSA0Ljg3NWMuMTEzIDEuNjEuODA5IDMuMDc4IDEuOTUgNC4xNDEgMS4xNTYgMS4wNyAyLjcxNCAxLjY0NSA0LjM5OCAxLjYzMy4wMzkgMCAuMDc4IDAgLjEyNS0uMDA0YTkuOTE4IDkuOTE4IDAgMCAwIDMuNDMzLS43MjNsMS40MzQtMi43ODlzLS4wMjctLjA2Mi0uMjM0L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S4wOTQuMTc2LjA5Ny4zNjMuMjc3LjI3NGwyLjUyMy0xLjM0YzEuMjE5LS42MjUgMy4yNS0xLjkxIDQuMjU0LTEuMTY4LjE0NS4xMS4zMzIuMzk4LjM0OC42OTVhLjM1Ny4zNTcgMCAwIDEtLjE0OS4yOTNsLTUuMDQzIDMuNDA2Yy0xLjYzNiAxLjE2OC0yLjI3NyAyLjkxLTIuMTIgNC41NTUuMTI0IDEuMzc1Ljk4NCAyLjU2NiAyLjI1NyAzLjI2MmE0LjE3IDQuMTcgMCAwIDAgMi4xMTMuNTE1IDQuMTY5IDQuMTY5IDAgMCAwIDEuODY0LS41YzEuNDM3LS43NTQgMi4zOTQtMi4yMzQgMi41NjItMy45NDVsLjQwMi00LjYxMy0yLjE5OSAxLjYzM1ptMCAwIiBzdHlsZT0ic3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDojZmZmO2ZpbGwtb3BhY2l0eToxIi8+PC9zdmc+" alt="CZI's Essential Open Source Software for Science">
85-
</a>
86-
</td>
81+
<td>Funding</td>
82+
<td>
83+
<a href="https://chanzuckerberg.com/eoss/">
84+
<img src="https://img.shields.io/badge/funded%20by-EOSS-FF414B.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PHBhdGggZD0iTTIyLjA5OCAyMS4wNzRjLTEuMjM1Ljg2LTIuNjggMS4zOTktNC42ODggMS40MzgtMi40MjYuMDUtNC4yMzgtMS41NTEtNC40MDYtMy45MThhNC40NjUgNC40NjUgMCAwIDEgMS4xODctMy4zOCA0LjQ4IDQuNDggMCAwIDEgMy4yODYtMS40NDQgNC42NzQgNC42NzQgMCAwIDEgMS44OTQuMzc1cy0uMTU2IDEuMzItLjIxIDEuOTE0bDEuOTg3LjAxNS4zNTYtMi45NzYtLjU2My0uMzU2YTYuNTQxIDYuNTQxIDAgMCAw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C0uMzEzLTMuMzkxYTE5Ljk5NyAxOS45OTcgMCAwIDAtLjQ1My0xLjgzMmwtMy43OTMgMi4zNy01LjAyIDMuMThjLS4xNzUtLjY2OC0uNTgxLTEuMzQzLTEuNDQtMS43My0xLjAxMi0uNDY1LTIuNjYtLjExLTMuODY4LjU4MiAwIDAgMy4zMDUtNi40MDIgMy44Ni03LjQ1LjAzNS0uMDY2LS4wMTYtLjE0OC0uMDk4LS4xNDhoLTYuMThsLS4yNSAyLjA2N0gyNi41MDhsLTQuNzMgOS4wNjJjLS4wOTQuMTc2LjA5Ny4zNjMuMjc3LjI3NGwyLjUyMy0xLjM0YzEuMjE5LS42MjUgMy4yNS0xLjkxIDQuMjU0LTEuMTY4LjE0NS4xMS4zMzIuMzk4LjM0OC42OTVhLjM1Ny4zNTcgMCAwIDEtLjE0OS4yOTNsLTUuMDQzIDMuNDA2Yy0xLjYzNiAxLjE2OC0yLjI3NyAyLjkxLTIuMTIgNC41NTUuMTI0IDEuMzc1Ljk4NCAyLjU2NiAyLjI1NyAzLjI2MmE0LjE3IDQuMTcgMCAwIDAgMi4xMTMuNTE1IDQuMTY5IDQuMTY5IDAgMCAwIDEuODY0LS41YzEuNDM3LS43NTQgMi4zOTQtMi4yMzQgMi41NjItMy45NDVsLjQwMi00LjYxMy0yLjE5OSAxLjYzM1ptMCAwIiBzdHlsZT0ic3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDojZmZmO2ZpbGwtb3BhY2l0eToxIi8+PC9zdmc+" alt="CZI's Essential Open Source Software for Science" />
85+
</a>
86+
</td>
8787
</tr>
88-
<td>Citation</td>
89-
<td>
90-
<a href="https://doi.org/10.5281/zenodo.3773450">
91-
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.3773450.svg" alt="DOI">
92-
</a>
93-
</td>
88+
<tr>
89+
<td>Citation</td>
90+
<td>
91+
<a href="https://doi.org/10.5281/zenodo.3773450">
92+
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.3773450.svg" alt="DOI" />
93+
</a>
94+
</td>
9495
</tr>
9596

9697
</table>

changes/3668.feature.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Exposes the array runtime configuration as an attribute called `config` on the `Array` and
2+
`AsyncArray` classes. The previous `AsyncArray._config` attribute is now a deprecated alias for `AsyncArray.config`.
3+
4+
Adds a method for creating a new `Array` / `AsyncArray` instance with a new runtime configuration, and fixes inaccurate documentation about the `write_empty_chunks` configuration parameter.

changes/3695.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Raise error when trying to encode :class:`numpy.dtypes.StringDType` with `na_object` set.

docs/contributing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ The hooks can be installed locally by running:
131131
prek install
132132
```
133133

134-
This would run the checks every time a commit is created locally. The checks will by default only run on the files modified by a commit, but the checks can be triggered for all the files by running:
134+
This will run the checks every time a commit is created locally. The checks will by default only run on the files modified by a commit, but the checks can be triggered for all the files by running:
135135

136136
```bash
137137
prek run --all-files
@@ -249,33 +249,33 @@ Pull requests submitted by an external contributor should be reviewed and approv
249249

250250
Pull requests should not be merged until all CI checks have passed (GitHub Actions, Codecov) against code that has had the latest main merged in.
251251

252-
Before merging the milestone must be set either to decide whether a PR will be in the next patch, minor, or major release. The next section explains which types of changes go in each release.
252+
Before merging, the milestone must be set to decide whether a PR will be in the next patch, minor, or major release. The next section explains which types of changes go in each release.
253253

254254
## Compatibility and versioning policies
255255

256256
### Versioning
257257

258-
Versions of this library are identified by a triplet of integers with the form `<major>.<minor>.<patch>`, for example `3.0.4`. A release of `zarr-python` is associated with a new version identifier. That new identifier is generated by incrementing exactly one of the components of the previous version identifier by 1. When incrementing the `major` component of the version identifier, the `minor` and `patch` components is reset to 0. When incrementing the minor component, the patch component is reset to 0.
258+
Versions of this library are identified by a triplet of integers with the form `<major>.<minor>.<patch>`, for example `3.0.4`. A release of `zarr-python` is associated with a new version identifier. That new identifier is generated by incrementing exactly one of the components of the previous version identifier by 1. When incrementing the `major` component of the version identifier, the `minor` and `patch` components are reset to 0. When incrementing the minor component, the patch component is reset to 0.
259259

260260
Releases are classified by the library changes contained in that release. This classification determines which component of the version identifier is incremented on release.
261261

262262
* **major** releases (for example, `2.18.0` -> `3.0.0`) are for changes that will require extensive adaptation efforts from many users and downstream projects. For example, breaking changes to widely-used user-facing APIs should only be applied in a major release.
263263

264264
Users and downstream projects should carefully consider the impact of a major release before adopting it. In advance of a major release, developers should communicate the scope of the upcoming changes, and help users prepare for them.
265265

266-
* **minor** releases (for example, `3.0.0` -> `3.1.0`) are for changes that do not require significant effort from most users or downstream downstream projects to respond to. API changes are possible in minor releases if the burden on users imposed by those changes is sufficiently small.
266+
* **minor** releases (for example, `3.0.0` -> `3.1.0`) are for changes that do not require significant effort from most users or downstream projects to respond to. API changes are possible in minor releases if the burden on users imposed by those changes is sufficiently small.
267267

268268
For example, a recently released API may need fixes or refinements that are breaking, but low impact due to the recency of the feature. Such API changes are permitted in a minor release.
269269

270270
Minor releases are safe for most users and downstream projects to adopt.
271271

272272
* **patch** releases (for example, `3.1.0` -> `3.1.1`) are for changes that contain no breaking or behaviour changes for downstream projects or users. Examples of changes suitable for a patch release are bugfixes and documentation improvements.
273273

274-
Users should always feel safe upgrading to a the latest patch release.
274+
Users should always feel safe upgrading to the latest patch release.
275275

276276
Note that this versioning scheme is not consistent with [Semantic Versioning](https://semver.org/). Contrary to SemVer, the Zarr library may release breaking changes in `minor` releases, or even `patch` releases under exceptional circumstances. But we should strive to avoid doing so.
277277

278-
A better model for our versioning scheme is [Intended Effort Versioning](https://jacobtomlinson.dev/effver/), or "EffVer". The guiding principle off EffVer is to categorize releases based on the *expected effort required to upgrade to that release*.
278+
A better model for our versioning scheme is [Intended Effort Versioning](https://jacobtomlinson.dev/effver/), or "EffVer". The guiding principle of EffVer is to categorize releases based on the *expected effort required to upgrade to that release*.
279279

280280
Zarr developers should make changes as smooth as possible for users. This means making backwards-compatible changes wherever possible. When a backwards-incompatible change is necessary, users should be notified well in advance, e.g. via informative deprecation warnings.
281281

@@ -288,12 +288,12 @@ If an existing Zarr format version changes, or a new version of the Zarr format
288288
## Release procedure
289289

290290
Open an issue on GitHub announcing the release using the release checklist template:
291-
[https://github.com/zarr-developers/zarr-python/issues/new?template=release-checklist.md](https://github.com/zarr-developers/zarr-python/issues/new?template=release-checklist.md>). The release checklist includes all steps necessary for the release.
291+
[https://github.com/zarr-developers/zarr-python/issues/new?template=release-checklist.md](https://github.com/zarr-developers/zarr-python/issues/new?template=release-checklist.md). The release checklist includes all steps necessary for the release.
292292

293293
## Benchmarks
294294

295295
Zarr uses [pytest-benchmark](https://pytest-benchmark.readthedocs.io/en/latest/) for running
296-
performance benchmarks as part of our test suite. The benchmarks can be are found in `tests/benchmarks`.
296+
performance benchmarks as part of our test suite. The benchmarks are found in `tests/benchmarks`.
297297
By default pytest is configured to run these benchmarks as plain tests (i.e., no benchmarking). To run
298298
a benchmark with timing measurements, use the `--benchmark-enable` when invoking `pytest`.
299299

docs/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This section will help you get up and running with
1+
This section will help you get up and running with
22
the Zarr library in Python to efficiently manage and analyze multi-dimensional arrays.
33

44
### Creating an Array
@@ -92,7 +92,7 @@ spam[:] = np.arange(10)
9292
print(root.tree())
9393
```
9494

95-
This creates a group with two datasets: `foo` and `bar`.
95+
This creates a group hierarchy with a group (`foo`) and two arrays (`bar` and `spam`).
9696

9797
#### Batch Hierarchy Creation
9898

docs/user-guide/arrays.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ print(z[:, 0])
7272
print(z[:])
7373
```
7474

75-
Read more about NumPy-style indexing can be found in the
75+
More information about NumPy-style indexing can be found in the
7676
[NumPy documentation](https://numpy.org/doc/stable/user/basics.indexing.html).
7777

7878
## Persistent arrays
@@ -154,6 +154,32 @@ z.append(np.vstack([a, a]), axis=1)
154154
print(f"Shape after second append: {z.shape}")
155155
```
156156

157+
## Runtime configuration
158+
159+
Zarr arrays are parametrized with a configuration that determines certain aspects of array behavior.
160+
161+
We currently support two configuration options for arrays: `write_empty_chunks` and `order`.
162+
163+
| field | type | default | description |
164+
| - | - | - | - |
165+
| `write_empty_chunks` | `bool` | `False` | Controls whether empty chunks are written to storage. See [Empty chunks](performance.md#empty-chunks).
166+
| `order` | `Literal["C", "F"]` | `"C"` | The memory layout of arrays returned when reading data from the store.
167+
168+
You can specify the configuration when you create an array with the `config` keyword argument.
169+
`config` can be passed as either a `dict` or an `ArrayConfig` object.
170+
171+
```python exec="true" session="arrays" source="above" result="ansi"
172+
arr = zarr.create_array({}, shape=(10,), dtype='int8', config={"write_empty_chunks": True})
173+
print(arr.config)
174+
```
175+
176+
To get an array view with a different config, use the `with_config` method.
177+
178+
```python exec="true" session="arrays" source="above" result="ansi"
179+
arr_f = arr.with_config({"order": "F"})
180+
print(arr_f.config)
181+
```
182+
157183
## Compressors
158184

159185
A number of different compressors can be used with Zarr. Zarr includes Blosc,
@@ -271,7 +297,7 @@ array without loading the entire array into memory.
271297
Note that although this functionality is similar to some of the advanced
272298
indexing capabilities available on NumPy arrays and on h5py datasets, **the Zarr
273299
API for advanced indexing is different from both NumPy and h5py**, so please
274-
read this section carefully. For a complete description of the indexing API,
300+
read this section carefully. For a complete description of the indexing API,
275301
see the documentation for the [`zarr.Array`][] class.
276302

277303
### Indexing with coordinate arrays

docs/user-guide/extending.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ of the array data. Examples include compression codecs, such as
2929

3030
Custom codecs for Zarr are implemented by subclassing the relevant base class, see
3131
[`zarr.abc.codec.ArrayArrayCodec`][], [`zarr.abc.codec.ArrayBytesCodec`][] and
32-
[`zarr.abc.codec.BytesBytesCodec`][]. Most custom codecs should implemented the
32+
[`zarr.abc.codec.BytesBytesCodec`][]. Most custom codecs should implement the
3333
`_encode_single` and `_decode_single` methods. These methods operate on single chunks
3434
of the array data. Alternatively, custom codecs can implement the `encode` and `decode`
3535
methods, which operate on batches of chunks, in case the codec is intended to implement

docs/user-guide/groups.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ root = zarr.create_group(store=store)
1313
print(root)
1414
```
1515

16-
Groups have a similar API to the Group class from [h5py](https://www.h5py.org/). For example, groups can contain other groups:
16+
Groups have a similar API to the Group class from [h5py](https://www.h5py.org/). For example, groups can contain other groups:
1717

1818
```python exec="true" session="groups" source="above"
1919
foo = root.create_group('foo')

docs/user-guide/performance.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,14 @@ This optimization prevents storing redundant objects and can speed up reads, but
125125
added computation during array writes, since the contents of
126126
each chunk must be compared to the fill value, and these advantages are contingent on the content of the array.
127127
If you know that your data will form chunks that are almost always non-empty, then there is no advantage to the optimization described above.
128-
In this case, creating an array with `write_empty_chunks=True` (the default) will instruct Zarr to write every chunk without checking for emptiness.
128+
In this case, creating an array with `write_empty_chunks=True` will instruct Zarr to write every chunk without checking for emptiness.
129+
130+
The default value of `write_empty_chunks` is `False`:
131+
132+
```python exec="true" session="performance" source="above" result="ansi"
133+
arr = zarr.create_array(store={}, shape=(1,), dtype='uint8')
134+
assert arr.config.write_empty_chunks == False
135+
```
129136

130137
The following example illustrates the effect of the `write_empty_chunks` flag on
131138
the time required to write an array with different values.:

0 commit comments

Comments
 (0)