piel.experimental.file_system
=============================

.. py:module:: piel.experimental.file_system

.. autoapi-nested-parse::

   This file contains all functionality required to verify the corresponding measurement file structure and the
   mapping between measurement data, configuration ids, and the file structure accordingly. The goal would be to create
   a direct mapping between an operating setup configuration, or experiment.



Attributes
----------

.. autoapisummary::

   piel.experimental.file_system.logger


Functions
---------

.. autoapisummary::

   piel.experimental.file_system.construct_experiment_directories
   piel.experimental.file_system.construct_experiment_structure


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

.. py:data:: logger

.. py:function:: construct_experiment_directories(experiment: piel.types.experimental.Experiment, parent_directory: piel.types.PathTypes, construct_directory: bool = True, write_schema_markdown: bool = False) -> piel.types.PathTypes

   This function constructs the directories of the experiment configuration. It iterates through the experiment
   instances. It checks that each of these instances is unique. Each experiment.experiment_instance should have a
   unique name. This directory name is an enumerated integer. This enumerated integer is the index of the experiment
   instance in the experiment.experiment_instances tuple. This function should be able to create a new experiment
   configuration from scratch.

   A parent directory is defined in which to create the experiment directories. The experiment directory is created
   in the parent directory. The experiment directory contains the experiment.json file. The experiment.json file
   contains the experiment configuration. Note that the experiment.json file should be recursive.
   The experiment directory also contains the experiment instances. The
   experiment instances are directories. Each experiment instance directory contains the instance.json file. The
   instance.json file contains the experiment instance configuration. This is as flat as the directory structure gets.

   The instance directory will contain the data files alongside all of this metadata information.
    The data files are at the top level of the instance directory, and should not have subdirectories.

   The data files are manually generated from the corresponding measurements specified in the instance.json file.
   These will be added after wards from this directory structure creation.

   This schema is used to generate a README file for the experiment configuration if `write_markdown_schema` is true. This README file should contain
   all the information about the experiment configuration. This includes the experiment instances and their
   corresponding configurations.

   :param experiment: The experiment configuration to create the directories for.
   :type experiment: Experiment
   :param parent_directory: The parent directory to create the experiment directory in.
   :type parent_directory: PathTypes
   :param write_markdown_schema: Writes the json schema into markdown if true. Defaults to false.
   :type write_markdown_schema: bool

   :returns: The path to the experiment directory.
   :rtype: PathTypes


.. py:function:: construct_experiment_structure(experiment: piel.types.experimental.Experiment, parent_directory: piel.types.PathTypes)

   The goal of this function is to construct both the directories and the json file which defines both the experiment
   and all the experiment instances. It should be able to create a new experiment configuration from scratch.



