Skip to content

Commit fd8d6f3

Browse files
committed
add modalities method
1 parent fde7300 commit fd8d6f3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/bids_validator/context.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,15 @@ def dataset_description(self) -> Namespace:
130130
@cached_property
131131
def modalities(self) -> list[str]:
132132
"""List of modalities found in the dataset."""
133-
...
134-
return []
133+
result = set()
134+
135+
modalities = self.schema.rules.modalities
136+
for datatype in self.datatypes:
137+
for mod_name, mod_dtypes in modalities.items():
138+
if datatype in mod_dtypes.datatypes:
139+
result.add(mod_name)
140+
141+
return list(result)
135142

136143
@cached_property
137144
def datatypes(self) -> list[str]:

0 commit comments

Comments
 (0)