Skip to content

Commit e22265f

Browse files
committed
Formatted files
1 parent 488a02b commit e22265f

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from labelbox.schema.tool_building.types import FeatureSchemaAttributes
2929

3030

31-
3231
class DeleteFeatureFromOntologyResult:
3332
archived: bool
3433
deleted: bool
@@ -45,6 +44,7 @@ class FeatureSchema(DbObject):
4544
color = Field.String("name")
4645
normalized = Field.Json("normalized")
4746

47+
4848
@dataclass
4949
class Tool:
5050
"""
@@ -98,6 +98,7 @@ class Type(Enum):
9898
schema_id: Optional[str] = None
9999
feature_schema_id: Optional[str] = None
100100
attributes: Optional[FeatureSchemaAttributes] = None
101+
101102
@classmethod
102103
def from_dict(cls, dictionary: Dict[str, Any]) -> Dict[str, Any]:
103104
return cls(

libs/labelbox/src/labelbox/schema/tool_building/classification.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
from lbox.exceptions import InconsistentOntologyException
77

8-
from labelbox.schema.tool_building.types import FeatureSchemaId, FeatureSchemaAttributes
8+
from labelbox.schema.tool_building.types import (
9+
FeatureSchemaId,
10+
FeatureSchemaAttributes,
11+
)
912

1013

1114
@dataclass
@@ -91,7 +94,9 @@ def __post_init__(self):
9194
if self.instructions is None:
9295
self.instructions = self.name
9396
if self.attributes is not None:
94-
warnings.warn('Attributes are an experimental feature and may change in the future.')
97+
warnings.warn(
98+
"Attributes are an experimental feature and may change in the future."
99+
)
95100

96101
@classmethod
97102
def from_dict(cls, dictionary: Dict[str, Any]) -> "Classification":
@@ -123,7 +128,9 @@ def asdict(self, is_subclass: bool = False) -> Dict[str, Any]:
123128
"options": [o.asdict() for o in self.options],
124129
"schemaNodeId": self.schema_id,
125130
"featureSchemaId": self.feature_schema_id,
126-
"attributes": self.attributes if self.attributes is not None else None,
131+
"attributes": self.attributes
132+
if self.attributes is not None
133+
else None,
127134
}
128135
if (
129136
self.class_type == self.Type.RADIO

libs/labelbox/src/labelbox/schema/tool_building/types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ class FeatureSchemaAttribute(TypedDict):
77
attributeName: str
88
attributeValue: str
99

10+
1011
FeatureSchemaAttriubte = Annotated[FeatureSchemaAttribute, Field()]
1112

1213
FeatureSchemaId = Annotated[str, Field(min_length=25, max_length=25)]
1314
SchemaId = Annotated[str, Field(min_length=25, max_length=25)]
14-
FeatureSchemaAttributes = Annotated[List[FeatureSchemaAttribute], Field(default_factory=list)]
15+
FeatureSchemaAttributes = Annotated[
16+
List[FeatureSchemaAttribute], Field(default_factory=list)
17+
]

libs/labelbox/tests/unit/test_unit_ontology.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"color": "#FF0000",
1616
"tool": "polygon",
1717
"classifications": [],
18-
"attributes": None
18+
"attributes": None,
1919
},
2020
{
2121
"schemaNodeId": None,
@@ -25,7 +25,7 @@
2525
"color": "#FF0000",
2626
"tool": "superpixel",
2727
"classifications": [],
28-
"attributes": None
28+
"attributes": None,
2929
},
3030
{
3131
"schemaNodeId": None,
@@ -59,7 +59,7 @@
5959
"name": "nested nested text",
6060
"type": "text",
6161
"options": [],
62-
"attributes": None
62+
"attributes": None,
6363
}
6464
],
6565
},
@@ -71,7 +71,7 @@
7171
"options": [],
7272
},
7373
],
74-
"attributes": None
74+
"attributes": None,
7575
},
7676
{
7777
"schemaNodeId": None,
@@ -81,7 +81,7 @@
8181
"name": "nested text",
8282
"type": "text",
8383
"options": [],
84-
"attributes": None
84+
"attributes": None,
8585
},
8686
],
8787
},
@@ -93,7 +93,7 @@
9393
"color": "#FF0000",
9494
"tool": "point",
9595
"classifications": [],
96-
"attributes": None
96+
"attributes": None,
9797
},
9898
{
9999
"schemaNodeId": None,
@@ -103,7 +103,7 @@
103103
"color": "#FF0000",
104104
"tool": "line",
105105
"classifications": [],
106-
"attributes": None
106+
"attributes": None,
107107
},
108108
{
109109
"schemaNodeId": None,
@@ -113,7 +113,7 @@
113113
"color": "#FF0000",
114114
"tool": "named-entity",
115115
"classifications": [],
116-
"attributes": None
116+
"attributes": None,
117117
},
118118
],
119119
"classifications": [

libs/labelbox/tests/unit/test_unit_prompt_issue_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_as_dict():
4747
"schemaNodeId": None,
4848
"featureSchemaId": None,
4949
"scope": "global",
50-
"attributes": None
50+
"attributes": None,
5151
}
5252
],
5353
"color": None,

0 commit comments

Comments
 (0)