@@ -1431,7 +1431,7 @@ def get_well_offset_adjustment(
1431
1431
volume = operation_volume or 0.0
1432
1432
1433
1433
if volume :
1434
- return self .get_well_height_after_volume (
1434
+ return self .get_well_height_after_liquid_handling (
1435
1435
labware_id = labware_id ,
1436
1436
well_name = well_name ,
1437
1437
initial_height = initial_handling_height ,
@@ -1440,6 +1440,49 @@ def get_well_offset_adjustment(
1440
1440
else :
1441
1441
return initial_handling_height
1442
1442
1443
+ def get_current_well_volume (
1444
+ self ,
1445
+ labware_id : str ,
1446
+ well_name : str ,
1447
+ ) -> float :
1448
+ """Returns most recently updated volume in specified well."""
1449
+ last_updated = self ._wells .get_last_liquid_update (labware_id , well_name )
1450
+ if last_updated is None :
1451
+ raise errors .LiquidHeightUnknownError (
1452
+ "Must LiquidProbe or LoadLiquid before specifying WellOrigin.MENISCUS."
1453
+ )
1454
+
1455
+ well_liquid = self ._wells .get_well_liquid_info (
1456
+ labware_id = labware_id , well_name = well_name
1457
+ )
1458
+ if (
1459
+ well_liquid .probed_height is not None
1460
+ and well_liquid .probed_height .height is not None
1461
+ and well_liquid .probed_height .last_probed == last_updated
1462
+ ):
1463
+ return self .get_well_volume_at_height (
1464
+ labware_id = labware_id ,
1465
+ well_name = well_name ,
1466
+ height = well_liquid .probed_height .height ,
1467
+ )
1468
+ elif (
1469
+ well_liquid .loaded_volume is not None
1470
+ and well_liquid .loaded_volume .volume is not None
1471
+ and well_liquid .loaded_volume .last_loaded == last_updated
1472
+ ):
1473
+ return well_liquid .loaded_volume .volume
1474
+ elif (
1475
+ well_liquid .probed_volume is not None
1476
+ and well_liquid .probed_volume .volume is not None
1477
+ and well_liquid .probed_volume .last_probed == last_updated
1478
+ ):
1479
+ return well_liquid .probed_volume .volume
1480
+ else :
1481
+ # This should not happen if there was an update but who knows
1482
+ raise errors .LiquidVolumeUnknownError (
1483
+ f"Unable to find liquid volume despite an update at { last_updated } ."
1484
+ )
1485
+
1443
1486
def get_meniscus_height (
1444
1487
self ,
1445
1488
labware_id : str ,
@@ -1496,7 +1539,7 @@ def get_well_handling_height(
1496
1539
)
1497
1540
return float (handling_height )
1498
1541
1499
- def get_well_height_after_volume (
1542
+ def get_well_height_after_liquid_handling (
1500
1543
self , labware_id : str , well_name : str , initial_height : float , volume : float
1501
1544
) -> float :
1502
1545
"""Return the height of liquid in a labware well after a given volume has been handled.
@@ -1514,6 +1557,28 @@ def get_well_height_after_volume(
1514
1557
target_volume = final_volume , well_geometry = well_geometry
1515
1558
)
1516
1559
1560
+ def get_well_height_after_liquid_handling_no_error (
1561
+ self , labware_id : str , well_name : str , initial_height : float , volume : float
1562
+ ) -> float :
1563
+ """Return what the height of liquid in a labware well after liquid handling will be.
1564
+
1565
+ This raises no error if the value returned is an invalid physical location, so it should never be
1566
+ used for navigation, only for a pre-emptive estimate.
1567
+ """
1568
+ well_geometry = self ._labware .get_well_geometry (
1569
+ labware_id = labware_id , well_name = well_name
1570
+ )
1571
+ initial_volume = find_volume_at_well_height (
1572
+ target_height = initial_height , well_geometry = well_geometry
1573
+ )
1574
+ final_volume = initial_volume + volume
1575
+ well_volume = find_height_at_well_volume (
1576
+ target_volume = final_volume ,
1577
+ well_geometry = well_geometry ,
1578
+ raise_error_if_result_invalid = False ,
1579
+ )
1580
+ return well_volume
1581
+
1517
1582
def get_well_height_at_volume (
1518
1583
self , labware_id : str , well_name : str , volume : float
1519
1584
) -> float :
0 commit comments