Skip to content

Commit

Permalink
doc: missing docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Sep 23, 2024
1 parent 87b4515 commit 7fd1461
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions src/aind_data_schema/core/quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ class QCMetric(BaseModel):

@property
def metric_status(self) -> QCStatus:
"""Get the latest status object for this metric
Returns
-------
QCStatus
Most recent status object
"""
return self.metric_status_history[-1]


Expand All @@ -66,13 +73,21 @@ class QCEvaluation(AindModel):

@property
def evaluation_status(self) -> QCStatus:
return self._evaluation_status[-1]
"""Get the latest status object for this evaluation
@property
def evaluation_status_history(self) -> List[QCStatus]:
return self._evaluation_status
Returns
-------
QCStatus
Most recent status object
"""
return self._evaluation_status[-1]

def evaluate_status(self):
"""Loop through all metrics and evaluate the status of the evaluation
Any fail -> FAIL
If no fails, then any pending -> PENDING
All PASS -> PASS
"""
new_status = QCStatus(evaluator="Automated", status=Status.PASS, timestamp=datetime.now())

latest_metric_statuses = [metric.metric_status.status for metric in self.qc_metrics]
Expand All @@ -97,14 +112,21 @@ class QualityControl(AindCoreModel):

@property
def overall_status(self) -> QCStatus:
return self._overall_status[-1]
"""Get the latest status object for the overall QC
@property
def overall_status_history(self) -> List[QCStatus]:
return self._overall_status
Returns
-------
QCStatus
Most recent status object
"""
return self._overall_status[-1]

def evaluate_status(self):
"""Evaluate the status of all evaluations, then evaluate the status of the overall QC"""
"""Evaluate the status of all evaluations, then evaluate the status of the overall QC
Any FAIL -> FAIL
If no fails, then any PENDING -> PENDING
All PASS -> PASS
"""
for evaluation in self.evaluations:
evaluation.evaluate_status()

Expand Down

0 comments on commit 7fd1461

Please sign in to comment.