Skip to content
Draft
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions nwbinspector/checks/nwbfile_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ def check_subject_proper_age_range(subject: Subject):
)


@register_check(importance=Importance.BEST_PRACTICE_SUGGESTION, neurodata_type=Subject)
def check_subject_age_reference(subject: Subject):
"""Check if the Subject age reference is one of supported options."""
valid_options = ["birth", "gestational", None]
if subject.age__reference not in valid_options:
return InspectorMessage(
message=(
f"Subject age reference, '{subject.age__reference}', is not one of the valid options ({valid_options})."
)
)


@register_check(importance=Importance.BEST_PRACTICE_SUGGESTION, neurodata_type=Subject)
def check_subject_id_exists(subject: Subject):
"""Check if subject_id is defined."""
Expand Down
1 change: 1 addition & 0 deletions nwbinspector/internal_configs/dandi.inspector_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ CRITICAL: # All the fields under CRITICAL will be required for dandi validate t
- check_subject_species
- check_subject_age
- check_subject_proper_age_range
- check_subject_age_reference
BEST_PRACTICE_VIOLATION:
- check_data_orientation # not 100% accurate, so need to deelevate from CRITICAL to skip it in dandi validate