Skip to content

Deprecate / remove support for n5 attribute mapping "gimmick" #77

Description

@bogovicj

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:

  1. There exist other was to get the same information that are more reliable and more easily maintained. (see additional details below)
  2. It adds substantial maintenance burden without a clear (to me) purpose.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions