Skip to content

Commit 94485bb

Browse files
authored
[PTDT-5210] Add Tool.Type.MARKER for marker ontologies (#2067)
1 parent 6a9a8e3 commit 94485bb

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

libs/labelbox/src/labelbox/schema/ontology.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class Type(Enum):
9494
MESSAGE_SINGLE_SELECTION = "message-single-selection"
9595
MESSAGE_MULTI_SELECTION = "message-multi-selection"
9696
MESSAGE_RANKING = "message-ranking"
97+
MARKER = "marker"
9798

9899
tool: Type
99100
name: str

libs/labelbox/tests/unit/test_unit_ontology.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,24 @@ def test_create_tool(tool_type) -> None:
164164
assert t.tool == tool_type
165165

166166

167+
def test_marker_tool_from_dict_asdict_round_trip() -> None:
168+
marker = {
169+
"schemaNodeId": "marker-schema-node",
170+
"featureSchemaId": "marker-feature-schema",
171+
"required": False,
172+
"name": "Scene boundary",
173+
"color": "#FF0000",
174+
"tool": "marker",
175+
"classifications": [],
176+
"attributes": None,
177+
}
178+
179+
tool = Tool.from_dict(marker)
180+
181+
assert tool.tool is Tool.Type.MARKER
182+
assert tool.asdict() == marker
183+
184+
167185
@pytest.mark.parametrize("class_type", list(Classification.Type))
168186
def test_create_classification(class_type) -> None:
169187
c = Classification(class_type=class_type, name="classification")

0 commit comments

Comments
 (0)