Skip to content

Commit

Permalink
feat: adding create field to QCEvaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Dec 11, 2024
1 parent 9f70899 commit 524295c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/quality_control.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"tags": null,
"notes": "",
"allow_failed_metrics": false,
"latest_status": "Pending"
"latest_status": "Pending",
"created": "2022-11-22T00:00:00Z"
},
{
"modality": {
Expand Down Expand Up @@ -126,7 +127,8 @@
"tags": null,
"notes": "Pass when video_1_num_frames==video_2_num_frames",
"allow_failed_metrics": false,
"latest_status": "Pass"
"latest_status": "Pass",
"created": "2022-11-22T00:00:00Z"
},
{
"modality": {
Expand Down Expand Up @@ -183,7 +185,8 @@
"tags": null,
"notes": null,
"allow_failed_metrics": false,
"latest_status": "Pass"
"latest_status": "Pass",
"created": "2022-11-22T00:00:00Z"
}
],
"notes": null
Expand Down
3 changes: 3 additions & 0 deletions examples/quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
QCMetric(name="Probe C drift", value="Low", reference="ecephys-drift-map", status_history=[s]),
],
notes="",
created=t,
)

eval1 = QCEvaluation(
Expand All @@ -63,6 +64,7 @@
QCMetric(name="video_2_num_frames", value=662, status_history=[s]),
],
notes="Pass when video_1_num_frames==video_2_num_frames",
created=t,
)

eval2 = QCEvaluation(
Expand All @@ -74,6 +76,7 @@
QCMetric(name="ProbeB_success", value=True, status_history=[s]),
QCMetric(name="ProbeC_success", value=True, status_history=[s]),
],
created=t,
)

q = QualityControl(evaluations=[eval0, eval1, eval2])
Expand Down
1 change: 1 addition & 0 deletions src/aind_data_schema/core/quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class QCEvaluation(AindModel):
),
)
latest_status: Status = Field(default=None, title="Evaluation status")
created: AwareDatetimeWithDefault = Field(default_factory=lambda: datetime.now(tz=timezone.utc), title="Evaluation creation date")

def status(self, date: datetime = datetime.now(tz=timezone.utc)) -> Status:
"""DEPRECATED
Expand Down

0 comments on commit 524295c

Please sign in to comment.