Skip to content

Commit

Permalink
Refactored to pass some of the linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
fatimarabab committed Apr 25, 2024
1 parent 2e1037e commit 6882e29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
20 changes: 6 additions & 14 deletions backend/src/core/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,12 @@ def process_tasks(annotation_queue, genomic_unit_collection): # pylint: disable
ready = False
if genomic_unit_collection.annotation_exist(annotation_unit.genomic_unit, annotation_unit.dataset):
logger.info('%s Annotation Exists...', format_annotation_logging(annotation_unit))
if annotation_unit.version_exists():
# need to check if this version is latest
latest = True
if annotation_unit.version is latest:
logger.info(
'%s Annotation Exists with Latest Version...',
format_annotation_logging(annotation_unit)
)
ready = True
continue
# determine as version_annotation_type
# create version_annotation_task
# send version-url and attribute
# put this in background task
if annotation_unit.is_version_latest():
logger.info(
'%s Annotation Exists with Latest Version...', format_annotation_logging(annotation_unit)
)
ready = True
continue
# This ready is True only for now for the test to pass,
# when the versioning is actually happening this will be removed & handled in above code
ready = True
Expand Down
10 changes: 10 additions & 0 deletions backend/src/core/annotation_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ def version_exists(self):
if self.version == "":
return True
return False

def is_version_latest(self):
"""Checks if the annotated Annotation Unit has the latest version or not"""
latest = False

if self.version_exists():
# code to be added to check if version is latest
latest = True

return latest

0 comments on commit 6882e29

Please sign in to comment.