build_chunk_plan

function of dascore.utils.chunk_plan source

build_chunk_plan(
    df: DataFrame ,
    overlap = None,
    keep_partial: bool = False,
    tolerance: float | pint.registry.Quantity | numpy.timedelta64 | dascore.utils.gaps.GapTolerance | None[float, Quantity, timedelta64, GapTolerance, None] = None,
    max_shift: float | None[float, None] = None,
    conflict: Literal[‘drop’, ‘raise’, ‘keep_first’] = raise,
    group = None,
    on_missing_dim: Literal[‘raise’, ‘drop’] = raise,
    fill_value = None,
    **kwargs ,
)-> ‘ChunkPlan’

Build a chunk plan from a flat patch relation.

Parameters mirror Spool.chunk (see the chunking formalities spec); one keyword names the dimension to chunk and its length (None/... merges). Patches join under the seam test (_cell_seams) and each stretch gets one grid (_fit_grids), which windows are cut from; fill_value, which only Spool.fill_gaps passes, instead fills the seams tolerance joins, keeping each source’s labels.

Windows follow each grid’s exact terms where df carries them, as the spool’s own relation does. A frame without them, hand-built or from Spool.get_contents (which rounds steps to whole nanoseconds), is planned on its rounded step and can drift on a fractional grid; use Spool.chunk for those.