feat: Support BEP044 stimulus organization in /stimuli - #445
Draft
neuromechanist wants to merge 5 commits into
Draft
feat: Support BEP044 stimulus organization in /stimuli#445neuromechanist wants to merge 5 commits into
neuromechanist wants to merge 5 commits into
Conversation
The stimuli directory was unconditionally skipped, so no schema rules for BEP044 stimulus files could run. Eventually this should key on the schema directories rule (opaque flag) or stimuli.tsv presence rather than being unconditional.
- Allow subdirectories of directories marked opaque: false in the schema (e.g. /stimuli) instead of flagging them NOT_INCLUDED. - Only enforce stimulus naming rules in catalog mode (stimuli.tsv present at the /stimuli root); legacy free-form stimuli directories stay valid. - Make unusedStimulus catalog-aware: stim-* and catalog files are tracked through stimuli.tsv rather than stim_file path references. - Guard evalInitialColumns against unknown column keys, which silently aborted all rule evaluation for a file via an uncaught TypeError. Tested against beh_stimuli (new example), eeg_matchingpennies (legacy), and synthetic good/bad datasets; filenameIdentify '2 matches' test failure is pre-existing on main.
A stimuli.tsv anywhere under /stimuli (not only at the root) now switches the directory from legacy free-form handling to BEP044 rule enforcement, so self-describing stimulus packs without a root catalog are validated. Shared hasStimuliCatalog helper used by both the NOT_INCLUDED gate and unusedStimulus.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #445 +/- ##
==========================================
- Coverage 87.73% 87.62% -0.11%
==========================================
Files 65 66 +1
Lines 4843 4865 +22
Branches 789 798 +9
==========================================
+ Hits 4249 4263 +14
- Misses 502 507 +5
- Partials 92 95 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The BEP044 stimulus rules apply inside /stimuli, so the default-ignores contract changes: top-level /stimuli content is now visible to the validator (legacy free-form directories are exempted in hasMatch).
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.
Companion to bids-standard/bids-specification#2022 (BEP044, Stim-BIDS). Draft until the BEP settles.
/stimuli; legacy free-form stimuli directories stay exempt (rules only apply when astimuli.tsvcatalog exists anywhere under/stimuli)opaque: falseUNUSED_STIMULUSrecognize catalog-tracked stimulievalInitialColumnsagainst unknown column keys (previously an uncaught TypeError silently skipped all rule evaluation for the file)Tested with
deno test -A srcplus end-to-end validation of a new BEP044 example, legacyeeg_matchingpennies, and synthetic good/bad datasets against the BEP044 schema.