Skip to content

Commit e79af23

Browse files
committed
Run format
1 parent d8179b0 commit e79af23

File tree

20 files changed

+172
-159
lines changed

20 files changed

+172
-159
lines changed

libs/labelbox/src/labelbox/data/metrics/confusion_matrix/confusion_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _get_metric_name(
9696
if _is_classification(ground_truths, predictions):
9797
return "classification"
9898

99-
return f"{int(iou*100)}pct_iou"
99+
return f"{int(iou * 100)}pct_iou"
100100

101101

102102
def _is_classification(

libs/labelbox/src/labelbox/data/serialization/ndjson/label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def _create_non_video_annotations(cls, label: Label):
187187
yield NDMessageTask.from_common(annotation, label.data)
188188
else:
189189
raise TypeError(
190-
f"Unable to convert object to MAL format. `{type(getattr(annotation, 'value',annotation))}`"
190+
f"Unable to convert object to MAL format. `{type(getattr(annotation, 'value', annotation))}`"
191191
)
192192

193193
@classmethod

libs/labelbox/src/labelbox/orm/db_object.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def _set_field_values(self, field_values):
7676
value = value.replace(tzinfo=timezone.utc)
7777
except ValueError:
7878
logger.warning(
79-
"Failed to convert value '%s' to datetime for "
80-
"field %s",
79+
"Failed to convert value '%s' to datetime for field %s",
8180
value,
8281
field,
8382
)

libs/labelbox/src/labelbox/schema/workflow/filter_converters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def _handle_feature_consensus_average(
358358
if isinstance(annotations[0], str):
359359
# Simple ID list - convert to full format (placeholder names)
360360
annotation_objects = [
361-
{"name": f"Feature {i+1}", "schemaNodeId": ann_id}
361+
{"name": f"Feature {i + 1}", "schemaNodeId": ann_id}
362362
for i, ann_id in enumerate(annotations)
363363
]
364364
else:

libs/labelbox/src/labelbox/schema/workflow/filter_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,27 +84,27 @@ def build_metadata_items(
8484
"""
8585
if item_type == "user":
8686
return [
87-
{key_field: item_id, "email": f"user{i+1}@example.com"}
87+
{key_field: item_id, "email": f"user{i + 1}@example.com"}
8888
for i, item_id in enumerate(ids)
8989
]
9090
elif item_type == "dataset":
9191
return [
92-
{key_field: item_id, "name": f"Dataset {i+1}"}
92+
{key_field: item_id, "name": f"Dataset {i + 1}"}
9393
for i, item_id in enumerate(ids)
9494
]
9595
elif item_type == "annotation":
9696
return [
97-
{"name": f"Annotation {i+1}", "schemaNodeId": item_id}
97+
{"name": f"Annotation {i + 1}", "schemaNodeId": item_id}
9898
for i, item_id in enumerate(ids)
9999
]
100100
elif item_type == "issue":
101101
return [
102-
{key_field: item_id, "name": f"Issue Category {i+1}"}
102+
{key_field: item_id, "name": f"Issue Category {i + 1}"}
103103
for i, item_id in enumerate(ids)
104104
]
105105
else:
106106
return [
107-
{key_field: item_id, "name": f"{item_type.title()} {i+1}"}
107+
{key_field: item_id, "name": f"{item_type.title()} {i + 1}"}
108108
for i, item_id in enumerate(ids)
109109
]
110110

libs/labelbox/src/labelbox/schema/workflow/workflow_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,5 +402,5 @@ def print_filters(workflow: "ProjectWorkflow") -> None:
402402
if isinstance(node, LogicNode):
403403
logger.info(f"Filters for node {node.id} ({node.name}):")
404404
for i, f in enumerate(node.get_parsed_filters()):
405-
logger.info(f" Filter {i+1}:")
405+
logger.info(f" Filter {i + 1}:")
406406
logger.info(f" {json.dumps(f, indent=2)}")

libs/labelbox/tests/conftest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,12 +688,12 @@ def create_label():
688688
predictions,
689689
)
690690
upload_task.wait_until_done(sleep_time_seconds=5)
691-
assert (
692-
upload_task.state == AnnotationImportState.FINISHED
693-
), "Label Import did not finish"
694-
assert (
695-
len(upload_task.errors) == 0
696-
), f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
691+
assert upload_task.state == AnnotationImportState.FINISHED, (
692+
"Label Import did not finish"
693+
)
694+
assert len(upload_task.errors) == 0, (
695+
f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
696+
)
697697

698698
project.create_label = create_label
699699
project.create_label()

libs/labelbox/tests/data/annotation_import/conftest.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,12 +1929,12 @@ def model_run_with_data_rows(
19291929
model_run_predictions,
19301930
)
19311931
upload_task.wait_until_done()
1932-
assert (
1933-
upload_task.state == AnnotationImportState.FINISHED
1934-
), "Label Import did not finish"
1935-
assert (
1936-
len(upload_task.errors) == 0
1937-
), f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
1932+
assert upload_task.state == AnnotationImportState.FINISHED, (
1933+
"Label Import did not finish"
1934+
)
1935+
assert len(upload_task.errors) == 0, (
1936+
f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
1937+
)
19381938
labels = wait_for_label_processing(configured_project)
19391939
label_ids = [label.uid for label in labels]
19401940
model_run.upsert_labels(label_ids)
@@ -1963,12 +1963,12 @@ def model_run_with_all_project_labels(
19631963
model_run_predictions,
19641964
)
19651965
upload_task.wait_until_done()
1966-
assert (
1967-
upload_task.state == AnnotationImportState.FINISHED
1968-
), "Label Import did not finish"
1969-
assert (
1970-
len(upload_task.errors) == 0
1971-
), f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
1966+
assert upload_task.state == AnnotationImportState.FINISHED, (
1967+
"Label Import did not finish"
1968+
)
1969+
assert len(upload_task.errors) == 0, (
1970+
f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
1971+
)
19721972
labels = wait_for_label_processing(configured_project)
19731973
label_ids = [label.uid for label in labels]
19741974
model_run.upsert_labels(label_ids)

libs/labelbox/tests/data/export/conftest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,12 @@ def model_run_with_data_rows(
462462
model_run_predictions,
463463
)
464464
upload_task.wait_until_done()
465-
assert (
466-
upload_task.state == AnnotationImportState.FINISHED
467-
), "Label Import did not finish"
468-
assert (
469-
len(upload_task.errors) == 0
470-
), f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
465+
assert upload_task.state == AnnotationImportState.FINISHED, (
466+
"Label Import did not finish"
467+
)
468+
assert len(upload_task.errors) == 0, (
469+
f"Label Import {upload_task.name} failed with errors {upload_task.errors}"
470+
)
471471
labels = wait_for_label_processing(configured_project_with_ontology)
472472
label_ids = [label.uid for label in labels]
473473
model_run.upsert_labels(label_ids)

libs/labelbox/tests/data/export/streamable/test_export_data_rows_streamable.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ def test_cancel_export_task(
138138
cancelled_task = client.get_task_by_id(export_task.uid)
139139
assert cancelled_task.status in ["CANCELING", "CANCELED"]
140140

141-
@pytest.mark.skip(reason="Test times out in environments with high task volume - querying all org tasks is too slow")
141+
@pytest.mark.skip(
142+
reason="Test times out in environments with high task volume - querying all org tasks is too slow"
143+
)
142144
def test_task_filter(self, client, data_row, wait_for_data_row_processing):
143145
organization = client.get_organization()
144146
user = client.get_user()

0 commit comments

Comments
 (0)