import dascore as dc
spool = dc.get_example_spool("random_das")
plan = spool.chunk_plan(time=3)
assert len(plan.outputs) == len(spool.chunk(time=3))
# See which sources contribute to the first output patch.
members = plan.members
first = members[members["output_id"] == 0]
# and why each piece starts, and how far the grid moved it
reasons = members[["reason", "shift", "dropped"]]chunk_plan
chunk_plan(
self ,
overlap: int | float | str | numpy.datetime64 | pandas.Timestamp | None[int, float, str, datetime64, Timestamp, None] = None,
keep_partial: bool = False,
snap_coords: Any = <object object at 0x75eb88f01e30>,
tolerance: float | pint.registry.Quantity | numpy.timedelta64 | None[float, Quantity, timedelta64, None] = None,
conflict: Literal[‘drop’, ‘raise’, ‘keep_first’] = raise,
group: str | collections.abc.Sequence[str, collections.abc.Sequence[str], None] = None,
on_missing_dim: Literal[‘raise’, ‘drop’] = raise,
max_shift: float | None[float, None] = None,
**kwargs ,
)
Return the plan chunk would execute, without touching any data.
The returned ChunkPlan is a read-only diagnostic: its outputs table describes each patch the chunked spool would contain (envelopes, step, carried attributes), its members table shows exactly which slice of which source patch feeds each output, and params records every resolved parameter (including the group attributes, sampling tolerance and max_shift in effect). Each member also says why it starts where it does (reason: “stretch” or “gap” where it opens a stretch of joined patches, “window” where a window starts inside it, “seam” or “tolerance” for the test which joined it to the piece before), how far fitting its stretch’s grid moved its labels (shift, in steps) and how many of its samples an earlier patch’s overlap dropped (dropped). Accepts the same arguments as chunk, so lengths only; explicit windows go to Spool.cut.