Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -127,6 +127,18 @@ def check_subject_age(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", "?"]
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
@@ -1,6 +1,7 @@
CRITICAL: # All the fields under CRITICAL will be required for dandi validate to pass
- check_subject_exists
- check_subject_id_exists
- check_subject_age_reference
BEST_PRACTICE_VIOLATION:
- check_subject_sex # these are planned to be elevated to CRITICAL when required for DANDI validate
- check_subject_species # these are planned to be elevated to CRITICAL when required for DANDI validate
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pynwb
pynwb @ git+https://github.com/NeurodataWithoutBorders/pynwb.git@age_reference # relax to pynwb when upstream is merged
PyYAML
jsonschema
packaging
Expand Down