2020from datetime import datetime
2121from hashlib import sha1
2222import yaml
23- from CPAC . surface . globals import DOUBLERUN_GUARD_MESSAGE
23+
2424from CPAC .utils .configuration import Configuration , Preconfiguration , \
2525 preconfig_yaml
2626from CPAC .utils .utils import set_nested_value , update_config_dict , \
@@ -87,18 +87,7 @@ def dump(self, new_dict, parents=None):
8787 -------
8888 str
8989 """
90- # Initialize variable for automatically updated value
91- if parents == ['surface_analysis' , 'freesurfer' ] or parents is None :
92- freesurfer_extraction = False
93- try :
94- brain_extractions = self .get_nested (
95- new_dict , ['anatomical_preproc' , 'brain_extraction' ,
96- 'using' ])
97- except KeyError :
98- brain_extractions = []
99- if (brain_extractions is not None and
100- 'FreeSurfer-ABCD' in brain_extractions ):
101- freesurfer_extraction = True
90+
10291 # SSOT FSLDIR
10392 try : # Get from current config
10493 fsldir = self .get_nested (new_dict ,
@@ -117,17 +106,6 @@ def dump(self, new_dict, parents=None):
117106 _dump = ['%YAML 1.1' , '---' ]
118107 if 'pipeline_setup' not in new_dict :
119108 new_dict ['pipeline_setup' ] = None
120- # Insert automatically-changed value in original dict
121- # if freesurfer_extraction:
122- # new_dict = set_nested_value(
123- # new_dict, ['surface_analysis', 'freesurfer',
124- # 'run_reconall'], False)
125- ingress_keys = ['surface_analysis' , 'freesurfer' , 'ingress_reconall' ]
126- try :
127- self .get_nested (new_dict , ingress_keys )
128- except KeyError :
129- new_dict = set_nested_value (new_dict , ingress_keys ,
130- self .get_nested (self ._dict , ingress_keys ))
131109 else :
132110 _dump = []
133111 # Prepare for indentation
@@ -150,7 +128,7 @@ def dump(self, new_dict, parents=None):
150128 value = self .get_nested (new_dict , keys )
151129 except KeyError : # exclude unincluded keys
152130 continue
153-
131+
154132 # Print comment if there's one above this key in the template
155133 if comment :
156134 if key != 'pipeline_setup' :
0 commit comments