laborchestrator.database_integration package

Submodules

Module contents

class laborchestrator.database_integration.StatusDBDummyImplementation[source]

Bases: StatusDBInterface

_abc_impl = <_abc._abc_data object>
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

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

get_cont_info_by_barcode(barcode: str) ContainerInfo | None[source]

Retrieves all available information for the container with the given barcode :param barcode: :return:

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.

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

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_server_certificate(device_name) str[source]
Parameters:

device_name

Returns:

lidded_container(cont_info: ContainerInfo, lid_device: str | None = None, lid_pos: int | None = 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:

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:

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:

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

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

set_barcode(cont: ContainerInfo)[source]

Sets the barcode of an existing container. Assumes the barcode is already saved in the ContainerInfo. :param cont: :return:

set_barcode_at_position(barcode: str, device: str, pos: int)[source]
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:

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:

write_server_certificate(device_name, cert: str) None[source]
Parameters:
  • device_name

  • cert

Returns:

class laborchestrator.database_integration.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 get_server_certificate(device_name) str[source]
Parameters:

device_name

Returns:

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:

abstractmethod write_server_certificate(device_name, cert: str) None[source]
Parameters:
  • device_name

  • cert

Returns: