Skip to content

Commit 121943e

Browse files
committed
finish removing double-run guard
1 parent fc72541 commit 121943e

File tree

3 files changed

+3
-31
lines changed

3 files changed

+3
-31
lines changed

CPAC/surface/globals.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

CPAC/utils/configuration/configuration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from warnings import warn
2323
import pkg_resources as p
2424
import yaml
25-
from CPAC.surface.globals import DOUBLERUN_GUARD_MESSAGE
2625
from CPAC.utils.utils import load_preconfig
2726
from .diff import dct_diff
2827

CPAC/utils/configuration/yaml_template.py

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from datetime import datetime
2121
from hashlib import sha1
2222
import yaml
23-
from CPAC.surface.globals import DOUBLERUN_GUARD_MESSAGE
23+
2424
from CPAC.utils.configuration import Configuration, Preconfiguration, \
2525
preconfig_yaml
2626
from 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

Comments
 (0)