fix: update OME-Zarr unit handling to match spec#907
fix: update OME-Zarr unit handling to match spec#907omdowley wants to merge 3 commits intogoogle:masterfrom
Conversation
As discussed in google#780, the OME-Zarr v0.5 spec specifies that the units SHOULD be one of those that are currently allowed, not MUST. This instead treats unsupported units as unitless and warns.
|
I'm wondering if this should be visible in the UI as either a temporary status message or ideally as a message exactly where the error message currently shows but still allow creating the layer |
|
Yes, I'd agree, we just need to add a mechanism for data sources to propagate warnings --- probably by passing in a |
The OME Zarr spec specifies the lists of units from which valid units SHOULD come separately for `time` and `space` axes. This enforces that (with a warning).
This definitely makes a lot more sense than what I initially did.
I've done this -- it ended up a bit messy because by default the warnings were removed pretty immediately by the refCounted disposer, so I had to persist them. Again there may be a neater way to do that, it just felt like it'd require bigger changes, open to feedback I've also added logic checking the axis type and unit type make sense, and warning if there is either an axis type mismatch or if the axis type isn't one defined in the spec (both of these are SHOULD items in the spec) |
As discussed in #780, the relevant part of the OME Zarr v0.5 spec specifies that the units SHOULD be one of those that are currently allowed, not that they MUST be (which is what is currently enforced). This instead of erroring treats unsupported units as unitless and warns.
It seems possible to me that there are smarter things to do than this, but thought I'd get the ball rolling with it, because it feels like the absolute minimal change such that we're actually meeting the spec.