windows_to_slices

function of dascore.io.utils source

windows_to_slices(
    windows: collections.abc.Mapping[str, Any] ,
    dims: collections.abc.Sequence[str] ,
    shape: collections.abc.Sequence[int] ,
)-> ‘tuple[slice, …]’

Turn FiberIO.read_array windows into one slice per dimension.

Each window is validated as Patch.select validates samples=True values and resolved against its dimension’s length, so every slice comes back with explicit non-negative bounds and start <= stop (a reversed window is empty); a dimension without a window is taken whole.

Parameters

Parameter Description
windows Dimension name to (start, stop) half-open sample indices.
dims The dimensions in the array’s stored order.
shape The array’s shape, in the same order.