Skip to content

SlotSet (inherits from dataclass)

Description

Represents a collection of slots on the Jubilee deck. Provides access to individual slots either by their key (slot index) or by position, and summarizes the deck's bed type.

Constructor

python
SlotSet(slots: Dict[str, Slot])

Initializes a SlotSet with a dictionary of slot objects.

Properties

PropertyTypeDescription
slotsDict[str, Slot]Dictionary mapping slot indices to Slot objects.

Methods

MethodReturnsDescription
__getitem__(id_: str or int)SlotRetrieves a Slot object by its key or by list index if key not found.
__repr__()strReturns a string representation of the bed type.

Short Example

python
# Suppose you have some slots
slots_dict = {
    "0": Slot(slot_index=0, offset=(0, 0), has_labware=False, labware=None),
    "1": Slot(slot_index=1, offset=(50, 0), has_labware=False, labware=None),
}

# Create a SlotSet
slot_set = SlotSet(slots=slots_dict)

# Access a Slot by key
slot0 = slot_set["0"]

# Access a Slot by position (fallback to list index)
slot1 = slot_set[1]

Important Notes

  • SlotSet allows flexible access: by string key (e.g., "0") or by integer index (e.g., 1).
  • SlotSet's __repr__() method assumes that a bedType property exists, although it's normally provided by subclasses like Deck.
  • Direct modification of slots dictionary is possible but should be done carefully to maintain consistency with the physical deck layout.

Pre-release documentation · Internal research use only · Not authorized for redistribution.