Skip to content

datethyme.scheduling.types.TimePartition

This is the documentation page for the TimePartition class.

datethyme.scheduling.types.TimePartition

Bases: AbstractPartition[Time]

A contiguous sequence of TimeSpan objects or TimePartition objects (recursive), useful for scheduling.

intuitively

resolve_overlaps(seq, mode=EQUAL|PROPORTIONAL|INVERSE|ECLIPSE|SHIFT) resolve_gaps(seq, mode=EQUAL|PROPORTIONAL|INVERSE|SNAP_FORWARD|SNAP_BACK|SHIFT_FORWARD| SHIFT_BACK) squeeze(seq, mode=PROPORTIONAL|EQUAL, earliest=None, latest=None) stack(seq, mode=forward|middle|backward, anchor=None) truncate(seq, earliest: Time, latest: Time)

truncate_preserve -> return (before, truncated, after)

both can be procrustean or not

passes_day_boundary property

passes_day_boundary: bool

format_span staticmethod

format_span(span: SpanProtocol[Time] | PartitionProtocol[Time], indent: int = 0) -> str

from_times classmethod

from_times(times: Iterable[Time], names: Iterable[str | None] | None = None) -> PartitionProtocol[Time]