Aligns the library with official BIDS nomenclature (#21), resyncs the entity/suffix/datatype lists from schema.json, and hardens the filename parser.
⚠️ Breaking changes
data_typecolumn renamed todatatype(BIDS uses one word). Update any scripts that filter on or accessdata_type.- Custom-entity config fields renamed in
custom/*.json:name→key(short filename token),display_name→name(column header).patternunchanged.
Added
- 4 entities now recognized:
template(tpl),cohort,atlas,scale(31 → 35), in canonical BIDS order. - Datatype
emg— previouslyemgfiles parsed asdatatype=NA. - Suffixes
description,emg,physioevents. generate_entity_patterns.shnow regenerates every schema-derived block (entity patterns, key/name order, suffixes, extensions, datatype regex) fromschema.json— single source of truth.
Fixed
- Datatype substring false-match: a path like
study_func_proj/sub-01/anat/…was reported asdatatype=funcinstead ofanat. Detection is now anchored to the file's parent directory as a whole path component. - Derivatives false-match: a directory such as
myderivatives/was treated as a derivatives dataset; extraction is now anchored to(^|/)derivatives/. - SIGPIPE fallback:
grep … | head -1 || echo "NA"could silently yieldNAunderset -o pipefail. Replaced with subshell-free, pipe-free bash regex.
Docs / nomenclature
- Code and docs now use the correct BIDS distinction: entity key (
sub, schema.name) vs entity name (subject, the column header) vs display name (Subject). Dropped the "display name" misnomer for column headers. - Fixed docstring examples that passed entity keys (
"sub,ses") which silently fail the column matcher.
Tests
- Regression coverage for the substring false-match,
emgdetection, missing-datatypeNA, derivatives extraction, and themyderivativesnon-match. Suite: 9/9.