Skip to content

Migration to zarr 3 - #112

Open
konstntokas wants to merge 11 commits into
mainfrom
konstntokas/migrate_zarr3
Open

konstntokas wants to merge 11 commits into
mainfrom
konstntokas/migrate_zarr3

Conversation

@konstntokas

@konstntokas konstntokas commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Migrated to the Zarr v3 Python API. Supports writing Zarr v2 and v3 stores, with Zarr v2 as the default.

closes #111

Checklist (strike out non-applicable):

  • Changes documented in CHANGES.md
  • Related issue exists and is referred to in the PR description and CHANGES.md
  • Added docstrings and API docs for any new/modified user-facing classes and functions
  • Changes/features documented in docs/*
  • Unit-tests adapted/added for changes/features
  • Test coverage remains or increases (target 100%)

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e9c8677) to head (507920d).

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #112      +/-   ##
===========================================
+ Coverage   99.92%   100.00%   +0.07%     
===========================================
  Files          30        30              
  Lines        1418      1467      +49     
===========================================
+ Hits         1417      1467      +50     
+ Misses          1         0       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@konstntokas
konstntokas marked this pull request as ready for review October 29, 2026 16:59
@konstntokas
konstntokas requested a review from forman October 29, 2026 17:05

@forman forman left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good!

However, I'd like to go for the following changes which would need also some documentation changes:

  • Make Zarr 3 the new default format, because it is the better format.
  • zarr_version should be deprecated, zarr_format be used instead to align with the API.
  • Require zarr_format setting in new configurations. If it is missing assume an old config that refers to the old default zarr_version=2 and so zarr_format=2. Emit a warning in this case.
  • shards setting should be ignored with a warning if it is not applicable.

EDIT

  • Require zarr_format=2|3 setting in new configurations and accept zarr_version=2 in old configurations. If either is missing, raise.

Comment thread docs/guide.md Outdated
desired and the variable's data array will be persisted as one block.

For Zarr v3, `shards` may additionally be configured for a variable. A shard
contains an integer number of regular chunks, reducing object counts while

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
contains an integer number of regular chunks, reducing object counts while
contains an integer number of regular chunks, reducing file or object counts while

Comment thread docs/guide.md Outdated
contains an integer number of regular chunks, reducing object counts while
retaining smaller read/write chunks. Each shard size must be at least its
corresponding chunk size and an exact multiple of it. Shards are not available
for Zarr v2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for Zarr v2.
for Zarr v2, hence the `shards` setting will be ignored.

Comment thread zappend/config/schema.py
@@ -603,7 +611,7 @@
"zarr_version": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecate zarr_version and introduce zarr_format (to align with Zarr API).

Comment thread zappend/config/schema.py Outdated
"description": "The Zarr version to be used.",
"const": DEFAULT_ZARR_VERSION,
"enum": [2, 3],
"default": DEFAULT_ZARR_VERSION,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"default": DEFAULT_ZARR_VERSION,
"default": DEFAULT_ZARR_FORMAT,

Comment thread zappend/config/schema.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DEFAULT_ZARR_FORMAT,

Comment thread zappend/processor.py Outdated
target_store: collections.abc.MutableMapping,
target_ds: xr.Dataset,
target_attrs: dict[str, Any],
zarr_version: int,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zarr_version: int,
zarr_format: int,

Comment thread CHANGES.md Outdated
@@ -1,5 +1,7 @@
## Version 0.8.1 (in development)

* Migrated to the Zarr v3 Python API. Supports writing Zarr v2 and v3 stores,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Migrated to the Zarr v3 Python API. Supports writing Zarr v2 and v3 stores,
* Migrated to use `zarr >=3`. Supports writing Zarr v2 and v3 stores,

Comment thread CHANGES.md Outdated
@@ -1,5 +1,7 @@
## Version 0.8.1 (in development)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Version 0.8.1 (in development)
## Version 0.9.0 (in development)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a major change of the implementation and a capability enhancement. This justifies a minor number increase.

Comment thread CHANGES.md Outdated
## Version 0.8.1 (in development)

* Migrated to the Zarr v3 Python API. Supports writing Zarr v2 and v3 stores,
with Zarr v2 as the default. (#111)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with Zarr v2 as the default. (#111)
with Zarr 3 as the new default format. (#111)

Comment thread README.md Outdated
Comment on lines +31 to +32
[Zarr format](https://zarr.readthedocs.io/en/stable/). Targets use Zarr v2 by
default and may opt into Zarr v3. If an error

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Zarr format](https://zarr.readthedocs.io/en/stable/). Targets use Zarr v2 by
default and may opt into Zarr v3. If an error
[Zarr format](https://zarr.readthedocs.io/en/stable/). Targets use Zarr 3 format by
default and may opt into Zarr 2 format, if needed. If an error

@konstntokas

Copy link
Copy Markdown
Collaborator Author
* `zarr_version` should be deprecated, `zarr_format` be used instead to align with the API.

Linking related issue: #107

@konstntokas
konstntokas force-pushed the konstntokas/migrate_zarr3 branch from 34577db to 242b875 Compare November 2, 2026 15:43
@konstntokas

Copy link
Copy Markdown
Collaborator Author

Closes #107

@konstntokas
konstntokas requested a review from forman November 3, 2026 08:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Zarr v3

2 participants