Skip to content

Commit 910295d

Browse files
committed
failed fix(ds005): ensure that spaces are being correctly read
it seems that the std_targets iterable of the workflow resampling ciftis is not properly being filled in - apparently the spec is being dropped. @mgxd - are there any changes in your side to niworkflows/spaces that might have affected that particular? The parameterized folders of nipype are like ``templatename.``, so it seems the specs are not being honored.
1 parent fa6fe3a commit 910295d

File tree

3 files changed

+42
-11
lines changed

3 files changed

+42
-11
lines changed

fmriprep/cli/run.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ def main():
6262
# Clean up master process before running workflow, which may create forks
6363
gc.collect()
6464

65+
# Configure resource_monitor
66+
if config.nipype.resource_monitor:
67+
ncfg.update_config({
68+
'monitoring': {
69+
'enabled': config.nipype.resource_monitor,
70+
'sample_frequency': '0.5',
71+
'summary_append': True,
72+
}
73+
})
74+
ncfg.enable_resource_monitor()
75+
6576
# Nipype config (logs and execution)
6677
ncfg.update_config({
6778
'logging': {
@@ -70,20 +81,12 @@ def main():
7081
},
7182
'execution': {
7283
'crashdump_dir': str(config.execution.log_dir),
73-
'crashfile_format': 'txt',
74-
'get_linked_libs': False,
84+
'crashfile_format': config.nipype.crashfile_format,
85+
'get_linked_libs': config.nipype.get_linked_libs,
7586
'stop_on_first_crash': config.nipype.stop_on_first_crash,
76-
},
77-
'monitoring': {
78-
'enabled': config.nipype.resource_monitor,
79-
'sample_frequency': '0.5',
80-
'summary_append': True,
8187
}
8288
})
8389

84-
if config.nipype.resource_monitor:
85-
ncfg.enable_resource_monitor()
86-
8790
# Sentry tracking
8891
if sentry_sdk is not None:
8992
with sentry_sdk.configure_scope() as scope:
@@ -92,10 +95,10 @@ def main():
9295
sentry_sdk.add_breadcrumb(message='fMRIPrep started', level='info')
9396
sentry_sdk.capture_message('fMRIPrep started', level='info')
9497

95-
config.loggers.workflow.log(25, 'fMRIPrep started!')
9698
config.loggers.workflow.log(15, '\n'.join(
9799
['fMRIPrep config:'] + ['\t\t%s' % s for s in config.dumps().splitlines()])
98100
)
101+
config.loggers.workflow.log(25, 'fMRIPrep started!')
99102
errno = 1 # Default is error exit unless otherwise set
100103
try:
101104
fmriprep_wf.run(**config.nipype.get_plugin())

fmriprep/tests/__init__.py

Whitespace-only changes.

fmriprep/tests/test_config.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""Check the configuration module and file."""
2+
from pathlib import Path
3+
from pkg_resources import resource_filename as pkgrf
4+
from toml import loads
5+
from niworkflows.utils.spaces import format_reference
6+
7+
from .. import config
8+
9+
10+
def test_config_spaces():
11+
"""Check that all necessary spaces are recorded in the config."""
12+
filename = Path(pkgrf('fmriprep', 'data/tests/config.toml'))
13+
settings = loads(filename.read_text())
14+
for sectionname, configs in settings.items():
15+
if sectionname != 'environment':
16+
section = getattr(config, sectionname)
17+
section.load(configs)
18+
config.set_logger_level()
19+
config.init_spaces()
20+
21+
spaces = config.workflow.spaces
22+
assert "MNI152NLin6Asym:res-2" in [
23+
str(s) for s in spaces.get_standard(full_spec=True)]
24+
25+
assert "MNI152NLin6Asym_res-2" in [
26+
format_reference((s.fullname, s.spec))
27+
for s in spaces.references if s.standard and s.dim == 3
28+
]

0 commit comments

Comments
 (0)