with_runs

function of dascore.utils.chunk_plan source

with_runs(
    df: DataFrame ,
    dim: str ,
    indexed ,
    read ,
    modified = False,
)

The relation with each row cut into the stretches its coordinate’s runs leave.

indexed maps a _patch_row to the runs its index states (an IndexedRuns), and read returns a row’s coordinate where the index stored it without them. Each stretch contiguous_runs joins is the row with the stretch’s envelope and step, clipped to the row’s own envelope, so a selection trims it; a row none of whose stretches survive the clip lies in a hole and is dropped. modified marks the stretches to load as selections of their patch, and coalesce_runs reads the stretches landing in one output back as one member.