dacapo.store.config_store ========================= .. py:module:: dacapo.store.config_store Exceptions ---------- .. autoapisummary:: dacapo.store.config_store.DuplicateNameError Classes ------- .. autoapisummary:: dacapo.store.config_store.ConfigStore Module Contents --------------- .. py:exception:: DuplicateNameError Exception raised when trying to store a config with a name that already exists. .. attribute:: message The error message. :type: str .. method:: __str__ Return the error message. .. py:class:: ConfigStore Base class for configuration stores. .. attribute:: runs The runs store. :type: Any .. attribute:: datasplits The datasplits store. :type: Any .. attribute:: datasets The datasets store. :type: Any .. attribute:: arrays The arrays store. :type: Any .. attribute:: tasks The tasks store. :type: Any .. attribute:: trainers The trainers store. :type: Any .. attribute:: architectures The architectures store. :type: Any .. method:: delete_config Delete a config from a store. .. method:: store_run_config Store a run config. .. method:: retrieve_run_config Retrieve a run config from a run name. .. method:: retrieve_run_config_names Retrieve all run config names. .. method:: delete_run_config Delete a run config. .. method:: store_task_config Store a task config. .. method:: retrieve_task_config Retrieve a task config from a task name. .. method:: retrieve_task_config_names Retrieve all task config names. .. method:: delete_task_config Delete a task config. .. method:: store_architecture_config Store a architecture config. .. method:: retrieve_architecture_config Retrieve a architecture config from a architecture name. .. method:: retrieve_architecture_config_names Retrieve all architecture config names. .. method:: delete_architecture_config Delete a architecture config. .. method:: store_trainer_config Store a trainer config. .. method:: retrieve_trainer_config Retrieve a trainer config from a trainer name. .. method:: retrieve_trainer_config_names Retrieve all trainer config names. .. method:: delete_trainer_config Delete a trainer config. .. method:: store_datasplit_config Store a datasplit config. .. method:: retrieve_datasplit_config Retrieve a datasplit config from a datasplit name. .. method:: retrieve_datasplit_config_names Retrieve all datasplit names. .. method:: delete_datasplit_config Delete a datasplit config. .. method:: store_array_config Store a array config. .. method:: retrieve_array_config Retrieve a array config from a array name. .. method:: retrieve_array_config_names Retrieve all array names. .. method:: delete_array_config Delete a array config. .. note:: This class is an abstract base class for configuration stores. It defines the interface for storing and retrieving configuration objects (e.g., run, task, architecture, trainer, datasplit, dataset, array configs). Concrete implementations of this class should define how these objects are stored and retrieved (e.g., in a database, in files). .. py:attribute:: runs :type: Any .. py:attribute:: datasplits :type: Any .. py:attribute:: datasets :type: Any .. py:attribute:: arrays :type: Any .. py:attribute:: tasks :type: Any .. py:attribute:: trainers :type: Any .. py:attribute:: architectures :type: Any .. py:method:: delete_config(database, config_name: str) -> None :abstractmethod: Delete a config from a store. :param database: The store to delete the config from. :type database: Any :param config_name: The name of the config to delete. :type config_name: str :raises KeyError: If the config does not exist. .. rubric:: Examples >>> store.delete_config(store.runs, "run1") .. py:method:: store_run_config(run_config: dacapo.experiments.run_config.RunConfig) -> None :abstractmethod: Store a run config. This should also store the configs that are part of the run config (i.e., task, architecture, trainer, and dataset config). :param run_config: The run config to store. :type run_config: RunConfig :raises DuplicateNameError: If a run config with the same name already exists. .. rubric:: Examples >>> store.store_run_config(run_config) .. py:method:: retrieve_run_config(run_name: str) -> dacapo.experiments.run_config.RunConfig :abstractmethod: Retrieve a run config from a run name. :param run_name: The name of the run config to retrieve. :type run_name: str :returns: The run config with the given name. :rtype: RunConfig :raises KeyError: If the run config does not exist. .. rubric:: Examples >>> run_config = store.retrieve_run_config("run1") .. py:method:: retrieve_run_config_names() -> List[str] :abstractmethod: Retrieve all run config names. :returns: The names of all run configs. :rtype: List[str] :raises KeyError: If no run configs exist. .. rubric:: Examples >>> run_names = store.retrieve_run_config_names() .. py:method:: delete_run_config(run_name: str) -> None Delete a run config from the store. :param run_name: The name of the run config to delete. :type run_name: str :raises KeyError: If the run config does not exist. .. rubric:: Examples >>> store.delete_run_config("run1") .. py:method:: store_task_config(task_config: dacapo.experiments.tasks.task_config.TaskConfig) -> None :abstractmethod: Store a task config. :param task_config: The task config to store. :type task_config: TaskConfig :raises DuplicateNameError: If a task config with the same name already exists. .. rubric:: Examples >>> store.store_task_config(task_config) .. py:method:: retrieve_task_config(task_name: str) -> dacapo.experiments.tasks.task_config.TaskConfig :abstractmethod: Retrieve a task config from a task name. :param task_name: The name of the task config to retrieve. :type task_name: str :returns: The task config with the given name. :rtype: TaskConfig :raises KeyError: If the task config does not exist. .. rubric:: Examples >>> task_config = store.retrieve_task_config("task1") .. py:method:: retrieve_task_config_names() -> List[str] :abstractmethod: Retrieve all task config names. :param List[str]: The names of all task configs. :returns: The names of all task configs. :rtype: List[str] :raises KeyError: If no task configs exist. .. rubric:: Examples >>> task_names = store.retrieve_task_config_names() .. py:method:: delete_task_config(task_name: str) -> None Delete a task config from the store. :param task_name: The name of the task config to delete. :type task_name: str :raises KeyError: If the task config does not exist. .. rubric:: Examples >>> store.delete_task_config("task1") .. py:method:: store_architecture_config(architecture_config: dacapo.experiments.architectures.architecture_config.ArchitectureConfig) -> None :abstractmethod: Store a architecture config. :param architecture_config: The architecture config to store. :type architecture_config: ArchitectureConfig :raises DuplicateNameError: If a architecture config with the same name already exists. .. rubric:: Examples >>> store.store_architecture_config(architecture_config) .. py:method:: retrieve_architecture_config(architecture_name: str) -> dacapo.experiments.architectures.architecture_config.ArchitectureConfig :abstractmethod: Retrieve a architecture config from a architecture name. :param architecture_name: The name of the architecture config to retrieve. :type architecture_name: str :returns: The architecture config with the given name. :rtype: ArchitectureConfig :raises KeyError: If the architecture config does not exist. .. rubric:: Examples >>> architecture_config = store.retrieve_architecture_config("architecture1") .. py:method:: retrieve_architecture_config_names() -> List[str] :abstractmethod: Retrieve all architecture config names. :param List[str]: The names of all architecture configs. :returns: The names of all architecture configs. :rtype: List[str] :raises KeyError: If no architecture configs exist. .. rubric:: Examples >>> architecture_names = store.retrieve_architecture_config_names() .. py:method:: delete_architecture_config(architecture_name: str) -> None Delete a architecture config from the store. :param architecture_name: The name of the architecture config to delete. :type architecture_name: str :raises KeyError: If the architecture config does not exist. .. rubric:: Examples >>> store.delete_architecture_config("architecture1") .. py:method:: store_trainer_config(trainer_config: dacapo.experiments.trainers.trainer_config.TrainerConfig) -> None :abstractmethod: Store a trainer config. :param trainer_config: The trainer config to store. :type trainer_config: TrainerConfig :raises DuplicateNameError: If a trainer config with the same name already exists. .. rubric:: Examples >>> store.store_trainer_config(trainer_config) .. py:method:: retrieve_trainer_config(trainer_name: str) -> None :abstractmethod: Retrieve a trainer config from a trainer name. :param trainer_name: The name of the trainer config to retrieve. :type trainer_name: str :returns: The trainer config with the given name. :rtype: TrainerConfig :raises KeyError: If the trainer config does not exist. .. rubric:: Examples >>> trainer_config = store.retrieve_trainer_config("trainer1") .. py:method:: retrieve_trainer_config_names() -> List[str] :abstractmethod: Retrieve all trainer config names. :param List[str]: The names of all trainer configs. :returns: The names of all trainer configs. :rtype: List[str] :raises KeyError: If no trainer configs exist. .. rubric:: Examples >>> trainer_names = store.retrieve_trainer_config_names() .. py:method:: delete_trainer_config(trainer_name: str) -> None Delete a trainer config from the store. :param trainer_name: The name of the trainer config to delete. :type trainer_name: str :raises KeyError: If the trainer config does not exist. .. rubric:: Examples >>> store.delete_trainer_config("trainer1") .. py:method:: store_datasplit_config(datasplit_config: dacapo.experiments.datasplits.datasplit_config.DataSplitConfig) -> None :abstractmethod: Store a datasplit config. :param datasplit_config: The datasplit config to store. :type datasplit_config: DataSplitConfig :raises DuplicateNameError: If a datasplit config with the same name already exists. .. rubric:: Examples >>> store.store_datasplit_config(datasplit_config) .. py:method:: retrieve_datasplit_config(datasplit_name: str) -> dacapo.experiments.datasplits.datasplit_config.DataSplitConfig :abstractmethod: Retrieve a datasplit config from a datasplit name. :param datasplit_name: The name of the datasplit config to retrieve. :type datasplit_name: str :returns: The datasplit config with the given name. :rtype: DataSplitConfig :raises KeyError: If the datasplit config does not exist. .. rubric:: Examples >>> datasplit_config = store.retrieve_datasplit_config("datasplit1") .. py:method:: retrieve_datasplit_config_names() -> List[str] :abstractmethod: Retrieve all datasplit names. :param List[str]: The names of all datasplit configs. :returns: The names of all datasplit configs. :rtype: List[str] :raises KeyError: If no datasplit configs exist. .. rubric:: Examples >>> datasplit_names = store.retrieve_datasplit_config_names() .. py:method:: delete_datasplit_config(datasplit_name: str) -> None .. py:method:: store_array_config(array_config: dacapo.experiments.datasplits.datasets.arrays.array_config.ArrayConfig) -> None :abstractmethod: Store a array config. :param array_config: The array config to store. :type array_config: ArrayConfig :raises DuplicateNameError: If a array config with the same name already exists. .. rubric:: Examples >>> store.store_array_config(array_config) .. py:method:: retrieve_array_config(array_name: str) -> dacapo.experiments.datasplits.datasets.arrays.array_config.ArrayConfig :abstractmethod: Retrieve a array config from a array name. :param array_name: The name of the array config to retrieve. :type array_name: str :returns: The array config with the given name. :rtype: ArrayConfig :raises KeyError: If the array config does not exist. .. rubric:: Examples >>> array_config = store.retrieve_array_config("array1") .. py:method:: retrieve_array_config_names() -> List[str] :abstractmethod: Retrieve all array names. :param List[str]: The names of all array configs. :returns: The names of all array configs. :rtype: List[str] :raises KeyError: If no array configs exist. .. rubric:: Examples >>> array_names = store.retrieve_array_config_names() .. py:method:: delete_array_config(array_name: str) -> None Delete a array config from the store. :param array_name: The name of the array config to delete. :type array_name: str :raises KeyError: If the array config does not exist. .. rubric:: Examples >>> store.delete_array_config("array1")