robotics_api.actions package

Submodules

robotics_api.actions.db_manipulations module

class robotics_api.actions.db_manipulations.ChemStandardsDB(standards_type: str, _id: str | None = None, instance: dict | None = None, override_lists: bool = True)[source]

Bases: MongoDatabase

Class for accessing the Chem Standards database for robotic fireworks Copyright 2024, University of Kentucky

__init__(standards_type: str, _id: str | None = None, instance: dict | None = None, override_lists: bool = True)[source]

Initialize class instance.

Parameters:
  • standards_type (str) – The type of chemistry standard.

  • _id (str, optional) – The ID of the standard. Defaults to None.

  • instance (dict, optional) – The instance to insert or validate. Defaults to None.

  • override_lists (bool, optional) – Whether to override existing lists. Defaults to True.

property exists

Check if the standard exists in the database.

Returns:

True if the standard exists, False otherwise.

Return type:

bool

get_prop(prop: str)[source]

Get a property of the standard from the database.

Parameters:

prop (str) – The property to retrieve.

Returns:

The value of the property.

Return type:

Any

class robotics_api.actions.db_manipulations.ReagentStatus(r_name=None, r_smiles=None, **kwargs)[source]

Bases: RobotStatusDB

Class for accessing the Robot Reagent Status database Copyright 2024, University of Kentucky

__init__(r_name=None, r_smiles=None, **kwargs)[source]

Initialize class instance.

Parameters:
  • r_name (str, optional) – The name of the reagent. Defaults to None.

  • r_smiles (str, optional) – The SMILES representation of the reagent. Defaults to None.

  • **kwargs – Additional keyword arguments.

property molecular_weight

Calculate the molecular weight of the reagent.

Returns:

The molecular weight of the reagent.

Return type:

float

class robotics_api.actions.db_manipulations.StationStatus(_id: str | None = None, state_id: str | None = None, pre_snapshot=True, **kwargs)[source]

Bases: RobotStatusDB

Class for accessing the Robot Vial Status database Copyright 2024, University of Kentucky

__init__(_id: str | None = None, state_id: str | None = None, pre_snapshot=True, **kwargs)[source]

Initialize class instance.

Parameters:
  • _id (str, optional) – The ID. Defaults to None.

  • state_id (str, optional) – The state ID. Defaults to None.

  • **kwargs – Additional keyword arguments.

property available

Get the availability status.

Returns:

The availability status.

Return type:

bool

property clean

Get the cleanliness.

Returns:

The state.

Return type:

str

property content_history

Get the content history.

Returns:

The content history.

Return type:

list

property current_content

Get the current content.

Returns:

The current content.

Return type:

str

empty()[source]

Empty the station content and update availability.

get_all_available(name_str: str, exp_name=None, check_clean=False)[source]

Get all available stations with a specified name string.

Parameters:
  • name_str (str) – The name string to search for.

  • exp_name (str, optional) – The experiment name. Defaults to None.

  • check_clean (bool, optional) – Check if clean in True. Default False.

Returns:

List of available station IDs.

Return type:

list

get_first_available(name_str, wait=True, max_time=10, wait_interval=2, **kwargs)[source]

Get the first available station with a specified name string.

Parameters:
  • name_str (str) – The name string to search for.

  • wait (bool, optional) – Whether to wait for an available station. Defaults to True.

  • max_time (int, optional) – The maximum time to wait in seconds. Defaults to MAX_DB_WAIT_TIME.

  • wait_interval (int, optional) – The interval between wait checks in seconds. Defaults to 2.

  • **kwargs – Additional keyword arguments.

Returns:

The ID of the first available station.

Return type:

str

place_vial(vial, **kwargs)[source]

Placeholder method for placing a vial.

Parameters:
  • vial – The vial to place.

  • **kwargs – Additional keyword arguments.

property state

Get the state.

Returns:

The state.

Return type:

str

update_available(value: bool)[source]

Update the availability status.

Parameters:

value (bool) – The new availability status.

Returns:

The updated availability status.

Return type:

prop

update_clean(clean_status: bool)[source]

Update the station cleanliness.

Parameters:

clean_status (bool) – The new cleanliness status for the station.

update_content(new_content)[source]

Update the station content.

Parameters:

new_content – The new content in the station.

update_state(new_state: str)[source]

Update the station state.

Parameters:

new_state (str) – The new state for the station.

wait_till_available(max_time=10, wait_interval=2)[source]

Wait until the station is available.

Parameters:
  • max_time (int, optional) – The maximum time to wait in seconds. Defaults to MAX_DB_WAIT_TIME.

  • wait_interval (int, optional) – The interval between wait checks in seconds. Defaults to 2.

Returns:

True if the station becomes available, False otherwise.

Return type:

bool

class robotics_api.actions.db_manipulations.VialStatus(_id: str | None = None, exp_name: str | None = None, **kwargs)[source]

Bases: RobotStatusDB

Class for accessing the Robot Vial Status database Copyright 2024, University of Kentucky

__init__(_id: str | None = None, exp_name: str | None = None, **kwargs)[source]

Initialize class instance.

Parameters:
  • _id (str, optional) – The ID. Defaults to None.

  • exp_name (str, optional) – The experiment name. Defaults to None.

  • **kwargs – Additional keyword arguments.

add_reagent(reagent, amount, default_unit, addition_id=None)[source]

Add a reagent to the vial content.

Parameters:
  • reagent (str or obj) – The reagent ID or instance.

  • amount (str or float or dict) – The amount of the reagent.

  • default_unit (str) – The default unit for the reagent amount.

  • addition_id (str) – A unique identifier for the reagent addition (Default is None)

Raises:

NameError – If the reagent does not exist in the reagent database.

add_solution(reagent, amount, default_unit, addition_id=None)[source]
check_addition_id(addition_id)[source]

Check if this addition has already been made :param addition_id: A unique identifier for the reagent addition (Default is None) :type addition_id: str

Raises:

boolean – If the reagent does not exist in the reagent database.

clear_vial_content()[source]

Clear the vial content.

property content_history

Get the vial content.

Returns:

The vial content.

Return type:

list

property current_location

Get the current location.

Returns:

The current location.

Return type:

str

property current_station

Get the current station.

Returns:

The current station status.

Return type:

StationStatus

property current_weight

Get the current weight.

Returns:

The current weight.

Return type:

str

extract_soln(extracted_mass, default_mass_unit='g', addition_id=None)[source]

Add a reagent to the vial content.

Parameters:
  • extracted_mass (str or obj) – Mass extracted from solution

  • default_mass_unit (str) – The default mass unit for the reagent amount.

  • addition_id (str) – A unique identifier for the reagent addition (Default is None)

Raises:

NameError – If the reagent does not exist in the reagent database.

property location_history

Get the location history.

Returns:

The location history.

Return type:

list

update_location(new_location: str)[source]

Update the vial location or station vial status.

Parameters:

new_location (str) – The new vial location.

update_vial_content(new_content)[source]

Update the vial content.

Parameters:

new_content (dict) – The new vial content.

update_weight(new_weight: float)[source]

Update the vial location or station vial status.

Parameters:

new_weight (str) – weight

property vial_content

Get the vial content.

Returns:

The vial content.

Return type:

list

robotics_api.actions.db_manipulations.check_duplicates(test_list, exemptions=None)[source]

Check for duplicates in a list, excluding specified exemptions.

Parameters:
  • test_list (list) – The list to check for duplicates.

  • exemptions (list, optional) – Items to exclude from duplicate checking. Defaults to None.

Returns:

A comma-separated string of duplicate items, or None if no duplicates are found.

Return type:

str

robotics_api.actions.db_manipulations.reset_reagent_db(reagents_list, current_wflow_name='', solvent_densities={'CC#N': '0.786 g/mL', 'O': '0.997 g/mL'}, potentials_dict={'CC1(C)CCCC(C)(C)N1[O]': '0.367 V', '[CH-]1C=CC=C1.[CH-]1C=CC=C1.[Fe+2]': '0 V'})[source]

Reset the reagent database with the provided list of reagents.

Parameters:
  • reagents_list (list) – List of dictionaries representing reagents.

  • current_wflow_name (str, optional) – Name of the current workflow. Defaults to “”.

  • solvent_densities (dict, optional) – Dictionary with solvent SMILES and densities

robotics_api.actions.db_manipulations.reset_station_db(current_wflow_name='')[source]

Reset the station database.

Parameters:

current_wflow_name (str, optional) – Name of the current workflow. Defaults to “”.

robotics_api.actions.db_manipulations.reset_test_db()[source]

Reset the test database with default configurations.

robotics_api.actions.db_manipulations.reset_vial_db(experiment_locs: dict, current_wflow_name='')[source]

Reset the vial database with the provided experiment locations.

Parameters:
  • experiment_locs (dict) – Dictionary mapping vial IDs to experiment names.

  • current_wflow_name (str, optional) – Name of the current workflow. Defaults to “”.

robotics_api.actions.db_manipulations.setup_status_db(wflow_name, experiments, reagents)[source]
robotics_api.actions.db_manipulations.test_soln_reagent(reagent)[source]

robotics_api.actions.standard_actions module

robotics_api.actions.system_tests module

Module contents