diff --git a/test/resources/bioyond_materials_liquidhandling_1.json b/test/resources/bioyond_materials_liquidhandling_1.json index dacf75da..a532fa59 100644 --- a/test/resources/bioyond_materials_liquidhandling_1.json +++ b/test/resources/bioyond_materials_liquidhandling_1.json @@ -74,76 +74,6 @@ ], "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", "typeName": "分装板", @@ -247,19 +177,5 @@ "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": [] } ] \ No newline at end of file diff --git a/test/resources/test_converter_bioyond.py b/test/resources/test_converter_bioyond.py index 01e9f7da..84db8ca5 100644 --- a/test/resources/test_converter_bioyond.py +++ b/test/resources/test_converter_bioyond.py @@ -14,7 +14,7 @@ lab_registry.setup() type_mapping = { "烧杯": "BIOYOND_PolymerStation_1FlaskCarrier", "试剂瓶": "BIOYOND_PolymerStation_1BottleCarrier", - "样品板": "BIOYOND_PolymerStation_6VialCarrier", + "样品板": "BIOYOND_PolymerStation_6StockCarrier", "分装板": "BIOYOND_PolymerStation_6VialCarrier", "样品瓶": "BIOYOND_PolymerStation_Solid_Stock", "90%分装小瓶": "BIOYOND_PolymerStation_Solid_Vial", @@ -22,9 +22,9 @@ type_mapping = { } type_uuid_mapping = { - "烧杯": "BIOYOND_PolymerStation_1FlaskCarrier", - "试剂瓶": "BIOYOND_PolymerStation_1BottleCarrier", - "样品板": "BIOYOND_PolymerStation_6VialCarrier", + "烧杯": "", + "试剂瓶": "", + "样品板": "", "分装板": "3a14196e-5dfe-6e21-0c79-fe2036d052c4", "样品瓶": "3a14196a-cf7d-8aea-48d8-b9662c7dba94", "90%分装小瓶": "3a14196c-cdcf-088d-dc7d-5cf38f0ad9ea", diff --git a/unilabos/registry/resources/bioyond/bottle_carriers.yaml b/unilabos/registry/resources/bioyond/bottle_carriers.yaml index 0eaba1e3..73df9c89 100644 --- a/unilabos/registry/resources/bioyond/bottle_carriers.yaml +++ b/unilabos/registry/resources/bioyond/bottle_carriers.yaml @@ -34,3 +34,16 @@ BIOYOND_PolymerStation_6VialCarrier: init_param_schema: {} registry_type: resource 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 + diff --git a/unilabos/registry/resources/bioyond/bottles.yaml b/unilabos/registry/resources/bioyond/bottles.yaml new file mode 100644 index 00000000..06d45145 --- /dev/null +++ b/unilabos/registry/resources/bioyond/bottles.yaml @@ -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 \ No newline at end of file diff --git a/unilabos/resources/graphio.py b/unilabos/resources/graphio.py index e71c81db..889c92e6 100644 --- a/unilabos/resources/graphio.py +++ b/unilabos/resources/graphio.py @@ -610,10 +610,17 @@ def resource_bioyond_to_plr(bioyond_materials: list[dict], type_mapping: dict = + (detail.get("y", 0) - 1) ) 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.tracker.liquids = [ - (detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0) - ] else: bottle = plr_material[0] if plr_material.capacity > 0 else plr_material bottle.tracker.liquids = [