diff --git a/ot2_driver/protopiler/config.py b/ot2_driver/protopiler/config.py index b4b8a90..b885943 100644 --- a/ot2_driver/protopiler/config.py +++ b/ot2_driver/protopiler/config.py @@ -183,20 +183,17 @@ def check_list_lengths_match(self) -> "Transfer": "multi_blow_out", "multi_drop_tip", ] - for field in listable_fields: - if isinstance(getattr(self, field), str): if "payload" in getattr(self, field) or ":" in getattr(self,field): continue # skip this iteration and leave the value that contains a payload as is - else: setattr(self, field, [getattr(self, field)]) # if not already handled in string block and is not a list - if not isinstance(getattr(self, field), str) and not isinstance(getattr(self, field), list): - # convert the value into a list of of the value - setattr(self, field, [getattr(self, field)]) + # if not isinstance(getattr(self, field), str) and not isinstance(getattr(self, field), list): + # # convert the value into a list of of the value + # setattr(self, field, [getattr(self, field)]) if isinstance(getattr(self, field), list): # just look to see if you have user entered lists of different lengths if iter_len == 0: @@ -207,11 +204,19 @@ def check_list_lengths_match(self) -> "Transfer": ) if iter_len > 0: for field in listable_fields: + ###TODO + #had to put changing things to list here, so that conditional doesn't catch on first validation + if not isinstance(getattr(self, field), str) and not isinstance(getattr(self, field), list): + setattr(self, field, [getattr(self, field)]) + ### if "payload" in getattr(self, field) and isinstance(getattr(self, field), str): pass - elif not isinstance(getattr(self, field), list): - setattr(self, field, [getattr(self, field)] * iter_len) - + #TODO + # elif not isinstance(getattr(self, field), list): + #should be redundant because everything is now list + else: + setattr(self, field, getattr(self, field) * iter_len) + pass return self diff --git a/ot2_driver/protopiler/protopiler.py b/ot2_driver/protopiler/protopiler.py index 467dc1a..3295ba3 100644 --- a/ot2_driver/protopiler/protopiler.py +++ b/ot2_driver/protopiler/protopiler.py @@ -865,7 +865,6 @@ def _create_commands(self, payload: Optional[Dict]) -> List[str]: pipette_mount ] new_src = copy.copy(src) - new_src = new_src.replace("'", "") new_src = new_src.split(":")[-1] new_src = new_src.strip("][").split(", ") @@ -1340,7 +1339,6 @@ def _process_multi_instruction( # Ensure that the command block is a properly validated Multi_Transfer command_block = Multi_Transfer.model_validate(command_block) - for row in zip( command_block.multi_volume, command_block.multi_source, diff --git a/ot2_driver/protopiler/test_configs/flex_test.yaml b/ot2_driver/protopiler/test_configs/flex_test.yaml index fbeb9bf..e548a8f 100644 --- a/ot2_driver/protopiler/test_configs/flex_test.yaml +++ b/ot2_driver/protopiler/test_configs/flex_test.yaml @@ -1,24 +1,69 @@ +# equipment: +# - name: nest_96_wellplate_2ml_deep +# location: "2" +# alias: plate +# offset: [0, 1.7, 3.9] +# - name: opentrons_flex_96_tiprack_200ul +# location: "11" +# offset: [0.5, 0.9, -0.3] +# # - name: flex_1channel_50 +# # mount: left +# - name: flex_8channel_1000 +# mount: right +# - name: trash +# location: "4" + +# commands: +# # - name: test +# # command: transfer +# # source: 2:[A1, A2, A3] +# # aspirate_clearance: 2 +# # destination: 2:[A4, A5, A6] +# # dispense_clearance: 2 +# # volume: [10, 10, 10] +# # mix_cycles: 0 +# # mix_volume: 0 +# # drop_tip: [false, false, true] + +# - name: test +# command: multi_transfer +# multi_source: 2:[[A1, B1, C1], [A2, B2, C2], [A3, B3, C3]] +# # multi_source: 2:[["A1", "B1", "C1"], ["A2", "B2", "C2"], ["A3", "B3", "C3"]] +# multi_aspirate_clearance: 1 +# multi_destination: 2:[[A4, B4, C4], [A5, B5, C5], [A6, B6, C6]] +# # multi_destination: 2:[["A4", "B4", "C4"], ["A5", "B5", "C5"], ["A6", "B6", "C6"]] +# multi_dispense_clearance: 1 +# multi_volume: 200 + +# metadata: +# protocolName: Flex test +# author: Abe astroka@anl.gov +# description: testing flex protocol generation +# apiLevel: "2.18" + +# requirements: +# robotType: Flex + + equipment: - name: nest_96_wellplate_2ml_deep - location: "2" + location: "1" alias: plate offset: [0, 1.7, 3.9] - name: opentrons_flex_96_tiprack_200ul - location: "11" + location: "9" offset: [0.5, 0.9, -0.3] - # - name: flex_1channel_50 - # mount: left + # - name: flex_1channel_1000 + # mount: right - name: flex_8channel_1000 mount: right - - name: trash - location: "4" commands: # - name: test # command: transfer - # source: 2:[A1, A2, A3] + # source: 1:A1 # aspirate_clearance: 2 - # destination: 2:[A4, A5, A6] + # destination: 1:A4 # dispense_clearance: 2 # volume: [10, 10, 10] # mix_cycles: 0 @@ -27,20 +72,17 @@ commands: - name: test command: multi_transfer - multi_source: 2:[[A1, B1, C1], [A2, B2, C2], [A3, B3, C3]] - # multi_source: 2:[["A1", "B1", "C1"], ["A2", "B2", "C2"], ["A3", "B3", "C3"]] + multi_source: 1:[[A1, B1, C1], [A2, B2, C2], [A3, B3, C3]] multi_aspirate_clearance: 1 - multi_destination: 2:[[A4, B4, C4], [A5, B5, C5], [A6, B6, C6]] - # multi_destination: 2:[["A4", "B4", "C4"], ["A5", "B5", "C5"], ["A6", "B6", "C6"]] + multi_destination: 1:[[A4, B4, C4], [A5, B5, C5], [A6, B6, C6]] multi_dispense_clearance: 1 - multi_volume: 200 + multi_volume: 10 metadata: protocolName: Flex test author: Abe astroka@anl.gov description: testing flex protocol generation - apiLevel: "2.18" + apiLevel: "2.12" requirements: - robotType: Flex - + robotType: Flex \ No newline at end of file