Closed michellewang closed 4 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.33%. Comparing base (
8991806
) to head (de1cf71
).:exclamation: Current head de1cf71 differs from pull request most recent head fa06665
Please upload reports for the commit fa06665 to get more accurate results.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Re: global_config
substitutions, I was thinking following alternative to avoid loading, regexing, and regenerating json objects. It could be my obsolete way of thinking, but may offer a cleaner way than regex matching.
The idea would be to use eval() function. We put the top level "SUBSTITUTION VARS" inside the globals
and the variables in the json block holding a given variable inside locals
.
sample_json
{
"SUBS" : {
"PIPE" : "heudiconv"
},
"BIDS": {
"heudiconv": {
"VERSION": "0.11.6",
"CONTAINER": "f'{pipe}_{VERSION}.sif'",
"URL": ""
},
}
sample eval() code
# read global configs
global_config_file = "sample_global_configs.json"
with open(global_config_file, 'r') as f:
global_configs = json.load(f)
SUBS = global_configs["SUBS"]
bids_configs = global_configs["BIDS"]
heudiconv_configs = bids_configs["heudiconv"]
CONTAINER = heudiconv_configs["CONTAINER"]
# dynamic eval
eval(CONTAINER, SUBS, heudiconv_configs)
This may require try...catch, but shouldn't be too difficult. Thoughts?
Closes #223, closes #251
Summary:
PipelineConfig
changed to have an additionalNAME
andVERSION
field, both of which are requiredBidsPipelineConfig
which is the same asPipelineConfig
except that it has an additional required fieldSTEP
GLOBALS
field in the config, to address feedback on having to replace the same value multiple times when starting from the sample config file. Also: can basically serve as a top-level/env config things, which we discussed beforeBIDS
field has been renamed toBIDS_PIPELINES
, to better parallelPROC_PIPELINES
global_config.json
(singular) instead ofglobal_configs.json
(plural)sample_global_config.json
to only have a single version for each processing pipeline