Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
saskiad committed Aug 8, 2024
1 parent 585e563 commit a3a3ac3
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
41 changes: 41 additions & 0 deletions examples/quality_control.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/quality_metrics.py",
"schema_version": "0.0.1",
"overall_status": "Pass",
"overall_status_date": "2022-11-22",
"evaluations": [
{
"evaluation_modality": {
"name": "Behavior videos",
"abbreviation": "behavior-videos"
},
"evaluation_stage": "Data acquisition",
"evaluator_full_name": "Fred Flinstone",
"evaluation_date": "2022-11-22",
"qc_metrics": {
"Video_1_num_frames": 662,
"Video_2_num_frames": 662,
"Frame_match": true
},
"stage_status": "Pass",
"notes": null
},
{
"evaluation_modality": {
"name": "Extracellular electrophysiology",
"abbreviation": "ecephys"
},
"evaluation_stage": "Data acqusition",
"evaluator_full_name": "Fred Flinstone",
"evaluation_date": "2022-11-22",
"qc_metrics": {
"ProbeA_success": true,
"ProbeB_success": true,
"ProbeC_success": false
},
"stage_status": "Pass",
"notes": null
}
],
"notes": null
}
42 changes: 42 additions & 0 deletions examples/quality_control.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from datetime import date

from aind_data_schema_models.modalities import Modality

from aind_data_schema.core.quality_control import QualityControl, QCEvaluation

t = date(2022, 11, 22)

q = QualityControl(
overall_status="Pass",
overall_status_date = t,
evaluations = [
QCEvaluation(
evaluation_modality=Modality.BEHAVIOR_VIDEOS,
evaluation_stage="Data acquisition",
evaluator_full_name="Fred Flinstone",
evaluation_date=t,
qc_metrics={
"Video_1_num_frames": 662,
"Video_2_num_frames": 662,
"Frame_match": True,
},
stage_status="Pass",
),
QCEvaluation(
evaluation_modality=Modality.ECEPHYS,
evaluation_stage="Data acqusition",
evaluator_full_name="Fred Flinstone",
evaluation_date=t,
qc_metrics={
"ProbeA_success": True,
"ProbeB_success": True,
"ProbeC_success": False,
},
stage_status="Pass",
)
]
)

serialized = q.model_dump_json()
deserialized = QualityControl.model_validate_json(serialized)
q.write_standard_file()

0 comments on commit a3a3ac3

Please sign in to comment.