Sub-task of #479. Read side, zarr backend — easy, mirror of the write-side zarr task. Covers parts ① + ② of the read-side analysis (issuecomment-5166383239).
Goal
Let zarr/reader.py::init_datasetdict_from_disk read from any fsspec URL, not just local disk.
Current state (verified on main)
zarr.open(zarr.storage.LocalStore(local_path / sn), mode="r")
Two hardcoded-local spots in the same function:
- Store — pinned to
LocalStore. zarr.open() accepts an fsspec URL directly in read mode (checked: zarr.open("memory://…", mode="r") round-trips), so this is just selecting the store from the path/storage_options.
- ⚠️ Trap:
LocalStore("s3://…") does not raise — it treats the string as a literal local path and reads the wrong place. This is a correctness fix, not an exception to guard.
- Split discovery —
local_path.iterdir() (is_dir() filtering) is local-only; on a remote target it must go through fs.ls(...) on the fsspec filesystem derived from the URL.
Scope
- Select the store from the URL/
storage_options.
- Replace
iterdir() split discovery with fsspec fs.ls(...).
Tests
- Round-trip on
memory:// (write via the zarr writer, read back via init_from_disk).
Priority
★ (2/5) — small, high value, testable on memory://; symmetric with the write-side zarr task.
Sub-task of #479. Read side,
zarrbackend — easy, mirror of the write-side zarr task. Covers parts ① + ② of the read-side analysis (issuecomment-5166383239).Goal
Let
zarr/reader.py::init_datasetdict_from_diskread from any fsspec URL, not just local disk.Current state (verified on
main)Two hardcoded-local spots in the same function:
LocalStore.zarr.open()accepts an fsspec URL directly in read mode (checked:zarr.open("memory://…", mode="r")round-trips), so this is just selecting the store from the path/storage_options.LocalStore("s3://…")does not raise — it treats the string as a literal local path and reads the wrong place. This is a correctness fix, not an exception to guard.local_path.iterdir()(is_dir()filtering) is local-only; on a remote target it must go throughfs.ls(...)on the fsspec filesystem derived from the URL.Scope
storage_options.iterdir()split discovery with fsspecfs.ls(...).Tests
memory://(write via the zarr writer, read back viainit_from_disk).Priority
★ (2/5) — small, high value, testable on
memory://; symmetric with the write-side zarr task.