Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/openpecha/pecha/serializers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def serialize_aligned_pechas_transformed_annotations(self):

target_annotation_id, source_annotation_id = self.get_aligned_to_annotation_id(self.source_annotations)

is_target_annnotation_is_alignement = self._check_if_target_annotation_is_alignment_(self.target_annotations)
is_target_annnotation_is_alignement = self._check_if_target_annotation_is_alignment_(self.target_annotations, target_annotation_id)

target_alignment_annotation = None
if is_target_annnotation_is_alignement:
Expand Down Expand Up @@ -350,8 +350,8 @@ def _get_target_segmentation_annotation_id_(self, target_annotations: list[dict]
raise ValueError("No segmentation annotation found")


def _check_if_target_annotation_is_alignment_(self, target_annotations: list[dict]) -> bool:
def _check_if_target_annotation_is_alignment_(self, target_annotations: list[dict], target_annotation_id: str) -> bool:
for target_annotation in target_annotations:
if (target_annotation['type'] == 'alignment'):
if (target_annotation['type'] == 'alignment' and target_annotation['id'] == target_annotation_id):
return True
return False