Skip to content

eegprep-lean: let read_index take an explicit index URL #415

Closed

Description

@neuromechanist

read_index(dataset_id, *, transport=None) builds its request URL from the hardcoded
INDEX_URL_TEMPLATE ("https://zarr.nemar.org/{dataset_id}/zarr/index.json") in
packages/eegprep-lean/src/eegprep_lean/index.py. NEMAR's MCP server (nemarOrg/nemar-cli)
is about to hand out a browser recipe that leads with read_index and read_window, and
that server also runs dev and staging instances whose datasets live under a different
contract base. A recipe has to be able to name the index URL for the environment that
served it, since it cannot assume production's zarr.nemar.org.

Per the published index contract (docs.nemar.org/platform/zarr/index-contract), a
dataset's index document lives at its own contract_base + index.json, and contract_base
is the only URL a client may hardcode; it is read from the document itself, not derived
from the request URL.

Proposed: add a keyword-only index_url: str | None = None to read_index. When given,
fetch that URL instead of the template; format_version is still checked first,
contract_base still comes from the document, and errors still name the URL actually
fetched. None keeps today's behavior unchanged.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions