Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add age.reference support #250

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 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]
CodyCBakerPhD marked this conversation as resolved.
Show resolved Hide resolved
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
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
bendichter marked this conversation as resolved.
Show resolved Hide resolved
PyYAML
jsonschema
packaging
Expand Down