chunk_plan

method of dascore.core.spool.Spool source

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: bool = True,
    tolerance: float = 1.5,
    conflict: Literal[‘drop’, ‘raise’, ‘keep_first’] = raise,
    group: str | collections.abc.Sequence[str, collections.abc.Sequence[str], None] = None,
    missing_dim: Literal[‘raise’, ‘drop’] = raise,
    **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 and sampling tolerance in effect). Accepts the same arguments as chunk.

Examples

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]