Skip to content

Commit 1d901a9

Browse files
authored
Merge pull request #489 from superannotateai/friday_cleanup
cleanup
2 parents ed72695 + 63cff37 commit 1d901a9

File tree

17 files changed

+13
-2543
lines changed

17 files changed

+13
-2543
lines changed

requirements_dev.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

requirements_prod.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,16 @@ def get_version():
1212

1313
sdk_version = get_version()
1414

15-
16-
requirements_path = "requirements_{}.txt".format('dev' if 'dev' in sdk_version else 'prod')
17-
1815
requirements = []
1916

2017
with open("requirements.txt") as f:
2118
requirements.extend(f.read().splitlines())
2219

23-
with open(requirements_path) as f:
24-
requirements.extend(f.read().splitlines())
25-
26-
2720
with open('README.md') as f:
2821
readme = f.read()
2922

3023
readme = "\n".join(readme.split('\n')[2:])
3124

32-
3325
setup(
3426
name='superannotate',
3527
version=sdk_version,

src/superannotate/lib/core/entities/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@
1818
from lib.core.entities.project_entities import TeamEntity
1919
from lib.core.entities.project_entities import UserEntity
2020
from lib.core.entities.project_entities import WorkflowEntity
21-
from superannotate_schemas.schemas.internal.document import DocumentAnnotation
22-
from superannotate_schemas.schemas.internal.pixel import PixelAnnotation
23-
from superannotate_schemas.schemas.internal.vector import VectorAnnotation
24-
from superannotate_schemas.schemas.internal.video import VideoAnnotation
25-
from superannotate_schemas.schemas.internal.video import (
26-
VideoAnnotation as VideoExportAnnotation,
27-
)
21+
2822

2923
# from lib.core.entities.project_entities import ProjectEntity
3024

src/superannotate/lib/core/entities/project_entities.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@
55
from typing import List
66
from typing import Union
77

8-
from lib.core.enums import ClassTypeEnum
98
from lib.core.enums import SegmentationStatus
10-
from superannotate_schemas.schemas.classes import AnnotationClass
11-
12-
13-
class AnnotationClassEntity(AnnotationClass):
14-
def deserialize(self):
15-
data = self.dict()
16-
data["type"] = ClassTypeEnum.get_value(data["type"])
17-
return data
189

1910

2011
class BaseEntity(ABC):

src/superannotate/lib/core/reporter.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ def disable_warnings(self):
7979
def disable_info(self):
8080
self._log_info = False
8181

82-
def enable_warnings(self):
83-
self._log_warning = True
84-
8582
def enable_info(self):
8683
self._log_info = True
8784

@@ -127,14 +124,6 @@ def update_progress(self, value: int = 1):
127124
if self.progress_bar:
128125
self.progress_bar.update(value)
129126

130-
def generate_report(self) -> str:
131-
report = ""
132-
if self.info_messages:
133-
report += "\n".join(self.info_messages)
134-
if self.warning_messages:
135-
report += "\n".join(self.warning_messages)
136-
return report
137-
138127
def store_message(self, key: str, value: str):
139128
self.custom_messages[key].add(value)
140129

src/superannotate/lib/core/response.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ def report(self):
2727
def report(self, value: str):
2828
self._report.append(value)
2929

30-
@property
31-
def report_messages(self):
32-
return self._report
33-
3430
@property
3531
def status(self):
3632
return self._status

src/superannotate/lib/core/serviceproviders.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,6 @@ def set_project_workflow_attributes_bulk(
242242
):
243243
raise NotImplementedError
244244

245-
def get_pre_annotation_upload_data(
246-
self, project_id: int, team_id: int, image_ids: List[int], folder_id: int
247-
):
248-
raise NotImplementedError
249-
250245
def get_annotation_upload_data(
251246
self, project_id: int, team_id: int, image_ids: List[int], folder_id: int
252247
) -> ServiceResponse:

src/superannotate/lib/core/usecases/images.py

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -50,55 +50,6 @@
5050
logger = get_default_logger()
5151

5252

53-
class GetImagesUseCase(BaseUseCase):
54-
def __init__(
55-
self,
56-
project: ProjectEntity,
57-
folder: FolderEntity,
58-
images: BaseReadOnlyRepository,
59-
annotation_status: str = None,
60-
image_name_prefix: str = None,
61-
):
62-
super().__init__()
63-
self._project = project
64-
self._folder = folder
65-
self._images = images
66-
self._annotation_status = annotation_status
67-
self._image_name_prefix = image_name_prefix
68-
69-
def validate_project_type(self):
70-
if self._project.type in constances.LIMITED_FUNCTIONS:
71-
raise AppValidationException(
72-
constances.LIMITED_FUNCTIONS[self._project.type]
73-
)
74-
75-
def validate_annotation_status(self):
76-
if (
77-
self._annotation_status
78-
and self._annotation_status.lower()
79-
not in constances.AnnotationStatus.values()
80-
):
81-
raise AppValidationException("Invalid annotations status.")
82-
83-
def execute(self):
84-
if self.is_valid():
85-
condition = (
86-
Condition("team_id", self._project.team_id, EQ)
87-
& Condition("project_id", self._project.id, EQ)
88-
& Condition("folder_id", self._folder.uuid, EQ)
89-
)
90-
if self._image_name_prefix:
91-
condition = condition & Condition("name", self._image_name_prefix, EQ)
92-
if self._annotation_status:
93-
condition = condition & Condition(
94-
"annotation_status",
95-
constances.AnnotationStatus.get_value(self._annotation_status),
96-
EQ,
97-
)
98-
self._response.data = self._images.get_all(condition)
99-
return self._response
100-
101-
10253
class GetImageUseCase(BaseUseCase):
10354
def __init__(
10455
self,
@@ -134,41 +85,6 @@ def execute(self):
13485
return self._response
13586

13687

137-
class GetAllImagesUseCase(BaseUseCase):
138-
def __init__(
139-
self,
140-
project: ProjectEntity,
141-
service_provider: SuperannotateServiceProvider,
142-
annotation_status: str = None,
143-
name_prefix: str = None,
144-
):
145-
super().__init__()
146-
self._project = project
147-
self._service_provider = service_provider
148-
self._annotation_status = annotation_status
149-
self._name_prefix = name_prefix
150-
151-
@property
152-
def annotation_status(self):
153-
return constances.AnnotationStatus.get_value(self._annotation_status)
154-
155-
def execute(self):
156-
condition = (
157-
Condition("team_id", self._project.team_id, EQ)
158-
& Condition("project_id", self._project.id, EQ)
159-
& Condition("folder_id", 0, EQ)
160-
)
161-
if self._annotation_status:
162-
condition &= Condition("annotation_status", self.annotation_status, EQ)
163-
if self._name_prefix:
164-
condition &= Condition("name", self._name_prefix, EQ)
165-
images_list = self._service_provider.list_images(
166-
query_string=condition.build_query()
167-
)
168-
self._response.data = [ImageEntity.from_dict(**image) for image in images_list]
169-
return self._response
170-
171-
17288
class GetBulkImages(BaseUseCase):
17389
def __init__(
17490
self,
@@ -1963,35 +1879,6 @@ def execute(self):
19631879
self._annotation_classes_repo.delete(uuid=self.uuid)
19641880

19651881

1966-
class GetAnnotationClassUseCase(BaseUseCase):
1967-
def __init__(
1968-
self,
1969-
annotation_classes_repo: BaseManageableRepository,
1970-
annotation_class_name: str,
1971-
):
1972-
super().__init__()
1973-
self._annotation_classes_repo = annotation_classes_repo
1974-
self._annotation_class_name = annotation_class_name
1975-
1976-
def execute(self):
1977-
classes = self._annotation_classes_repo.get_all(
1978-
condition=Condition("name", self._annotation_class_name, EQ)
1979-
)
1980-
self._response.data = classes[0]
1981-
return self._response
1982-
1983-
1984-
class UploadFileToS3UseCase(BaseUseCase):
1985-
def __init__(self, to_s3_bucket, path, s3_key: str):
1986-
super().__init__()
1987-
self._to_s3_bucket = to_s3_bucket
1988-
self._path = path
1989-
self._s3_key = s3_key
1990-
1991-
def execute(self):
1992-
self._to_s3_bucket.upload_file(str(self._path), self._s3_key)
1993-
1994-
19951882
class ExtractFramesUseCase(BaseInteractiveUseCase):
19961883
def __init__(
19971884
self,

src/superannotate/lib/core/validators.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)