hyrax.datasets.result_factories#

Factory functions for creating result dataset writers and readers.

These factories handle the selection between Lance and .npy formats.

Attributes#

Functions#

create_results_writer(result_dir)

Create a writer for results (Lance format).

load_results_dataset(config[, results_dir, verb])

Load a results dataset, auto-detecting format.

Module Contents#

logger[source]#
LANCE_DB_DIR = 'lance_db'[source]#
create_results_writer(result_dir: str | pathlib.Path)[source]#

Create a writer for results (Lance format).

This factory creates a ResultDatasetWriter for writing inference results to Lance format. New writes always use Lance format going forward.

Parameters:

result_dir (Union[str, Path]) – Directory where results should be saved

Returns:

Writer instance for Lance storage

Return type:

ResultDatasetWriter

load_results_dataset(config: dict, results_dir: pathlib.Path | str | None = None, verb: str | None = None)[source]#

Load a results dataset, auto-detecting format.

This factory auto-detects whether the results are in Lance or .npy format and returns the appropriate dataset class.

Parameters:
  • config (dict) – The hyrax config dictionary

  • results_dir (Union[Path, str, None], optional) – The results subdirectory to load from

  • verb (Union[str, None], optional) – The name of the verb that generated the results (for auto-discovery)

Returns:

The appropriate dataset instance based on detected format

Return type:

Union[ResultDataset, InferenceDataset]