hyrax.datasets.result_factories
===============================

.. py:module:: hyrax.datasets.result_factories

.. autoapi-nested-parse::

   Factory functions for creating result dataset writers and readers.

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



Attributes
----------

.. autoapisummary::

   hyrax.datasets.result_factories.logger
   hyrax.datasets.result_factories.LANCE_DB_DIR


Functions
---------

.. autoapisummary::

   hyrax.datasets.result_factories.create_results_writer
   hyrax.datasets.result_factories.load_results_dataset


Module Contents
---------------

.. py:data:: logger

.. py:data:: LANCE_DB_DIR
   :value: 'lance_db'


.. py:function:: create_results_writer(result_dir: Union[str, pathlib.Path])

   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.

   :param result_dir: Directory where results should be saved
   :type result_dir: Union[str, Path]

   :returns: Writer instance for Lance storage
   :rtype: ResultDatasetWriter


.. py:function:: load_results_dataset(config: dict, results_dir: Union[pathlib.Path, str, None] = None, verb: Union[str, None] = None)

   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.

   :param config: The hyrax config dictionary
   :type config: dict
   :param results_dir: The results subdirectory to load from
   :type results_dir: Union[Path, str, None], optional
   :param verb: The name of the verb that generated the results (for auto-discovery)
   :type verb: Union[str, None], optional

   :returns: The appropriate dataset instance based on detected format
   :rtype: Union[ResultDataset, InferenceDataset]


