We should seriously consider deprecating or removing support for the n5-attribute-mapping "gimmick" .
For example that
n5.getAttribute(dataset, "dimension", long[].class);
returns the zarr's shape attribute, when n5 points to a zarr dataset.
Reasons:
- There exist other was to get the same information that are more reliable and more easily maintained. (see additional details below)
- It adds substantial maintenance burden without a clear (to me) purpose.
- It is unclear how it should behave in the future as zarr changes ( for example, zarr 3 discussed briefly here)
Reason 1
There exist other ways to get the information provided by this feature.
For example, the "dimensions" example above is equivalent to:
n5.getDatasetAttributes(dataset).getDimensions();
and should be preferred to the method above.
It will be more reliable for example, if and when there is a clash with the mapped attribute name (say, if `"dimensions" appears in .zattrs).
Further, removing "official" support does not prevent implementations from doing this themselves if they choose to.
Implementations can check if an N5Reader is a ZarrReader and getAttribute for "shape". Alternatively, an implementation
could use metadata translation to virtually add those attributes if desired.
@axtimwalde
@tpietzsch
@cmhulbert
We should seriously consider deprecating or removing support for the n5-attribute-mapping "gimmick" .
For example that
returns the zarr's
shapeattribute, whenn5points to a zarr dataset.Reasons:
Reason 1
There exist other ways to get the information provided by this feature.
For example, the
"dimensions"example above is equivalent to:and should be preferred to the method above.
It will be more reliable for example, if and when there is a clash with the mapped attribute name (say, if `"dimensions" appears in .zattrs).
Further, removing "official" support does not prevent implementations from doing this themselves if they choose to.
Implementations can check if an N5Reader is a ZarrReader and
getAttributefor"shape". Alternatively, an implementationcould use metadata translation to virtually add those attributes if desired.
@axtimwalde
@tpietzsch
@cmhulbert