Skip to content

Writer

timenet.writer source

Serialization of a :class:~timenet.dataset.TimeFDataset to the TimeF on-disk format.

ProgressStage source

Bases: StrEnum

The writer's incremental stages. Only stages that carry information are emitted.

COMMIT class-attribute instance-attribute source

COMMIT = 'commit'

SHARD_FINALIZED class-attribute instance-attribute source

SHARD_FINALIZED = 'shard_finalized'

TIME_SERIES class-attribute instance-attribute source

TIME_SERIES = 'time_series'

TimeFWriter source

Context manager that serializes a dataset into the TimeF format and commits it atomically.

abort source

abort() -> None

Delete the staging directory. Safe to call more than once.

close source

close() -> None

Write the manifest and atomically publish the staging directory.

Raises:

Type Description
RuntimeError

If :meth:write has not run successfully.

write source

write() -> None

Serialize every artifact except the manifest into the staging directory.

Raises:

Type Description
TimeFValidationError

If the schema was not derived, a shared annotation id is not field-equal across samples, or a series array violates the per-series contract.

WriteProgressEvent dataclass source

A single progress event passed to the writer's progress_cb.

completed instance-attribute source

completed: int

Number of items finished in this stage so far.

message class-attribute instance-attribute source

message: str | None = None

Optional human-readable detail for the event.

stage instance-attribute source

The writer stage this event reports.

total instance-attribute source

total: int | None

Total number of items to process, or None if unknown.