Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/labelbox/src/labelbox/schema/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class Type(Enum):
MESSAGE_SINGLE_SELECTION = "message-single-selection"
MESSAGE_MULTI_SELECTION = "message-multi-selection"
MESSAGE_RANKING = "message-ranking"
MARKER = "marker"

tool: Type
name: str
Expand Down
18 changes: 18 additions & 0 deletions libs/labelbox/tests/unit/test_unit_ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@ def test_create_tool(tool_type) -> None:
assert t.tool == tool_type


def test_marker_tool_from_dict_asdict_round_trip() -> None:
marker = {
"schemaNodeId": "marker-schema-node",
"featureSchemaId": "marker-feature-schema",
"required": False,
"name": "Scene boundary",
"color": "#FF0000",
"tool": "marker",
"classifications": [],
"attributes": None,
}

tool = Tool.from_dict(marker)

assert tool.tool is Tool.Type.MARKER
assert tool.asdict() == marker


@pytest.mark.parametrize("class_type", list(Classification.Type))
def test_create_classification(class_type) -> None:
c = Classification(class_type=class_type, name="classification")
Expand Down
Loading