IndexGeneration#

class scikitplot.corpus.IndexGeneration(schema_version, embedding_manifest_id, document_digest, backend)[source]#

Identity of one built index.

Parameters:
schema_versionstr

Document serialisation generation.

embedding_manifest_idstr or None

Fingerprint of the embedding generation, or None for an index with no vectors.

document_digeststr

Digest of the published rows: each row’s identity and content, in the order written. Not a set digest – order and content are what the sidecar records, so both belong to the identity.

backendstr or None

Name of the index backend, or None when no dense index was built.

Parameters:
  • schema_version (str)

  • embedding_manifest_id (str | None)

  • document_digest (str)

  • backend (str | None)

Examples

>>> a = IndexGeneration("2.0", None, "2-abc", "bruteforce")
>>> b = IndexGeneration("2.0", None, "2-abc", "bruteforce")
>>> a == b and a.fingerprint == b.fingerprint
True
backend: str | None[source]#
property document_count: int#

Number of documents indexed, read from the digest prefix.

document_digest: str[source]#
embedding_manifest_id: str | None[source]#
property fingerprint: str#

Stable content-derived identifier, 16 hex characters.

classmethod from_dict(data)[source]#

Rebuild from to_dict output.

Raises:
ValueError

If a declared fingerprint disagrees with the fields supplied, which means the payload was altered.

Parameters:

data (dict[str, Any])

Return type:

IndexGeneration

matches(other)[source]#

Whether other describes the same index.

Parameters:

other (IndexGeneration | None)

Return type:

bool

schema_version: str[source]#
to_dict()[source]#

Return a JSON-compatible mapping including the fingerprint.

Return type:

dict[str, Any]