Skip to content

Timenet.errors

timenet.errors source

TimeNet's exception hierarchy, and the warnings it raises.

Every TimeNet-raised error derives from :class:TimeNetError. TimeF validation errors also derive from :class:ValueError, so existing except ValueError handlers keep working. TimeNet raises the builtin FileNotFoundError and FileExistsError directly for user-supplied paths.

Every TimeNet-raised warning derives from :class:TimeNetWarning.

Some errors carry facts as attributes and leave the remedy to the front end that called the lower layer: the CLI names its flags, the SDK names its keywords. A front end sets hint to one or two full sentences and raises the error again. str() adds the hint after the message as its own sentence.

CatalogWarning source

Bases: TimeNetWarning

A dataset listing skips a source without a catalog.

ConnectorCardWarning source

Bases: TimeNetWarning

A dataset listing skips a dataset with an unreadable connector card.

FormatVersionSubject source

Bases: Enum

A versioned part of a stored TimeF release. The value names it in error messages.

CONTROL_SCHEMA class-attribute instance-attribute source

CONTROL_SCHEMA = 'control schema'

The schema of control.duckdb, given by the schema_version key of control_metadata.

TIMEF_FORMAT class-attribute instance-attribute source

TIMEF_FORMAT = 'TimeF format'

The format of manifest.json, given by its timef_format_version.

ReleaseDifference source

Bases: Enum

What differs between two manifests of the same release.

CARD class-attribute instance-attribute source

CARD = auto()

The file records are the same, and the rest of the manifest differs.

FILES class-attribute instance-attribute source

FILES = auto()

The file records differ.

SpanOutsideWindowWarning source

Bases: TimeNetWarning

An annotation's span falls outside the window of the series it names, and is kept.

TimeFEditError source

Bases: TimeFValidationError

An edit would leave a dataset referentially inconsistent (for example, a dangling reference).

hint class-attribute instance-attribute source

hint: str | None = None

TimeFFormatError source

Bases: TimeNetError

An on-disk TimeF artifact is corrupt or uses an unsupported format version.

hint class-attribute instance-attribute source

hint: str | None = None

TimeFFormatVersionError source

Bases: TimeFFormatError

A stored TimeF artifact has a format version that this TimeNet does not read.

Attributes:

Name Type Description
subject

The versioned part of the release.

where

The file of the artifact, or a description of where a registry keeps it.

found

The version that the artifact records, older than oldest_readable or newer than newest_readable.

oldest_readable

The oldest version that this TimeNet reads.

newest_readable

The newest version that this TimeNet reads.

path

The file of the artifact, or None for an artifact that a registry served.

found instance-attribute source

found = found

hint class-attribute instance-attribute source

hint: str | None = None

newest_readable instance-attribute source

newest_readable = newest_readable

oldest_readable instance-attribute source

oldest_readable = oldest_readable

path instance-attribute source

path = path

subject instance-attribute source

subject = subject

where instance-attribute source

where = where

TimeFNotFoundError source

Bases: TimeFValidationError, LookupError

An ID, parent alias, or parent release names nothing in the dataset, or the stored object has another kind.

hint class-attribute instance-attribute source

hint: str | None = None

TimeFNullValuesError source

Bases: TimeFValidationError

Values contain nulls where the requested form, such as a NumPy array, cannot hold them.

hint class-attribute instance-attribute source

hint: str | None = None

TimeFReaderError source

Bases: TimeNetError

A reader could not complete a read, e.g. its connection was closed while the read ran.

hint class-attribute instance-attribute source

hint: str | None = None

TimeFValidationError source

Bases: TimeNetError, ValueError

A dataset or its arrays violate a TimeF invariant (raised while building or writing).

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetAccessError source

Bases: TimeNetError

A dataset needs credentialed or restricted access, so only the user's own registry may hold its data.

Attributes:

Name Type Description
dataset

The release.

access

Its effective access level: the strictest level of its card and of the cards in its lineage. See :func:~timenet.types.access.effective_access.

requirements

Each card, of the release itself or of an ancestor, whose access is not open, with its access level and its access_url. A user needs access at each of them. See :func:~timenet.types.access.access_requirements.

access instance-attribute source

access = access

dataset instance-attribute source

dataset = dataset

hint class-attribute instance-attribute source

hint: str | None = None

requirements instance-attribute source

requirements = requirements

TimeNetBuildError source

Bases: TimeNetError

A build run failed: the connector build, or the environment it needed.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetConnectorError source

Bases: TimeNetError

A connector found that one of its assumptions does not hold.

Connector code raises this error. For example, the source data has an unknown code, a download lacks a file, or a parent lacks a value that the connector needs. The message says where, such as the file and the row. TimeNet's own checks raise their own errors.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetDatasetNotFoundError source

Bases: TimeNetError

A requested dataset id or version is not present in a registry or on disk.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetDownloadError source

Bases: TimeNetConnectorError

TimeNet could not fetch a dataset's source data.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetError source

Bases: Exception

Base class for all TimeNet errors.

String conversion appends hint to the error message.

Attributes:

Name Type Description
hint str | None

A suggested way to resolve the error, or None.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetFileError source

Bases: TimeFFormatError

A release file is missing or differs from its manifest record.

A local copy is checked by file size. A transfer is checked by size and checksum.

Attributes:

Name Type Description
release

The release that the file belongs to.

owner

The release, payload source, or transfer that the file belongs to, as text.

path

The relative file path, using the first missing or resized file in manifest order for local checks.

expected

What the manifest records, for example "1,024 bytes" or "sha256:<hex>".

actual

What the file holds, in the same form, or None if the file is missing.

actual instance-attribute source

actual = actual

expected instance-attribute source

expected = expected

hint class-attribute instance-attribute source

hint: str | None = None

owner instance-attribute source

owner = owner

path instance-attribute source

path = path

release instance-attribute source

release = release

TimeNetInvalidCardError source

Bases: TimeNetError, ValueError

A dataset card YAML is malformed or fails schema validation (raised while building).

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetIsolationError source

Bases: TimeNetBuildError

An isolated build cannot make its environment.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetManifestError source

Bases: TimeFFormatError

A stored manifest is not a valid manifest.

Attributes:

Name Type Description
where

The file of the manifest, or a description of where a registry keeps it.

detail

The first problem that the parser found.

path

The file of the manifest, or None for a manifest that a registry served.

detail instance-attribute source

detail = detail

hint class-attribute instance-attribute source

hint: str | None = None

path instance-attribute source

path = path

where instance-attribute source

where = where

TimeNetMissingParentError source

Bases: TimeNetDatasetNotFoundError

A required parent release or payload source is missing.

Attributes:

Name Type Description
missing

The absent release.

needed_by

The release that needs it.

payload_source

True if needed_by reads files of missing, False for a declared build parent.

searched

The search location.

hint class-attribute instance-attribute source

hint: str | None = None

missing instance-attribute source

missing = missing

needed_by instance-attribute source

needed_by = needed_by

payload_source instance-attribute source

payload_source = payload_source

searched instance-attribute source

searched = searched

TimeNetNoCatalogError source

Bases: TimeNetRegistryError

No source of a dataset listing has a catalog.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetNotBuiltError source

Bases: TimeNetDatasetNotFoundError

Only an installed connector provides a release, so it has no manifest yet.

Build the release to create its manifest, or read the connector's card for metadata.

Attributes:

Name Type Description
release

The unbuilt release.

card

The connector's card of the release.

card instance-attribute source

card = card

hint class-attribute instance-attribute source

hint: str | None = None

release instance-attribute source

release = release

TimeNetOriginError source

Bases: TimeFFormatError

The provenance record of a release in the local registry is not valid.

Attributes:

Name Type Description
release

The release of the record.

path

The file of the record.

detail

The first problem that the parser found.

detail instance-attribute source

detail = detail

hint class-attribute instance-attribute source

hint: str | None = None

path instance-attribute source

path = path

release instance-attribute source

release = release

TimeNetRegistryError source

Bases: TimeNetError

TimeNet could not load or reach a registry, or the registry could not serve a request.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetUnreachableError source

Bases: TimeNetRegistryError

A request to a registry or its storage failed on the network.

hint class-attribute instance-attribute source

hint: str | None = None

TimeNetVersionConflictError source

Bases: TimeNetError

A registry already holds a release with other files or another card than the copy.

A changed release needs a new version.

Attributes:

Name Type Description
release

The release that differs.

registry

The destination registry, as text.

registry_location

The location of the destination registry.

source

The source registry, as text.

difference

What differs.

needed_by

The requested release that needs this payload source, or None if release is the request.

difference instance-attribute source

difference = difference

hint class-attribute instance-attribute source

hint: str | None = None

needed_by instance-attribute source

needed_by = needed_by

registry instance-attribute source

registry = registry

registry_location instance-attribute source

registry_location = registry_location

release instance-attribute source

release = release

source instance-attribute source

source = source

TimeNetVersionUnavailableError source

Bases: TimeNetDatasetNotFoundError, TimeFValidationError

The installed connector cannot build the requested dataset version.

Attributes:

Name Type Description
release

The requested release.

declared

The version that the connector builds.

declared instance-attribute source

declared = declared

hint class-attribute instance-attribute source

hint: str | None = None

release instance-attribute source

release = release

TimeNetWarning source

Bases: UserWarning

Base class for all TimeNet warnings.