Skip to content

Clarify Store Interface #638

Closed
Closed
@Carreau

Description

@Carreau

prompted by this discussion

The current Store (in the sens of Zarr Python implementation) interface is ill-defined, in particular dict() seem to be special cased in many area:

  • tests: many test use dict, while assuming the behavior we see will be true for all stores.
  • it is said that a Zarr Store is anything exposing the MutableMapping, though MutableMapping have the property that: mm[key] = x ; y = mm[key]; assert x == y which is currently untrue, as many stores are responsible from encoding/ensuring bytes.
  • class that would behave like dict/MutableMapping but not be subclass of dict would fail some tests, and return non-bytes in __getitems__.

Personally I believe that currently trying to say that stores are MutableMapping and dict is an acceptable store is the exception to the rule; proof being that there is a MemoryStore.

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