Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ProjectStatus and TaskStatus to include new field n_new_annotations #94

Merged
merged 3 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion geti_sdk/data_models/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,23 @@ class TaskStatus:
:var status: StatusSummary object that contains (among others) a human readable
message describing the status of the task
:var title: Title of the taks
:var n_new_annotations: Only used in Geti v1.1
"""

id: str
is_training: bool
required_annotations: AnnotationRequirements
status: StatusSummary
title: str
n_new_annotations: Optional[int] = None # Added in Geti v1.1


@attr.define
class ProjectStatus:
"""
Status of a project in GETi.

:var is_training: True if a training job is currently running for any of the
:param is_training: True if a training job is currently running for any of the
tasks in the project
:var n_required_annotations: Total number of required annotations for the project,
before auto-training can be started
Expand All @@ -114,12 +116,14 @@ class ProjectStatus:
message describing the status of the project
:var tasks: List of TaskStatus objects, detailing the status of each task in the
project
:var n_new_annotations: Only used in Geti v1.1
"""

is_training: bool
n_required_annotations: int
status: StatusSummary
tasks: List[TaskStatus]
n_new_annotations: Optional[int] = None # Added in Geti v1.1
project_performance: Optional[Performance] = None
project_score: Optional[float] = None # Deprecated in Geti 1.0, to be removed
n_running_jobs: Optional[int] = None
Expand Down
12 changes: 9 additions & 3 deletions geti_sdk/platform_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,15 @@ def is_geti_1_0(self) -> bool:
Return True if the version corresponds to a platform on the Geti version 1.0 of
the software.
"""
return (
self.version.base_version == Version("1.0.0").base_version and self.is_geti
)
return self.version.major == 1 and self.version.minor == 0 and self.is_geti

@property
def is_geti_1_1(self) -> bool:
"""
Return True if the version corresponds to a platform on the Geti version 1.1 of
the software.
"""
return self.version.major == 1 and self.version.minor == 1 and self.is_geti

@property
def is_geti(self) -> bool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def test_product_version(self, fxt_geti_session: GetiSession):
version_tests = [
fxt_geti_session.version.is_sc_mvp,
fxt_geti_session.version.is_sc_1_1,
fxt_geti_session.version.is_geti and fxt_geti_session.version.is_geti_1_0,
fxt_geti_session.version.is_geti_1_0,
fxt_geti_session.version.is_geti_1_1,
]
assert sum(version_tests) == 1

Expand Down