Skip to content

Zarr v3#154

Merged
HelenaLC merged 19 commits into
mainfrom
zarr_v3
Apr 11, 2026
Merged

Zarr v3#154
HelenaLC merged 19 commits into
mainfrom
zarr_v3

Conversation

@HelenaLC
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SpatialData’s Zarr attribute handling to support Zarr v3 layout differences (notably multiscales under ome), and reorganizes the test suite to cover both v2/v3 fixtures.

Changes:

  • Added a version-aware multiscales() accessor and updated coordinate-transform utilities to use it.
  • Updated image channel extraction and SpatialData reading logic for v3-compatible metadata/layout.
  • Reorganized and expanded unit tests (new CT utils/graph tests, new read tests, reduced zattrs tests).

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/testthat/test-zattrs.R Reworked zattrs tests to run against both v1 and v3 fixtures; added multiscales/channels checks
tests/testthat/test-read.R Added tests for read*() element readers and readSpatialData() layer selection behavior
tests/testthat/test-PointFrame.R Adjusted filter error test
tests/testthat/test-ctutils.R Moved/added coordinate-transformation utility tests
tests/testthat/test-ctgraph.R Added tests for CT graph/path/plot helpers
R/Zattrs.R Added internal version-aware multiscales method (list-backed)
R/validity.R Tweaked validity checks; removed label .zattrs validation from SpatialData validity
R/utils.R Adjusted centroids(LabelArray) coordinate handling
R/read.R Changed element discovery from list.files() to list.dirs()
R/ImageArray.R Made channels(Zattrs) version-aware; refactored multiscales dataset path checks
R/CTutils.R Updated axes/CT helpers to use multiscales() accessor; docs rename
R/AllGenerics.R Added multiscales generic; reordered some generics
NAMESPACE Added imports for SpatialExperiment/anndataR
man/CTutils.Rd Updated generated Rd to match CTutils rename
inst/NEWS Added 0.99.29 release notes mentioning v3 work and new fixture
DESCRIPTION Bumped version to 0.99.29
.gitignore Added ignore rule for R/_*

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/testthat/test-zattrs.R
Comment thread tests/testthat/test-zattrs.R
Comment thread R/read.R
Comment thread R/ImageArray.R
Comment thread R/validity.R
Comment thread inst/NEWS Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 41 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

R/CTutils.R:148

  • rmvCT() is now used alongside version-aware CTlist()/axes() (via multiscales()), but this method still mutates x$multiscales / top-level x$coordinateTransformations. For Zarr v3, coordinate transformations live under x$ome$multiscales[[1]]$coordinateTransformations, so rmvCT() won’t actually affect what CTlist() returns. Update the mutation path to follow the version-specific layout.
    R/CTutils.R:201
  • Same issue as rmvCT(): addCT() currently writes to x$multiscales[[1]]$coordinateTransformations (or top-level) but Zarr v3 stores this under x$ome$multiscales[[1]]$coordinateTransformations. As a result, adding a CT on v3 metadata won’t be reflected in CTlist()/CTname(). Make the write-back logic version-aware (e.g., branch on spatialdata_attrs$version).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/utils.R
Comment thread tests/testthat/test-ctutils.R
Comment thread R/Zattrs.R
@HelenaLC HelenaLC merged commit 5f000c7 into main Apr 11, 2026
2 checks passed
@HelenaLC HelenaLC deleted the zarr_v3 branch April 24, 2026 13:46
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.

2 participants