Skip to content

Commit

Permalink
syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChymera committed Jul 26, 2022
1 parent f57d234 commit baa2a89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions tools/schemacode/bidsschematools/tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ def test__add_subdirs():
regex_string, variant, datatype, entity_definitions, formats, modality_datatypes
)

assert (
_regex_string == "/sub-(?P<subject>[0-9a-zA-Z]+)/sub-(?P=subject)"
"_sessions\\.(tsv|json)"
)
assert _regex_string == "/sub-(?P<subject>[0-9a-zA-Z]+)/sub-(?P=subject)_sessions\\.(tsv|json)"


def test__add_suffixes():
Expand Down
4 changes: 2 additions & 2 deletions tools/schemacode/bidsschematools/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _add_subdirs(regex_string, variant, datatype, entity_definitions, formats, m
for dir_entity in DIR_ENTITIES:
if dir_entity in variant["entities"].keys():
format_selection = formats[entity_definitions[dir_entity]["format"]]
variable_field = format_selection['pattern']
variable_field = format_selection["pattern"]
shorthand = entity_definitions[dir_entity]["name"]
if variant["entities"][dir_entity] == "required":
regex_subdir = f"{shorthand}-(?P<{dir_entity}>{variable_field})/"
Expand Down Expand Up @@ -297,7 +297,7 @@ def load_entities(
variable_field = "|".join(entity_definitions[entity]["enum"])
else:
format_selection = formats[entity_definitions[entity]["format"]]
variable_field = format_selection['pattern']
variable_field = format_selection["pattern"]
regex_entities = _add_entity(
regex_entities,
entity,
Expand Down

0 comments on commit baa2a89

Please sign in to comment.