Skip to content

Commit 3936dbe

Browse files
committed
Ingestion validation
1 parent b04fe05 commit 3936dbe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

schema/ingestion_config/v1.0.0/ingestion_config_models_extended.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
AnnotationEntity,
2121
AnnotationObject,
2222
AnnotationSource,
23+
IdentifiedObject,
2324
Author,
2425
CameraDetails,
2526
CellComponent,
@@ -590,6 +591,7 @@ def validate_annotation_object(self) -> Self:
590591
return self
591592

592593

594+
593595
# ==============================================================================
594596
# Annotation Confidence Validation
595597
# ==============================================================================
@@ -900,6 +902,17 @@ def valid_sources(cls: Self, source_list: List[GainSource]) -> List[GainSource]:
900902
return validate_sources(source_list)
901903

902904

905+
# ==============================================================================
906+
# Identified Object Validation
907+
# ==============================================================================
908+
class ExtendedValidationIdentifiedObject(IdentifiedObject):
909+
@model_validator(mode="after")
910+
def validate_identified_object(self) -> Self:
911+
if re.match(GO_ID_REGEX, self.object_id):
912+
validate_id_name_object(self, self.object_id, self.object_name, id_field_name="object_id", validate_name=True, ancestor=CELLULAR_COMPONENT_GO_ID)
913+
return self
914+
915+
903916
# ==============================================================================
904917
# Key Image Validation
905918
# ==============================================================================

0 commit comments

Comments
 (0)