@@ -501,6 +501,7 @@ def dispense(
501501 * ,
502502 label : Optional [str ] = None ,
503503 compositions : Optional [List [Optional [Dict [str , float ]]]] = None ,
504+ vtrack : Union [float , Sequence [float ], numpy .ndarray ] | None = None ,
504505 ** kwargs ,
505506 ) -> None :
506507 """Performs dispensing into the provided labware.
@@ -512,11 +513,16 @@ def dispense(
512513 wells : str or iterable
513514 List of well ids
514515 volumes : float or iterable
515- Volume(s) to dispense
516+ Volume(s) to dispense in the command
516517 label : str
517518 Label of the operation to log into labware history
518519 compositions : list
519520 Iterable of liquid compositions
521+ vtrack
522+ Volume to add to the destination in digital volume tracking.
523+ Defaults to ``volume``.
524+ Used by ``transfer`` commands to account for ``on_underflow`` situations
525+ where more volume was aspirated than considered aspiratable based on volume tracking.
520526 kwargs
521527 Additional keyword arguments to pass to `dispense_well`.
522528 Most prominent example: `liquid_class`.
@@ -526,7 +532,16 @@ def dispense(
526532 volumes = numpy .array (volumes ).flatten ("F" )
527533 if len (volumes ) == 1 :
528534 volumes = numpy .repeat (volumes , len (wells ))
529- labware .add (wells , volumes , label , compositions = compositions )
535+
536+ # Digital volume transfer overrides may be provided
537+ if vtrack is None :
538+ vtrack = volumes
539+ else :
540+ vtrack = numpy .array (vtrack ).flatten ("F" )
541+ if len (vtrack ) == 1 :
542+ vtrack = numpy .repeat (vtrack , len (wells ))
543+
544+ labware .add (wells , vtrack , label , compositions = compositions )
530545 self .comment (label )
531546 for well , volume in zip (wells , volumes ):
532547 if volume > 0 :
0 commit comments