Commit 9d5abca
⬆️ Upgrade Zarr to v3+ Compatibility (#904)
## ✅ Summary
- Enables compatibility with Zarr v3+
- Simplifies error handling across Zarr versions
- Removes deprecated storage backends and APIs
- Lays groundwork for full Zarr v3 migration
This PR updates TIAToolbox to support **Zarr v3+**, addressing breaking changes introduced in Zarr ≥ 3.0 and aligning internal APIs, storage handling, and error handling accordingly.
---
Zarr v3 removed `zarr.errors.FSPathExistNotDir`. In Zarr ≥ 3.0, equivalent failure modes now raise standard Python exceptions (e.g. `FileNotFoundError`).
To avoid fragile version-specific logic:
- Removed checks for specific Zarr exception types
- Replaced them with generic exception handling that works consistently across Zarr versions
---
## 🔧 Key changes
### Dependency updates
- 🆙 Upgrade to:
- `zarr >= 3.0.8`
- `tifffile >= 2025.5.21`
### Zarr API & storage migration
- Refactor `zarr.core.Array` → `zarr.Array`
- Replace `zarr.DirectoryStore` with `zarr.storage.LocalStore`
- Remove `ngff.sqlitestore` (Zarr v3 no longer supports `zarr.SQLiteStore`)
- Replace `canvas_zarr.store.path` with `canvas_zarr.store.root`
- Ensure Zarr paths explicitly use string keys (`key / str(i)` instead of `key / i`)
### Dask & array handling
- Remove unsupported `object_codec` usage in `dask.to_zarr`
- Update `zarr.resize` calls to use tuple inputs
- Replace `output.items()` with `output.members()`
---
## 1 parent 3ca1599 commit 9d5abca
26 files changed
Lines changed: 856 additions & 283 deletions
File tree
- .github/workflows
- requirements
- tests
- engines
- models
- tiatoolbox
- models
- architecture
- engine
- tools
- utils
- wsicore
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
0 commit comments