Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RF: Use dstype instead of file_type for clarity
Browse files Browse the repository at this point in the history
effigies committed Oct 7, 2022
1 parent 203398b commit ea010f6
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/mkdocs_macros_bids/macros.py
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ def _get_source_path(level=1):
return caller.f_locals["_Context__self"]["page"].file.src_path


def make_filename_template(file_type, src_path=None, pdf_format=False, **kwargs):
def make_filename_template(dstype="raw", src_path=None, pdf_format=False, **kwargs):
"""Generate a filename template snippet from the schema, based on specific filters.
Parameters
@@ -88,7 +88,7 @@ def make_filename_template(file_type, src_path=None, pdf_format=False, **kwargs)

schema_obj = schema.load_schema()
codeblock = render.make_filename_template(
file_type,
dstype,
schema_obj,
src_path=src_path,
pdf_format=pdf_format,
7 changes: 5 additions & 2 deletions tools/schemacode/bidsschematools/render/text.py
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ def value_key_table(namespace):


def make_filename_template(
file_type,
dstype,
schema=None,
src_path=None,
n_dupes_to_combine=6,
@@ -223,6 +223,9 @@ def make_filename_template(
Parameters
----------
dstype : "raw" or "deriv"
The type of files being rendered; determines if rules are found in rules.files.raw
or rules.files.deriv
schema : dict
The schema object, which is a dictionary with nested dictionaries and
lists stored within it.
@@ -280,7 +283,7 @@ def make_filename_template(
)
lines = [f"{sub_string}/", f"\t[{ses_string}/]"]

file_rules = schema.rules.files[file_type]
file_rules = schema.rules.files[dstype]
file_groups = {}
for rule in file_rules.values(level=2):
for datatype in rule.datatypes:

0 comments on commit ea010f6

Please sign in to comment.