laborchestrator.database_integration.status_db_interface module¶
The formal interface a database must implement to enable
- class laborchestrator.database_integration.status_db_interface.StatusDBInterface[source]¶
Bases:
ABC- _abc_impl = <_abc._abc_data object>¶
- abstractmethod add_container(cont: ContainerInfo)[source]¶
Adds a container to the database with its starting position as the current position. :param cont: The container to add :return: nothin
- add_process_to_db(name: str, src: str) str[source]¶
- Parameters:
name
src
- Returns:
the uuid of the created process
- create_experiment(process_id: str) str[source]¶
- Parameters:
process_id – the unique id of the process running in this experiment
- Returns:
the uuid of the created experiment
- abstractmethod get_all_positions(device: str) List[int][source]¶
Provides the indices of all positions in the specified device (independent of emptiness). :param device: :return:
- get_available_processes() List[Tuple[str, str]][source]¶
- Returns:
A List of tuples [process name, process uuid] for all processes in the db
- abstractmethod get_cont_info_by_barcode(barcode: str) ContainerInfo | None[source]¶
Retrieves all available information for the container with the given barcode :param barcode: :return:
- abstractmethod get_container_at_position(device: str, pos: int) ContainerInfo | None[source]¶
Checks if there is a container at a specified position. :param device: :param pos: :return: None if there is no container at the specified position. All available information otherwise.
- abstractmethod get_estimated_duration(step: ProcessStep, confidence=0.95) float | None[source]¶
Checks the database for similar jobs to estimate the duration of a job. :param step: the job of which the duration shall be estimated :param confidence: chance, that the actual duration is less or equal the estimated duration. :return: duration in seconds or None if no information was found in the database
- abstractmethod get_estimated_durations(steps: List[ProcessStep], confidence=0.95) List[float | None][source]¶
Same as get_estimated_duration(), but with many steps at once to save time :return: The list will match the length and order of the given steps
- get_process(process_uuid: str) str[source]¶
- Parameters:
process_uuid – The unique identifier of the process in the db
- Returns:
the source code defining the process
- abstractmethod lidded_container(cont_info: ContainerInfo, lid_device: str | None, lid_pos: int | None)[source]¶
Saved to the database, that a containers lid was put back on. The position of the used lid can be specified, so the database will/can check that it was the correct one. :param cont: :param lid_device: :param lid_pos: :return:
- abstractmethod moved_container(source_device: str, source_pos: int, target_device: str, target_pos: int, barcode: str | None = None)[source]¶
Saves a movement of a container (specified by its prior position) to the database :param source_device: :param source_pos: :param target_device: :param target_pos: :param barcode: :return:
- abstractmethod position_empty(device: str, pos: int) bool[source]¶
Checks whether the specified position is empty :param device: Name of the device :param pos: Index of the slot :return:
- abstractmethod remove_container(cont: ContainerInfo)[source]¶
Marks the given container as removed from the platform. The information is still kept in the database :param cont: The container to mark removed :return: nothing
- abstractmethod safe_step_to_db(step: ProcessStep, container_info: ContainerInfo, experiment_uuid: str)[source]¶
Saves a finished job to the database. It automatically recognizes move jobs. :param experiment_uuid: The uuid of the experiment in the database, this step belongs to :param container_info: information about the processed container :param step: the structures.ProcessStep to save :return: nothing
- abstractmethod set_barcode(cont: ContainerInfo)[source]¶
Sets the barcode of an existing container. Assumes the barcode is already saved in the ContainerInfo. :param cont: :return:
- abstractmethod unlidded_container(cont_info: ContainerInfo, lid_device: str, lid_pos: int)[source]¶
Saves the removal of the lid and its new position to the database :param cont: :param lid_device: :param lid_pos: :return:
- abstractmethod update_lid_position(cont: ContainerInfo)[source]¶
Sets the barcode of an existing container. Assumes the barcode is already saved in the ContainerInfo. :param cont: :return: