RuntimeCorpus#

class scikitplot.corpus.RuntimeCorpus(plan, pipeline, storage=None, index_config=None, retrieval_config=None, export_format=None, policy=<factory>, _owns_storage=False)[source]#

Materialized operational view of a validated CorpusPlan.

The runtime delegates content processing to CorpusPipeline, persistence to StorageBase, dense/sparse search to RetrievalIndex, and serialization to export_documents. It owns orchestration and lifecycle only.

Parameters:
add(source)[source]#

Process additional source(s), then rebuild one coherent index generation.

Parameters:

source (Any)

Return type:

Any

close()[source]#

Release runtime-owned resources. Safe to call more than once.

Return type:

None

property closed: bool#

Whether close has been called.

property documents: tuple[Any, ...]#

Documents committed to this runtime generation.

export(output_path, *, format=None, **kwargs)[source]#

Export the currently committed documents using the plan’s export format.

Parameters:
Return type:

Path

export_format: Any = None#
property index: Any#

Built RetrievalIndex, or None before a successful run.

index_config: Any = None#
property index_generation: Any#

Current retrieval-index generation, or None when no index exists.

pipeline: Any[source]#
plan: CorpusPlan[source]#
property plan_fingerprint: str#

Fingerprint of the immutable plan that produced this runtime.

policy: RuntimePolicy[source]#
query_storage(query)[source]#

Query the configured storage backend.

Parameters:

query (Any)

Return type:

Any

retrieval_config: Any = None#
run(source=None)[source]#

Process the plan source and commit storage/index state once.

Use add for subsequent sources. Requiring an explicit add avoids a second run silently mixing new data with storage/index state left by the first generation.

Parameters:

source (Any)

Return type:

Any

search(query, *, config=None)[source]#

Search the current runtime index using the configured retrieval policy.

Parameters:
Return type:

Any

storage: Any = None#