mirror of
https://github.com/deepmodeling/Uni-Lab-OS
synced 2026-04-23 11:19:59 +00:00
fix(bioyond): fix order name type and prep bottle max volumes
bioyond_cell: Ensure order_name is cast to str and fix mix_time handling for single int/float values. YB_bottles: Fix max_volume capacity for 15mL and 60mL prep bottles to match their names.
This commit is contained in:
@@ -1087,9 +1087,9 @@ class BioyondCellWorkstation(BioyondWorkstation):
|
|||||||
for idx, item in enumerate(formulation):
|
for idx, item in enumerate(formulation):
|
||||||
materials = item.get("materials", []) + item.get("liquids", []) # 兼容两种物料列表命名
|
materials = item.get("materials", []) + item.get("liquids", []) # 兼容两种物料列表命名
|
||||||
if idx < len(order_names) and order_names[idx]:
|
if idx < len(order_names) and order_names[idx]:
|
||||||
order_name = order_names[idx]
|
order_name = str(order_names[idx])
|
||||||
else:
|
else:
|
||||||
order_name = item.get("order_name", f"{batch_id}_order_{idx + 1}")
|
order_name = str(item.get("order_name", f"{batch_id}_order_{idx + 1}"))
|
||||||
|
|
||||||
mats: List[Dict[str, Any]] = []
|
mats: List[Dict[str, Any]] = []
|
||||||
total_mass = 0.0
|
total_mass = 0.0
|
||||||
@@ -1104,7 +1104,10 @@ class BioyondCellWorkstation(BioyondWorkstation):
|
|||||||
logger.warning(f"[create_orders_formulation] 第 {idx + 1} 个配方无有效物料,跳过")
|
logger.warning(f"[create_orders_formulation] 第 {idx + 1} 个配方无有效物料,跳过")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
raw_mix_time = mix_time[idx] if idx < len(mix_time) else None
|
if isinstance(mix_time, (int, float)):
|
||||||
|
raw_mix_time = mix_time
|
||||||
|
else:
|
||||||
|
raw_mix_time = mix_time[idx] if idx < len(mix_time) else None
|
||||||
try:
|
try:
|
||||||
item_mix_time = int(raw_mix_time) if raw_mix_time not in (None, "", "null") else 0
|
item_mix_time = int(raw_mix_time) if raw_mix_time not in (None, "", "null") else 0
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ def YB_PrepBottle_15mL(
|
|||||||
name: str,
|
name: str,
|
||||||
diameter: float = 35.0,
|
diameter: float = 35.0,
|
||||||
height: float = 60.0,
|
height: float = 60.0,
|
||||||
max_volume: float = 30000.0, # 30mL
|
max_volume: float = 15000.0, # 15mL
|
||||||
barcode: str = None,
|
barcode: str = None,
|
||||||
) -> Bottle:
|
) -> Bottle:
|
||||||
"""创建配液瓶(小)"""
|
"""创建配液瓶(小)"""
|
||||||
@@ -149,7 +149,7 @@ def YB_PrepBottle_60mL(
|
|||||||
name: str,
|
name: str,
|
||||||
diameter: float = 55.0,
|
diameter: float = 55.0,
|
||||||
height: float = 100.0,
|
height: float = 100.0,
|
||||||
max_volume: float = 150000.0, # 150mL
|
max_volume: float = 60000.0, # 60mL
|
||||||
barcode: str = None,
|
barcode: str = None,
|
||||||
) -> Bottle:
|
) -> Bottle:
|
||||||
"""创建配液瓶(大)"""
|
"""创建配液瓶(大)"""
|
||||||
|
|||||||
Reference in New Issue
Block a user