science_jubilee.decks.Deck ========================== .. py:module:: science_jubilee.decks.Deck Classes ------- .. autoapisummary:: science_jubilee.decks.Deck.Labware science_jubilee.decks.Deck.Slot science_jubilee.decks.Deck.SlotSet science_jubilee.decks.Deck.Deck Module Contents --------------- .. py:class:: Labware(labware_filename: str, offset: Tuple[float] = None, order: str = 'rows', path: str = os.path.join(os.path.dirname(__file__), 'labware_definition')) Bases: :py:obj:`WellSet` A class representing a basic laboratory labware made up of a set of wells/pipette tips. :param labware_filename: The name of the config `.json` :type labware_filename: str :param offset: Coordinates to use to offset all the wells in a labware for easier handling of coordinates. For example this is called by the :method:`Deck.load_labware` when assignign a labware to a deck slot, defaults to None :type offset: Tuple[float], optional :param order: Option to order the wells of a labware either by `row` or `columns`, defaults to 'rows' :type order: str, optional :param path: Path to the folder containing the configuration `.json` files for the labware, defaults to the 'labware_definition/' in the science_jubilee/labware directory. :type path: str, optional .. py:method:: __repr__() Displayed representation of a :class:`Labware` object indicating the type of labware and its name. Additionally, it will show the :attribute:`Deck.slots` number if the labware has been already assigned to it. .. py:method:: _create_rows_and_columns() Creates a dictionary of :class:`Row` and :class:`Column` and :class:`Well` objects from the data in the config `.json` file. :return: A dictionary of :class:`Row` and :class:`Column` and :class:`Well` objects :rtype: :class:`Row`, :class:`Column`, :class:`Well` .. py:method:: get_row(row_id: str) -> Row Fucntions to fetch the :class:`Well.name` of the indicated row. :param row_id: The name of a row of the labware, usually indicated by a capital letter (e.g., A, B, etc.) :type row_id: str :return: A list of :class:`Well` objects diplayed by their :attribute:`Well.name` :rtype: :class:`Row` .. py:method:: get_column(col_id: int) -> Column Fucntions to fetch the :class:`Well.name` of the indicated column. :param col_id: The name of a column of the labware, usually indicated by an integer number (e.g., 1, 2, etc.) :type col_id: str :return: A list of :class:`Well` objects diplayed by their :attribute:`Well.name` :rtype: :class:`Column` .. py:property:: shape Returns the shape of the labware as a tuple of (rows, columns) :return: A tuple of (rows, columns) :rtype: Tuple[int, int] .. py:property:: ordering :type: List[List[str]] Returns the ordering of the wells in the labware as a list of lists. Each list represents a row of the labware. :return: A list of lists of :class:`Well.name` objects :rtype: List[List[str]] .. py:property:: brand :type: dict Returns the brand of the labware as a strin :return: A string with the brand of the labware :rtype: str .. py:method:: metadata() -> dict Returns the metadata of the labware as a dictionary The metadata of a labware will generally contain the display name, the type of labware, and the units of volume. These can also be found as attributes of the :class:`Labware` object. :return: A dictionary with the metadata of the labware :rtype: dict .. py:property:: display_name Returns the display name of the labware as a string :return: A string with the display name of the labware :rtype: str .. py:property:: labware_type Returns the type of labware as a string The type fo labware will generally either be a tiprack, wellplate, reservoir, etc. :return: A string with the type of labware :rtype: str .. py:property:: volume_units Returns the units of volume of the labware as a string The volume units will be either uL or mL. :return: A string with the units of volume of the labware :rtype: str .. py:property:: dimensions :type: dict Returns the dimensions of the labware as a dictionary :return: A dictionary with the x,y, and z dimensions of the labware :rtype: dict .. py:method:: parameters() -> dict Returns the parameters describing certain features of the labware as a dictionary The parameters genereally include whether the shape of the labware is regular or irregular, if it is a tiprack, and other Opentrons specific parameters as we are using their 'Custom Labware Page' to generate the .json config files. :return: A dictionary with the parameters of the labware :rtype: dict .. py:property:: is_tip_rack Returns a boolean indicating if the labware is a tiprack :return: True if the labware is a tiprack, False otherwise :rtype: bool .. py:property:: load_name Returns the name of the labware as a string :return: A string with the name of the labware :rtype: str .. py:property:: tip_length Returns the length of the tip of the labware as a float if the labware is a tiprack, otherwise returns None :return: A float with the length of the tip of the labware or None otherwise :rtype: float .. py:property:: tip_overlap Returns the overlap of the tip of the labware as a float if the labware is a tiprack, otherwise returns None :return: A float with the overlap of the tip of the labware or None otherwise :rtype: float .. py:property:: offset Returns the offset of the labware as a tuple of floats :return: A tuple of floats with the offset of the labware :rtype: Tuple[float] .. py:method:: add_slot(slot_) Add name of deck slot after labware has been loaded :param slot_: The name of the deck slot :type slot_: str .. py:method:: withWellOrder(order) -> list Reorders the wells by rows or by columns. Automatically updates the :attribute:`Labware.wells` :param order: The order in which to reorder the wells. Can be either 'rows' or 'columns' :type order: str :return: A list of :class:`Well` objects diplayed by their :attribute:`Well.name` :rtype: list .. py:method:: _translate_point(well: Well, theta: float, x_space: float, y_space: float, upper_left: Tuple[float]) Helper function to translate the coordinates of a well by a given angle theta. :param well: A :class:`Well` object :type well: :class:`Well` :param theta: The angle by which to translate the coordinates of the well :type theta: float :return: The new x and y coordinates of the well :rtype: float, float .. py:method:: _nominal_coordinates(well: Well, x_space: float, y_space: float) :staticmethod: Helper function to calculate the nominal coordinates of a well in a labware based on its row and column index. .. py:method:: manual_offset(corner_wells: List[Tuple[float]], save: bool = False) Allows the user to manually offset the coordinates of the labware based on three corner wells. Adapted from `https://github.com/machineagency/sonication_station` labware calibration procedure. :param offset: A list containing tuples of floats :type offset: Tuple[float] :param save: Option to save the manual offset to the original config `.json` file, defaults to False :type save: bool, optional :return: An updated :class:`Labware` object with the new coordinates of the wells :rtype: :class:`Labware` .. py:method:: load_manualOffset(apply: bool = True) Loads the manual offset of a labware from its config `.json` file for a specific slot :param apply: Option to apply the manual offset to the labware or return values, defaults to False :type apply: bool, optional :return: A list of tuples containing the manual offset of the labware :rtype: List[Tuple[float]] .. py:method:: _getxyz(location: Union[Well, Tuple, Location]) :staticmethod: Helper function to extract the x, y, z coordinates of a location object. :param location: The location object to extract the coordinates from. This can either be a :class:`Well`, a :tuple: of x, y, z coordinates, or a :class:`Location` object :type location: Union[Well, Tuple, Location] :raises ValueError: If the location is not a :class:`Well`, a :class:`tuple`, or a :class:`Location` object :return: The x, y, z coordinates of the location :rtype: float, float, float .. py:class:: Slot Class that defines a slot on the Jubilee deck. Each slot has a unique index, offset, and can have a labware associated with it. :param slot_index: The unique index of the slot, usually a number between 0 and 5. :type slot_index: int :param offset: The (x,y) offset of the slot from the origin of the deck/machine. :type offset: Tuple[float] :param has_labware: A boolean that indicates whether a labware has been loaded into the slot. :type has_labware: bool :param labware: The :class:`Labware` object that has been loaded into the slot. :type labware: :class:`Labware` .. py:attribute:: slot_index :type: int .. py:attribute:: offset :type: Tuple[float] .. py:attribute:: has_labware :type: bool .. py:attribute:: labware :type: str .. py:class:: SlotSet Class that defines a set of slots on the Jubilee deck. :param slots: A dictionary of :class:`Slot` objects, where the key is the slot's index. :type slots: Dict[str, :class:`Slot`] :param bedType: The type of bed that the slots are arranged in. Usually 'fixed' or 'removable'. :type bedType: str .. py:attribute:: slots :type: Dict[str, Slot] .. py:method:: __repr__() Return repr(self). .. py:method:: __getitem__(id_) Allows the user to select a :class:`Slot` object by its index or key. :param id_: The index or key representing the slot. :type id_: str or int :return: The :class:`Slot` object associated with the index or key. :rtype: :class:`Slot` .. py:class:: Deck(deck_filename, path: str = os.path.join(os.path.dirname(__file__), 'deck_definition')) Bases: :py:obj:`SlotSet` Class that defines the Jubilee deck. The deck is a set of slots that can have labware loaded into them. The deck is defined by a configuration file that specifies the number of slots, their offsets, and the type of bed they are arranged in. :param deck_filename: The name of the deck configuration file. :type deck_filename: str :param path: The path to the deck configuration `.json` files for the labware, defaults to the 'deck_definition/' in the science_jubilee/decks directory. :type path: str, optional .. py:method:: _get_slots() Function that creates a dictionary of :class:`Slot` objects from the deck configuration file. :return: A dictionary of :class:`Slot` objects, where the key is the slot's index. :rtype: Dict[str, :class:`Slot`] .. py:property:: bedType Function that returns the type of bed loaded onto Jubilee. :return: The name/type of deck loaded onto Jubilee, e.g., Lab Automation Deck, Heated Deck, etc. :rtype: str .. py:property:: totalslots Function that returns the total number of slots on the deck. :return: The total number of slots on the deck. :rtype: int .. py:property:: slotType Function that returns the type of slot arrangement the deck might have. :return: The slot arrangement type. This is inidcated in the configuration file. Standard is "SLAS". :rtype: str .. py:property:: offsetFrom Function that returns which corner or the slot to apply to a labware loaded on it. :return: The corner of the slot to apply to the labware. This is inidcated in the configuration file. :rtype: str .. py:property:: deck_material Function that returns the material that the deck and possible mask are made of. :return: The material that the deck is made of, as well as any mask that is applied to it. :rtype: Dict[str, str] .. py:property:: safe_z Function that returns the movement clearance height of the deck. :return: The height at which the pipette can freely move without colliding with labware on the deck. :rtype: float .. py:method:: load_labware(labware_filename: str, slot: int, path=os.path.join(os.path.dirname(__file__), '..', 'labware', 'labware_definition'), order: str = 'rows') Function that loads a labware and associates it with a specific slot on the deck. The slot offset is also applied to the labware asocaite with it. :param labware_filename: The name of the labware configuration file. :type labware_filename: str :param slot: The index of the slot to load the labware into. :type slot: int :param path: The path to the labware configuration `.json` files for the labware, defaults to the 'labware_definition/' in the science_jubilee/labware directory. :type path: str, optional :param order: The order in which the labware is arranged on the deck. Can be 'rows' or 'columns', defaults to 'rows'. :type order: str, optional :return: The :class:`Labware` object that has been loaded into the slot. :rtype: :class:`Labware`