Skip to content

Commit 9c1e4e5

Browse files
Formatting
1 parent 8113586 commit 9c1e4e5

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

labelbox/schema/model.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,5 @@ def delete_model(self):
4343
"""
4444
ids_param = "ids"
4545
query_str = """mutation DeleteModelPyApi($%s: ID!) {
46-
deleteModels(where: {ids: [$%s]})}""" % (
47-
ids_param, ids_param
48-
)
49-
self.client.execute(query_str, {
50-
ids_param: str(self.uid)
51-
})
46+
deleteModels(where: {ids: [$%s]})}""" % (ids_param, ids_param)
47+
self.client.execute(query_str, {ids_param: str(self.uid)})

labelbox/schema/model_run.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def add_predictions(
5353
return MEAPredictionImport.create_from_file(
5454
path=str(predictions), **kwargs)
5555
else:
56-
return MEAPredictionImport.create_from_url(url=str(predictions),
57-
**kwargs)
56+
return MEAPredictionImport.create_from_url(
57+
url=str(predictions), **kwargs)
5858
elif isinstance(predictions, Iterable):
5959
return MEAPredictionImport.create_from_objects(
6060
predictions=predictions, **kwargs)
@@ -82,12 +82,8 @@ def delete_model_run(self):
8282
"""
8383
ids_param = "ids"
8484
query_str = """mutation DeleteModelRunPyApi($%s: ID!) {
85-
deleteModelRuns(where: {ids: [$%s]})}""" % (
86-
ids_param, ids_param
87-
)
88-
self.client.execute(query_str, {
89-
ids_param: str(self.uid)
90-
})
85+
deleteModelRuns(where: {ids: [$%s]})}""" % (ids_param, ids_param)
86+
self.client.execute(query_str, {ids_param: str(self.uid)})
9187

9288
def delete_annotation_groups(self, data_row_ids):
9389
""" Deletes annotation groups by data row ids for a model run.
@@ -101,8 +97,8 @@ def delete_annotation_groups(self, data_row_ids):
10197
data_row_ids_param = "dataRowIds"
10298
query_str = """mutation DeleteModelRunDataRowsPyApi($%s: ID!, $%s: [ID!]!) {
10399
deleteModelRunDataRows(where: {modelRunId: $%s, dataRowIds: $%s})}""" % (
104-
model_run_id_param, data_row_ids_param, model_run_id_param, data_row_ids_param
105-
)
100+
model_run_id_param, data_row_ids_param, model_run_id_param,
101+
data_row_ids_param)
106102
self.client.execute(query_str, {
107103
model_run_id_param: self.uid,
108104
data_row_ids_param: data_row_ids
@@ -123,4 +119,3 @@ def url(self):
123119
app_url = self.client.app_url
124120
endpoint = f"{app_url}/models/{self.model_id}/{self.model_run_id}/AllDatarowsSlice/{self.uid}?view=carousel"
125121
return endpoint
126-

tests/integration/mal_and_mea/test_model_run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,19 @@ def test_model_run_delete(client, model_run):
3939
assert len(before) == len(after) + 1
4040

4141

42-
def test_model_run_annotation_groups_delete(client, model_run_annotation_groups):
42+
def test_model_run_annotation_groups_delete(client,
43+
model_run_annotation_groups):
4344
models = list(client.get_models())
4445
model = models[0]
4546
model_runs = list(model.model_runs())
4647
model_run = model_runs[0]
4748

4849
before = list(model_run.annotation_groups())
4950
annotation_group = before[0]
50-
51+
5152
data_row_id = annotation_group.data_row().uid
5253
model_run.delete_annotation_groups(data_row_ids=[data_row_id])
5354

5455
after = list(model_run.annotation_groups())
55-
56+
5657
assert len(before) == len(after) + 1

0 commit comments

Comments
 (0)