pass the tests

This commit is contained in:
Junhan Chang
2025-10-11 07:20:34 +08:00
parent 88c4d1a9d1
commit 25d46dc9d5
5 changed files with 51 additions and 91 deletions

View File

@@ -74,76 +74,6 @@
], ],
"detail": [] "detail": []
}, },
{
"id": "3a1cdefe-d5e0-3fa1-cc72-fda6276ae38d",
"typeName": "10%分装小瓶",
"code": "0005-00513",
"barCode": "",
"name": "10%分装小瓶",
"quantity": 1.0,
"lockQuantity": 1.0,
"unit": "个",
"status": 1,
"isUse": false,
"locations": [],
"detail": []
},
{
"id": "3a1cdefe-d5e0-561f-73b6-f8501f814dbb",
"typeName": "90%分装小瓶",
"code": "0006-00497",
"barCode": "",
"name": "90%分装小瓶",
"quantity": 1.0,
"lockQuantity": 1.0,
"unit": "个",
"status": 1,
"isUse": false,
"locations": [],
"detail": []
},
{
"id": "3a1cdefe-d5e0-81cf-7dad-2e51cab9ffd6",
"typeName": "90%分装小瓶",
"code": "0006-00496",
"barCode": "",
"name": "90%分装小瓶",
"quantity": 1.0,
"lockQuantity": 1.0,
"unit": "个",
"status": 1,
"isUse": false,
"locations": [],
"detail": []
},
{
"id": "3a1cdefe-d5e0-94ae-f770-27847e73ad38",
"typeName": "90%分装小瓶",
"code": "0006-00498",
"barCode": "",
"name": "90%分装小瓶",
"quantity": 1.0,
"lockQuantity": 1.0,
"unit": "个",
"status": 1,
"isUse": false,
"locations": [],
"detail": []
},
{
"id": "3a1cdefe-d5e0-c632-c7da-02d385b18628",
"typeName": "10%分装小瓶",
"code": "0005-00514",
"barCode": "",
"name": "10%分装小瓶",
"quantity": 1.0,
"lockQuantity": 1.0,
"unit": "个",
"status": 1,
"isUse": false,
"locations": [],
"detail": []
},
{ {
"id": "3a1cdefe-d5e0-d850-5439-4499f20f07fe", "id": "3a1cdefe-d5e0-d850-5439-4499f20f07fe",
"typeName": "分装板", "typeName": "分装板",
@@ -247,19 +177,5 @@
"associateId": null "associateId": null
} }
] ]
},
{
"id": "3a1cdefe-d5e0-f2fa-66bf-94c565d852fb",
"typeName": "10%分装小瓶",
"code": "0005-00515",
"barCode": "",
"name": "10%分装小瓶",
"quantity": 1.0,
"lockQuantity": 1.0,
"unit": "个",
"status": 1,
"isUse": false,
"locations": [],
"detail": []
} }
] ]

View File

@@ -14,7 +14,7 @@ lab_registry.setup()
type_mapping = { type_mapping = {
"烧杯": "BIOYOND_PolymerStation_1FlaskCarrier", "烧杯": "BIOYOND_PolymerStation_1FlaskCarrier",
"试剂瓶": "BIOYOND_PolymerStation_1BottleCarrier", "试剂瓶": "BIOYOND_PolymerStation_1BottleCarrier",
"样品板": "BIOYOND_PolymerStation_6VialCarrier", "样品板": "BIOYOND_PolymerStation_6StockCarrier",
"分装板": "BIOYOND_PolymerStation_6VialCarrier", "分装板": "BIOYOND_PolymerStation_6VialCarrier",
"样品瓶": "BIOYOND_PolymerStation_Solid_Stock", "样品瓶": "BIOYOND_PolymerStation_Solid_Stock",
"90%分装小瓶": "BIOYOND_PolymerStation_Solid_Vial", "90%分装小瓶": "BIOYOND_PolymerStation_Solid_Vial",
@@ -22,9 +22,9 @@ type_mapping = {
} }
type_uuid_mapping = { type_uuid_mapping = {
"烧杯": "BIOYOND_PolymerStation_1FlaskCarrier", "烧杯": "",
"试剂瓶": "BIOYOND_PolymerStation_1BottleCarrier", "试剂瓶": "",
"样品板": "BIOYOND_PolymerStation_6VialCarrier", "样品板": "",
"分装板": "3a14196e-5dfe-6e21-0c79-fe2036d052c4", "分装板": "3a14196e-5dfe-6e21-0c79-fe2036d052c4",
"样品瓶": "3a14196a-cf7d-8aea-48d8-b9662c7dba94", "样品瓶": "3a14196a-cf7d-8aea-48d8-b9662c7dba94",
"90%分装小瓶": "3a14196c-cdcf-088d-dc7d-5cf38f0ad9ea", "90%分装小瓶": "3a14196c-cdcf-088d-dc7d-5cf38f0ad9ea",

View File

@@ -34,3 +34,16 @@ BIOYOND_PolymerStation_6VialCarrier:
init_param_schema: {} init_param_schema: {}
registry_type: resource registry_type: resource
version: 1.0.0 version: 1.0.0
BIOYOND_PolymerStation_6StockCarrier:
category:
- bottle_carriers
class:
module: unilabos.resources.bioyond.bottle_carriers:BIOYOND_PolymerStation_6StockCarrier
type: pylabrobot
description: BIOYOND_PolymerStation_6StockCarrier
handles: []
icon: ''
init_param_schema: {}
registry_type: resource
version: 1.0.0

View File

@@ -0,0 +1,24 @@
BIOYOND_PolymerStation_Solid_Stock:
class:
module: unilabos.resources.bioyond.bottles:BIOYOND_PolymerStation_Solid_Stock
type: pylabrobot
BIOYOND_PolymerStation_Solid_Vial:
class:
module: unilabos.resources.bioyond.bottles:BIOYOND_PolymerStation_Solid_Vial
type: pylabrobot
BIOYOND_PolymerStation_Liquid_Vial:
class:
module: unilabos.resources.bioyond.bottles:BIOYOND_PolymerStation_Liquid_Vial
type: pylabrobot
BIOYOND_PolymerStation_Solution_Beaker:
class:
module: unilabos.resources.bioyond.bottles:BIOYOND_PolymerStation_Solution_Beaker
type: pylabrobot
BIOYOND_PolymerStation_Reagent_Bottle:
class:
module: unilabos.resources.bioyond.bottles:BIOYOND_PolymerStation_Reagent_Bottle
type: pylabrobot

View File

@@ -610,10 +610,17 @@ def resource_bioyond_to_plr(bioyond_materials: list[dict], type_mapping: dict =
+ (detail.get("y", 0) - 1) + (detail.get("y", 0) - 1)
) )
bottle = plr_material[number] bottle = plr_material[number]
if detail["name"] in type_mapping:
# plr_material.unassign_child_resource(bottle)
plr_material.sites[number] = None
plr_material[number] = initialize_resource(
{"name": f'{detail["name"]}_{number}', "class": type_mapping[detail["name"]]}, resource_type=ResourcePLR
)
else:
bottle.tracker.liquids = [
(detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0)
]
bottle.code = detail.get("code", "") bottle.code = detail.get("code", "")
bottle.tracker.liquids = [
(detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0)
]
else: else:
bottle = plr_material[0] if plr_material.capacity > 0 else plr_material bottle = plr_material[0] if plr_material.capacity > 0 else plr_material
bottle.tracker.liquids = [ bottle.tracker.liquids = [