Timenet.provenance
timenet.provenance ¶source
Read the git commit of the installed TimeNet code, for the manifest's build_env.git block.
EditableInstall
dataclass
¶source
Bases: InstallSource
An editable install (pip install -e, or a uv workspace member).
Python imports the code from the checkout itself, so git reports its commit and local changes.
GitInstall
dataclass
¶source
Bases: InstallSource
An install from a git URL (pip install git+https://...). Pip recorded the commit.
InstallSource
dataclass
¶source
Bases: ABC
Where one package was installed from: a git checkout, a git URL, or a wheel.
Each kind records its git provenance in a different place.
InstalledDistribution ¶source
One distribution that is installed in this interpreter.
name
property
¶source
name: PackageName
The package name that pip installs, for example timenet-connectors.
from_name
classmethod
¶source
from_name(name: PackageName) -> Self
Find an installed package by name, such as timenet.
Note: An extra like timenet[zarr] is not a name, and from_name would not find it.
Returns:
| Type | Description |
|---|---|
Self
|
The installed package. |
Raises:
| Type | Description |
|---|---|
PackageNotFoundError
|
If it is not installed. |
install_source ¶source
install_source() -> InstallSource
Return how this distribution was installed, which decides where its commit is recorded.
PackageSnapshot ¶source
Bases: Snapshot
The commit of one package that pip installed, such as timenet or timenet-connectors.
Note: Not a subpackage such as timenet.registry.
package_name
instance-attribute
¶source
package_name: PackageName
The name pip installs, for example timenet-connectors.
read
classmethod
¶source
read(package_name: PackageName) -> Self
Read the commit of an installed package. Raises TimeNetBuildError if it is not installed.
read_if_installed
classmethod
¶source
read_if_installed(package_name: PackageName) -> Self | None
Read the commit of a package, or return None if it is not installed.
to_source_map ¶source
to_source_map() -> GitSourceMap
Return this package's commit in the form that a manifest records.
Snapshot ¶source
TimeNetSnapshot ¶source
Bases: Snapshot
The commit of each installed TimeNet package, read at one point in time.
timenet_connectors
class-attribute
instance-attribute
¶source
timenet_connectors: PackageSnapshot | None = Field(
default=None, alias="timenet-connectors"
)
None if timenet-connectors is not installed.
from_source_map
classmethod
¶source
from_source_map(sources: GitSourceMap) -> Self
Return the typed view of the commits that a manifest records.
package_names
classmethod
¶source
package_names() -> tuple[PackageName, ...]
Return the name of each TimeNet package, in field order.
packages_with_local_changes ¶source
packages_with_local_changes() -> list[PackageSnapshot]
Return each installed TimeNet package whose code has local changes.
read
classmethod
¶source
read() -> Self
Read the commit of each installed TimeNet package. Raises TimeNetBuildError if one is unknown.
to_source_map ¶source
to_source_map() -> GitSourceMap
Return the commit of each installed TimeNet package.
WheelInstall
dataclass
¶source
Bases: InstallSource
An install from a wheel, including a path install that is not editable (pip builds a wheel first).
The installed code is a copy, so a checkout can differ from it. The wheel carries the git
provenance record baked into it at build time (_build_info.json).