Skip to content

Commit bc58caa

Browse files
committed
Fix lint
1 parent 19b65bd commit bc58caa

File tree

2 files changed

+42
-17
lines changed

2 files changed

+42
-17
lines changed

labelbox/data/annotation_types/classification/classification.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ def __init__(self, **data: Any):
9393
"removed in a future release")
9494

9595

96-
class ClassificationAnnotation(BaseAnnotation, ConfidenceMixin, CustomMetricsMixin):
96+
class ClassificationAnnotation(BaseAnnotation, ConfidenceMixin,
97+
CustomMetricsMixin):
9798
"""Classification annotations (non localized)
9899
99100
>>> ClassificationAnnotation(

tests/data/annotation_types/classification/test_classification.py

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ def test_classification_answer():
1313
feature_schema_id = "schema_id"
1414
name = "my_feature"
1515
confidence = 0.9
16-
custom_metrics = [{ 'name': 'metric1', 'value': 2 }]
17-
answer = ClassificationAnswer(
18-
name=name,
19-
confidence=confidence,
20-
custom_metrics=custom_metrics)
16+
custom_metrics = [{'name': 'metric1', 'value': 2}]
17+
answer = ClassificationAnswer(name=name,
18+
confidence=confidence,
19+
custom_metrics=custom_metrics)
2120

2221
assert answer.feature_schema_id is None
2322
assert answer.name == name
@@ -89,10 +88,12 @@ def test_subclass():
8988

9089

9190
def test_radio():
92-
answer = ClassificationAnswer(
93-
name="1",
94-
confidence=0.81,
95-
custom_metrics=[{ 'name': 'metric1', 'value': 0.99 }])
91+
answer = ClassificationAnswer(name="1",
92+
confidence=0.81,
93+
custom_metrics=[{
94+
'name': 'metric1',
95+
'value': 0.99
96+
}])
9697
feature_schema_id = "feature_schema_id"
9798
name = "my_feature"
9899

@@ -109,34 +110,51 @@ def test_radio():
109110
'feature_schema_id': None,
110111
'extra': {},
111112
'confidence': 0.81,
112-
'custom_metrics': [{ 'name': 'metric1', 'value': 0.99 }],
113+
'custom_metrics': [{
114+
'name': 'metric1',
115+
'value': 0.99
116+
}],
113117
}
114118
}
115119
classification = ClassificationAnnotation(
116120
value=Radio(answer=answer),
117121
feature_schema_id=feature_schema_id,
118122
name=name,
119-
custom_metrics=[{ 'name': 'metric1', 'value': 0.99 }])
123+
custom_metrics=[{
124+
'name': 'metric1',
125+
'value': 0.99
126+
}])
120127
assert classification.dict() == {
121128
'name': name,
122129
'feature_schema_id': feature_schema_id,
123130
'extra': {},
124-
'custom_metrics': [{ 'name': 'metric1', 'value': 0.99 }],
131+
'custom_metrics': [{
132+
'name': 'metric1',
133+
'value': 0.99
134+
}],
125135
'value': {
126136
'answer': {
127137
'name': answer.name,
128138
'feature_schema_id': None,
129139
'extra': {},
130140
'confidence': 0.81,
131-
'custom_metrics': [{ 'name': 'metric1', 'value': 0.99 }]
141+
'custom_metrics': [{
142+
'name': 'metric1',
143+
'value': 0.99
144+
}]
132145
},
133146
},
134147
'message_id': None,
135148
}
136149

137150

138151
def test_checklist():
139-
answer = ClassificationAnswer(name="1", confidence=0.99, custom_metrics=[{ 'name': 'metric1', 'value': 2 }])
152+
answer = ClassificationAnswer(name="1",
153+
confidence=0.99,
154+
custom_metrics=[{
155+
'name': 'metric1',
156+
'value': 2
157+
}])
140158
feature_schema_id = "feature_schema_id"
141159
name = "my_feature"
142160

@@ -153,7 +171,10 @@ def test_checklist():
153171
'feature_schema_id': None,
154172
'extra': {},
155173
'confidence': 0.99,
156-
'custom_metrics': [{ 'name': 'metric1', 'value': 2 }],
174+
'custom_metrics': [{
175+
'name': 'metric1',
176+
'value': 2
177+
}],
157178
}]
158179
}
159180
classification = ClassificationAnnotation(
@@ -171,7 +192,10 @@ def test_checklist():
171192
'feature_schema_id': None,
172193
'extra': {},
173194
'confidence': 0.99,
174-
'custom_metrics': [{ 'name': 'metric1', 'value': 2 }],
195+
'custom_metrics': [{
196+
'name': 'metric1',
197+
'value': 2
198+
}],
175199
}]
176200
},
177201
'message_id': None,

0 commit comments

Comments
 (0)