Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #904 +/- ##
===========================================
- Coverage 99.90% 99.88% -0.03%
===========================================
Files 70 70
Lines 8735 8735
Branches 1149 1149
===========================================
- Hits 8727 8725 -2
- Misses 3 5 +2
Partials 5 5 ☔ View full report in Codecov by Sentry. |
|
Zarr v3 is not compatible with tifffile cgohlke/tifffile#282 czbiohub-sf/iohub#292 |
|
Zarr 3 is supported by tifffile. However, zarr 3 only supports Python 3.11+. |
|
@aacic Current implementation of tiatoolbox/tiatoolbox/wsicore/wsireader.py Lines 4392 to 4459 in 750ca02 |
Please give me some time to look into this. I'll try to look at this next week. I don't know it from the top of my head. |
|
All the errors have been fixed except |
The updates to engines output breaks, |
@shaneahmed I was able to make it work locally. I need some more time to verify the solution, and I'll try to submit a PR sometime next week. I'll keep you posted. |
Thank you @aacic That would be wonderful. |
# Conflicts: # requirements/requirements.txt
@measty Please would you be able to check the error with |
* Zarr 3 fix. * Fix multilayer image `FsspecJsonWSIReader` support.
JiwaniZakir
left a comment
There was a problem hiding this comment.
The padding-removal logic added in assert_annotation_store_patch_output and assert_qupath_json_patch_output uses np.iinfo(contours.dtype).min as the sentinel value, but np.iinfo only accepts integer dtypes — if contours.dtype is ever a float (e.g., float32 or float64), this will raise a ValueError at runtime. A safer approach would be to guard with np.iinfo only when np.issubdtype(contours.dtype, np.integer) and fall back to np.finfo or a different sentinel otherwise.
The pervasive switch from integer to string keys (e.g., output_zarr["x"][0] → output_zarr["x"]["0"] in test_nucleus_detection_engine.py and the str(i) conversion in assert_output_lengths) reflects a real zarr v3 API change, but it's worth verifying this pattern is consistently applied in the production code paths as well — the tests only cover the assertion helpers, and any production code that still uses integer indexing into zarr groups would silently fail or return wrong results.
The switch from output_.items() to output_.members() in test_semantic_segmentor.py is correct for zarr v3, but the truncated diff makes it unclear whether similar items() calls in production code (not just tests) have been updated — a quick grep for .items() on zarr group objects in the main source would be worth confirming.
Fixes the error related to zarr.errors.FSPathExistNotDir
It doesnt exist anymore since zarr v3.0.0, which instead just raises a standard FileNotFoundError
rather than checking for different error types in different versions of zarr, i've just removed the check for specific error type in favour of any errors
There are some other changes which we need to deal with from 3.0 also, as it has removed or changed zarr.LRUStoreCache, zarr.DirectoryStore, and zarr.SQLiteStore all of which tiatoolbox uses
We would also need to wait for tifffile to update to be compatible with zarr 3.0
See: https://zarr.readthedocs.io/en/latest/user-guide/v3_migration.html for more details
Zarr >=3.08,tifffile>=2025.5.21object_codecin dask.to_zarrzarr.core.Arraytozarr.Arraycanvas_zarr.store.pathtocanvas_zarr.store.rootzarr.DirectoryStoretozarr.storage.LocalStorezarr.resizeoutput.items()withoutput.members()ngff.sqlitestoreaszarr.SQLiteStoreis no longer supported.key / iis replaced bykey / str(i)