Window

class of dascore.lazy.contract
inherits from: ChunkContract
source

Window(
    index: tuple[<class ’slice, …] ,
)-> None

The output is a window of the input: a slice with a step of one per axis.

Nothing is computed. An output chunk is the input chunk moved by where the window starts, so what is read is only what the window keeps.

Parameters

Parameter Description
index The slice of each axis the window keeps, as given to the array.

Examples

from dascore.lazy.contract import Window
window = Window((slice(5, None), slice(None)))
box = (slice(0, 10), slice(0, 3))
assert window.needs(box, (100, 3)) == (slice(5, 15), slice(0, 3))

Methods

Name Description
apply Return the input, which is already the window’s samples.
needs Return the box moved to where the window puts it in the input.