Skip to content

Commit 5ec7688

Browse files
committed
Update rig.py
1 parent 2755883 commit 5ec7688

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/aind_data_schema/rig.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from datetime import date
66
from typing import List, Optional, Union
77

8+
import json
9+
810
from pydantic import Field, root_validator
911
from pydantic.typing import Annotated
1012

@@ -144,9 +146,14 @@ def validate_device_names(cls, values): # noqa: C901
144146
device_names = [None]
145147

146148
for field in to_check:
147-
if values.get(field) is not None:
148-
print(values.get(field))
149-
device_names += [device.name for device in values.get(field)]
149+
v = values.get(field)
150+
if v is not None:
151+
if isinstance(v, list):
152+
device_names += [json.dumps(device) for device in values.get(field)]
153+
else:
154+
device_names += [v.name]
155+
156+
print(device_names)
150157

151158
if cameras is not None:
152159
device_names += [c.camera.name for c in cameras]

0 commit comments

Comments
 (0)