piel.experimental.measurements.experiment
=========================================

.. py:module:: piel.experimental.measurements.experiment


Functions
---------

.. autoapisummary::

   piel.experimental.measurements.experiment.compose_measurement_from_experiment_instance
   piel.experimental.measurements.experiment.compose_measurement_collection_from_experiment
   piel.experimental.measurements.experiment.load_from_directory
   piel.experimental.measurements.experiment.load_experiment_collection


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

.. py:function:: compose_measurement_from_experiment_instance(experiment_instance: piel.types.experimental.ExperimentInstance, instance_directory: piel.types.PathTypes, configuration_measurement_map: dict = configuration_to_measurement_map, measurement_composition_method_mapping: dict = measurement_composition_method_mapping, composition_methods_kwargs: dict = None, **kwargs) -> piel.types.experimental.MeasurementTypes

   This function is meant to be run after the measurements have been collected and the data exists within the measurement directories.
   Each experiment instance should correspond to a list of measurement configurations, ie the specific set of measurements
    that are required at each directory generated for the measurement instance. Hence, for this function to work properly,
    it is required to have a mapping between experiment configuration measurement and measurement classes accordingly.
    The mapping will be between a given ``MeasurementConfiguration`` type and a ``Measurement`` class which has the references
    of the data containers accordingly.


.. py:function:: compose_measurement_collection_from_experiment(experiment: piel.types.experimental.Experiment, experiment_directory: piel.types.PathTypes = None, **kwargs) -> piel.types.experimental.MeasurementCollectionTypes

   This function takes a defined experiment and returns a measurement collection from them.
   Note that the complexity of this is verifying that the experiment is composed of the same type of measurements accordingly.
   TODO this should be validated in the Experiment composition accordingly.


.. py:function:: load_from_directory(parent_directory: piel.types.PathTypes) -> piel.types.experimental.ExperimentInstance | piel.types.experimental.Experiment

   This function is inputted a directory, and the aim is to read the corresponding metadata to extract
   the model definition used to re-instantiate the class instance a Python object. This is useful for
   when we want to load a previously saved experiment instance.

   :param parent_directory: The directory where the metadata file is located.
   :type parent_directory: PathTypes

   :returns: The corresponding experiment instance or experiment object
   :rtype: ExperimentInstance | Experiment


.. py:function:: load_experiment_collection() -> piel.types.experimental.ExperimentCollection

   This function is provided a directory which contains subdirectories of experiments. It will load all the experiments
   and return an `ExperimentCollection` object.


