Repository navigation
Accept C. elegans sex from ndx-subjects' c_elegans_sex - #774
Merged
bendichter merged 2 commits intoNov 5, 2026
Merged
Conversation
CElegansSubject of ndx-subjects fixes Subject.sex to "O" and records XX (hermaphrodite) or XO (male) in a separate c_elegans_sex field (e.g. DANDI:001075), so check_subject_sex flagged every such file even though the sex is recorded. Accept sex "O" (or unset) when c_elegans_sex is XX or XO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdN9xPzPo1AzsnEMuU8UQs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdN9xPzPo1AzsnEMuU8UQs
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #774 +/- ##
==========================================
+ Coverage 86.30% 89.21% +2.90%
==========================================
Files 48 48
Lines 2001 2003 +2
==========================================
+ Hits 1727 1787 +60
+ Misses 274 216 -58
🚀 New features to boost your workflow:
|
bendichter
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
check_subject_sex(CRITICAL in thedandiconfig) requiresSubject.sexto beXX(hermaphrodite) orXO(male) when the species is C. elegans. TheCElegansSubjecttype of ndx-subjects instead fixessexto"O", and recordsXX/XOin a separatec_elegans_sexfield (for example DANDI:001075). Every such file therefore failscheck_subject_sex, and so failsdandi validate/dandi upload, even though the sex is recorded.Discussed with @CodyCBakerPhD in
That PR makes dandi-cli read
c_elegans_sexfor the asset metadata.Changes
check_subject_sexpasses whenc_elegans_sexisXXorXOandsexis"O"or unset.c_elegans_sexalternative.Subjectsubclass with ac_elegans_sexattribute, standing in forCElegansSubject, so the tests do not depend on ndx-subjects. They cover both codes withsex"O"or unset, and an invalidc_elegans_sex.Testing
tests/unit_tests: 345 passed, 7 skipped. pre-commit passes.I wrote two NWB files with ndx-subjects 0.2.0, then ran
inspect_nwbfile(..., config=load_config("dandi"))without ndx-subjects installed, so the extension came from the namespace cached in the file:sex="O",c_elegans_sex="XO"check_subject_sexfailssexunset,c_elegans_sex="XX"A changelog entry (
changelog_entries/<PR>.fix.md) will be added once the PR number is known.🤖 Generated with Claude Code
https://claude.ai/code/session_01NdN9xPzPo1AzsnEMuU8UQs