Skip to content

Better document acceptable values for StoreLike #3303

Closed

Description

@dstansby

In zarr.open, the current documentation for the store argument is:

Store or path to directory in file system or name of zip file.

It would be nice to make this more specific re. what strings are accepted, and give some examples of those strings. I think it's also possible to pass a "s3://..." fsspec string here, which isn't documented.

Activity

  1. d-v-b commented on Jul 28, 2025

    @d-v-b
    Contributor

    IMO we should asymptotically have an API that encourages the use of string URLs as much as possible. Where configuration cannot be easily expressed in a URL, we should use typeddicts like {"url": "myscheme://mypath", "anon": True}

  2. d-v-b commented on Jul 28, 2025

    @d-v-b
    Contributor

    A URL-centric API will not be possible for memory stores until we use a central registry for in-memory storage. See #2906

  3. dstansby commented on Aug 5, 2025

    @dstansby
    ContributorAuthor

    A good solution here would be a section in the user guide that lists all acceptable forms when store is passed as a string, which could then be referenced from the API docs.

  4. K-Meech commented on Aug 19, 2025

    @K-Meech
    Contributor

    I can look into adding further documentation for store string values 👍

  5. d-v-b commented on Aug 19, 2025

    @d-v-b
    Contributor

    @K-Meech that would be great! This will get even more interesting when #2943 lands

  6. K-Meech commented on Aug 20, 2025

    @K-Meech
    Contributor

    Looking into this some more, I think it's a wider issue than zarr.open alone. Many of the top level zarr functions use store (which is a zarr.storage.Storelike) as an argument, which is documented to various degrees in their docstrings For example:

    • zarr.open: Store or str, optional -Store or path to directory in file system or name of zip file.
    • zarr.create_group: Store or str - Store or path to directory in file system.
    • zarr.consolidate_metadata: StoreLike - The store-like object whose metadata you wish to consolidate.
    • zarr.open_group: Store, str, or mapping, optional - I won't copy the whole text here, but it documents e.g. dictionaries and None as additional options
      ...and more...

    All of these pass the store to zarr.storage._common.make_store_path, so should be able to handle all the different options listed there including:

    • Store
    • StorePath
    • Path
    • None
    • dict[str, Buffer]
    • str (either fsspec url or path)
    • FSMap

    Should I document these different options in the user guide under the implicit storage creation example? The example given there already uses an empty dict as input to zarr.create_group to implicitly create a MemoryStore (which is undocumented behaviour in the corresponding docstring). This could then be linked to from all public api functions that use StoreLike as input.

  7. dstansby commented on Sep 15, 2025

    @dstansby
    ContributorAuthor

    Should I document these different options in the user guide under the implicit storage creation example? The example given there already uses an empty dict as input to zarr.create_group to implicitly create a MemoryStore (which is undocumented behaviour in the corresponding docstring). This could then be linked to from all public api functions that use StoreLike as input.

    This sounds like a great plan to me - especially putting all the info in one place, and then linking to it from the docstrings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements to the documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions