Reader
timenet.reader ¶source
Deserialization of a TimeF version directory into a :class:~timenet.dataset.TimeFDataset.
TimeFReader ¶source
Reads a committed TimeF version directory. Use as a context manager to close shard handles.
schema
property
¶source
schema: DatasetSchema
The dataset's type declaration, reconstructed from the manifest.
values_backend
property
¶source
values_backend: str
The manifest's values-plane backend tag ("parquet" or "zarr").
close ¶source
Close the values backend and the control-table handles, releasing their decoded caches.
iter_records ¶source
iter_records(
record_ids: Iterable[str] | None = None,
*,
with_annotations: bool = True,
) -> Iterator[Record]
Yield records lazily without materializing a :class:TimeFDataset.
When you pass record_ids, this method filters the read on the stored id column. This
prunes the row groups that cannot hold a requested id, and it does not scan the whole file.
Records come back in stored order (sorted by record_id), not in the order you asked for
them. An id that the dataset does not contain raises TimeFValidationError.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record_ids
|
Iterable[str] | None
|
The records to yield, or |
None
|
with_annotations
|
bool
|
Whether to resolve the annotations of each record. |
True
|
Yields:
| Type | Description |
|---|---|
Record
|
Each reconstructed :class: |
read ¶source
read() -> TimeFDataset
Materialize the full dataset.
Returns:
| Name | Type | Description |
|---|---|---|
A |
TimeFDataset
|
class: |
verify ¶source
Check every file the manifest lists against its recorded sha256: checksum.
This method does not run automatically when you open a version. It reads and hashes every shard, so it reads the whole dataset. The lazy read design of this class avoids that cost on open.
When integrity matters more than speed, call this method explicitly. Examples are after a
download, before a long training run, or inside a fsck-style command. This method reopens
each file through the version's filesystem. As a result, a missing file now surfaces here,
because __init__ no longer stat-sweeps the files.
Raises:
| Type | Description |
|---|---|
TimeFFormatError
|
If a listed file is missing, or its contents do not match the manifest. |