Giuseppe Ughi
05/11/2023, 3:34 PMconf/base/catalog.yml
as follows
{% for region in ['parasubicular', 'parainsular'] %}
{{ region }}.data_right:
type: PartitionedDataSet
path: data/01_raw/ClinicalDTI/R_VIM/seedmasks/
dataset: pandas.CSVDataSet
filename_suffix: /{{ region }}_R_T1.nii.gz
{{ region }}.data_right_output:
type: pandas.CSVDataSet
filepath: data/03_primary/{{ region }}_output.csv
{% endfor %}
everything works fine. However, I need to iterate over a list that is not practical to hard-code therefore I was hoping to have something like follows
regions:
- 'parasubicular'
- 'parainsular'
{% for region in regions %}
{{ region }}.data_right:
type: PartitionedDataSet
path: data/01_raw/ClinicalDTI/R_VIM/seedmasks/
dataset: pandas.CSVDataSet
filename_suffix: /{{ region }}_R_T1.nii.gz
{{ region }}.data_right_output:
type: pandas.CSVDataSet
filepath: data/03_primary/{{ region }}_output.csv
{% endfor %}
but no matter where I define the regions
list (i tried to define it in different .yml
files) I stumble on the same error screen-shotted below.
Do you by chance know if I have to save the jinja pattern in a different file, there is a specific place where I have to save the list that I want to read, or if I have to change the parsing somehow?
Thank you in advance!!Giulio Morina
05/11/2023, 4:26 PM{% set regions=['parasubicular', 'parainsular'] %}
{% for region in regions %}
{{ region }}.data_right:
type: PartitionedDataSet
path: data/01_raw/ClinicalDTI/R_VIM/seedmasks/
dataset: pandas.CSVDataSet
filename_suffix: /{{ region }}_R_T1.nii.gz
{{ region }}.data_right_output:
type: pandas.CSVDataSet
filepath: data/03_primary/{{ region }}_output.csv
{% endfor %}
Giuseppe Ughi
05/11/2023, 5:53 PMNok Lam Chan
05/15/2023, 2:50 PMTemplatedConfigLoader
, it should be possible though with ac_context
but you will have to create a custom config loader (probably similar to TemplatedConfigLoader)