Skip to content

Commit 80cb69d

Browse files
committed
Change decorator
1 parent bc5f287 commit 80cb69d

File tree

18 files changed

+167
-126
lines changed

18 files changed

+167
-126
lines changed

superannotate/analytics/class_analytics.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
from plotly.subplots import make_subplots
99

1010
from .common import aggregate_annotations_as_df
11-
from ..mixp.decorators import trackable
11+
from ..mixp.decorators import Trackable
12+
1213
logger = logging.getLogger("superannotate-python-sdk")
1314

14-
@trackable
15+
16+
@Trackable
1517
def class_distribution(export_root, project_names, visualize=False):
1618
"""Aggregate distribution of classes across multiple projects.
1719
@@ -63,7 +65,7 @@ def class_distribution(export_root, project_names, visualize=False):
6365
return df
6466

6567

66-
@trackable
68+
@Trackable
6769
def attribute_distribution(export_root, project_names, visualize=False):
6870
"""Aggregate distribution of attributes across multiple projects.
6971

superannotate/analytics/common.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
import pandas as pd
77

88
from ..exceptions import SABaseException
9-
from ..mixp.decorators import trackable
9+
from ..mixp.decorators import Trackable
10+
1011
logger = logging.getLogger("superannotate-python-sdk")
1112

12-
@trackable
13+
14+
@Trackable
1315
def df_to_annotations(df, output_dir):
1416
"""Converts and saves pandas DataFrame annotation info (see aggregate_annotations_as_df)
1517
in output_dir.
@@ -147,7 +149,8 @@ def df_to_annotations(df, output_dir):
147149
indent=4
148150
)
149151

150-
@trackable
152+
153+
@Trackable
151154
def aggregate_annotations_as_df(
152155
project_root,
153156
include_classes_wo_annotations=False,

superannotate/consensus_benchmark/benchmark.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
from .helpers import image_consensus, consensus_plot
1010
from ..db.exports import prepare_export, download_export
1111
from ..analytics.common import aggregate_annotations_as_df
12-
from ..mixp.decorators import trackable
12+
from ..mixp.decorators import Trackable
1313

1414
logger = logging.getLogger("superannotate-python-sdk")
1515

1616

17-
@trackable
17+
@Trackable
1818
def benchmark(
1919
project,
2020
gt_folder,

superannotate/consensus_benchmark/consensus.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
from .helpers import image_consensus, consensus_plot
1010
from ..db.exports import prepare_export, download_export
1111
from ..analytics.common import aggregate_annotations_as_df
12-
from ..mixp.decorators import trackable
12+
from ..mixp.decorators import Trackable
1313

1414
logger = logging.getLogger("superannotate-python-sdk")
1515

1616

17-
@trackable
17+
@Trackable
1818
def consensus(
1919
project,
2020
folder_names,

superannotate/dataframe_filtering.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import pandas as pd
2-
from .mixp.decorators import trackable
2+
from .mixp.decorators import Trackable
33

4-
@trackable
4+
5+
@Trackable
56
def filter_images_by_comments(
67
annotations_df,
78
include_unresolved_comments=True,
@@ -40,7 +41,8 @@ def filter_images_by_comments(
4041

4142
return list(images)
4243

43-
@trackable
44+
45+
@Trackable
4446
def filter_images_by_tags(annotations_df, include=None, exclude=None):
4547
"""Filter images on tags
4648
@@ -74,7 +76,8 @@ def filter_images_by_tags(annotations_df, include=None, exclude=None):
7476

7577
return list(images)
7678

77-
@trackable
79+
80+
@Trackable
7881
def filter_annotation_instances(annotations_df, include=None, exclude=None):
7982
"""Filter annotation instances from project annotations pandas DataFrame.
8083

superannotate/db/annotation_classes.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
SANonExistingAnnotationClassNameException
1212
)
1313
from .project_api import get_project_metadata_bare
14-
from ..mixp.decorators import trackable
14+
from ..mixp.decorators import Trackable
15+
1516
logger = logging.getLogger("superannotate-python-sdk")
1617

1718
_api = API.get_instance()
1819

19-
@trackable
20+
21+
@Trackable
2022
def create_annotation_class(project, name, color, attribute_groups=None):
2123
"""Create annotation class in project
2224
@@ -78,7 +80,8 @@ def create_annotation_class(project, name, color, attribute_groups=None):
7880
new_class = res[0]
7981
return new_class
8082

81-
@trackable
83+
84+
@Trackable
8285
def delete_annotation_class(project, annotation_class):
8386
"""Deletes annotation class from project
8487
@@ -112,7 +115,8 @@ def delete_annotation_class(project, annotation_class):
112115
"Couldn't delete annotation class " + response.text
113116
)
114117

115-
@trackable
118+
119+
@Trackable
116120
def create_annotation_classes_from_classes_json(
117121
project, classes_json, from_s3_bucket=None
118122
):
@@ -199,7 +203,8 @@ def del_unn(d):
199203
assert len(res) == len(new_classes)
200204
return res
201205

202-
@trackable
206+
207+
@Trackable
203208
def search_annotation_classes(project, name_prefix=None):
204209
"""Searches annotation classes by name_prefix (case-insensitive)
205210
@@ -238,7 +243,8 @@ def search_annotation_classes(project, name_prefix=None):
238243

239244
return result_list
240245

241-
@trackable
246+
247+
@Trackable
242248
def get_annotation_class_metadata(project, annotation_class_name):
243249
"""Returns annotation class metadata
244250
@@ -271,7 +277,8 @@ def get_annotation_class_metadata(project, annotation_class_name):
271277
" doesn't exist."
272278
)
273279

274-
@trackable
280+
281+
@Trackable
275282
def download_annotation_classes_json(project, folder):
276283
"""Downloads project classes.json to folder
277284

superannotate/db/exports.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
SANonExistingExportNameException
2020
)
2121
from .project_api import get_project_metadata_bare
22-
from ..mixp.decorators import trackable
22+
from ..mixp.decorators import Trackable
2323

2424
logger = logging.getLogger("superannotate-python-sdk")
2525

@@ -57,7 +57,7 @@ def get_export_metadata(project, export_name):
5757
)
5858

5959

60-
@trackable
60+
@Trackable
6161
def get_exports(project, return_metadata=False):
6262
"""Get all prepared exports of the project.
6363
@@ -99,7 +99,7 @@ def _get_export(export):
9999
return response.json()
100100

101101

102-
@trackable
102+
@Trackable
103103
def prepare_export(
104104
project,
105105
folder_names=None,
@@ -222,7 +222,7 @@ def _download_file(url, local_filename):
222222
return local_filename
223223

224224

225-
@trackable
225+
@Trackable
226226
def download_export(
227227
project, export, folder_path, extract_zip_contents=True, to_s3_bucket=None
228228
):

0 commit comments

Comments
 (0)