@@ -1742,18 +1742,13 @@ async def dispense96(
17421742 raise ValueError ("Container too small to accommodate 96 head" )
17431743
17441744 for channel in self .head96 .values ():
1745- # superfluous to have append in two places but the type checker is very angry and does not
1746- # understand that Optional[Liquid] (remove_liquid) is the same as None from the first case
1747- reversed_liquids : List [Tuple [Optional [Liquid ], float ]]
1748- if container .tracker .is_disabled or not does_volume_tracking ():
1749- reversed_liquids = [(None , volume )]
1750- all_liquids .append (reversed_liquids )
1751- else :
1752- reversed_liquids = container .tracker .remove_liquid (volume = volume ) # type: ignore
1753- all_liquids .append (reversed_liquids )
1745+ liquids = channel .get_tip ().tracker .remove_liquid (volume = volume )
1746+ reversed_liquids = list (reversed (liquids ))
1747+ all_liquids .append (reversed_liquids )
17541748
1755- for liquid , vol in reversed (reversed_liquids ):
1756- channel .get_tip ().tracker .add_liquid (liquid = liquid , volume = vol )
1749+ if not container .tracker .is_disabled and does_volume_tracking ():
1750+ for liquid , vol in reversed (reversed_liquids ):
1751+ container .tracker .add_liquid (liquid = liquid , volume = vol )
17571752
17581753 dispense = MultiHeadDispenseContainer (
17591754 container = container ,
@@ -1765,8 +1760,6 @@ async def dispense96(
17651760 blow_out_air_volume = blow_out_air_volume ,
17661761 liquids = cast (List [List [Tuple [Optional [Liquid ], float ]]], all_liquids ), # stupid
17671762 )
1768-
1769- containers = [resource ]
17701763 else :
17711764 # ensure that wells are all in the same plate
17721765 plate = containers [0 ].parent
@@ -1803,13 +1796,13 @@ async def dispense96(
18031796 await self .backend .dispense96 (dispense = dispense , ** backend_kwargs )
18041797 except Exception as error :
18051798 for channel , container in zip (self .head96 .values (), containers ):
1806- if does_volume_tracking () and not well .tracker .is_disabled :
1799+ if does_volume_tracking () and not container .tracker .is_disabled :
18071800 container .tracker .rollback ()
18081801 channel .get_tip ().tracker .rollback ()
18091802 raise error
18101803 else :
18111804 for channel , container in zip (self .head96 .values (), containers ):
1812- if does_volume_tracking () and not well .tracker .is_disabled :
1805+ if does_volume_tracking () and not container .tracker .is_disabled :
18131806 container .tracker .commit ()
18141807 channel .get_tip ().tracker .commit ()
18151808
0 commit comments