24
24
The module also has a :py:func:`to_filename` function to allow writting out
25
25
the settings to hard disk in *ToML* format, which looks like::
26
26
27
+ [environment]
28
+ cpu_count = 8
29
+ exec_env = "posix"
30
+ free_mem = 2.2
31
+ overcommit_policy = "heuristic"
32
+ overcommit_limit = "50%"
33
+ nipype_version = "1.5.0"
34
+ templateflow_version = "0.4.2"
35
+ version = "20.0.1"
36
+
27
37
[nipype]
28
38
crashfile_format = "txt"
29
39
get_linked_libs = false
32
42
plugin = "MultiProc"
33
43
resource_monitor = false
34
44
stop_on_first_crash = false
35
- version = "1.5.0-dev+gdffcb7815"
36
45
37
46
[execution]
38
47
bids_dir = "/data/openfmri/ds000005"
49
58
reports_only = false
50
59
run_uuid = "20200302-174345_9ba9f304-82de-4538-8c3a-570c5f5d8f2f"
51
60
participant_label = [ "01",]
52
- version = "20.0.1+13.g3ca42930.dirty"
53
- work_dir = "/home/oesteban/tmp/fmriprep-ds005/fprep-work2"
61
+ work_dir = "work/"
54
62
write_graph = false
55
63
56
64
[workflow]
@@ -227,13 +235,34 @@ def get(cls):
227
235
return out
228
236
229
237
238
+ class environment (_Config ):
239
+ """Read-only options."""
240
+
241
+ cpu_count = os .cpu_count ()
242
+ """Number of available CPUs."""
243
+ exec_docker_version = _docker_ver
244
+ """Version of Docker Engine."""
245
+ exec_env = _exec_env
246
+ """A string representing the execution platform."""
247
+ free_mem = _free_mem_at_start
248
+ """Free memory at start."""
249
+ overcommit_policy = _oc_policy
250
+ """Linux's kernel virtual memory overcommit policy."""
251
+ overcommit_limit = _oc_limit
252
+ """Linux's kernel virtual memory overcommit limits."""
253
+ nipype_version = _nipype_ver
254
+ """Nipype's current version."""
255
+ templateflow_version = _tf_ver
256
+ """The TemplateFlow client version installed."""
257
+ version = __version__
258
+ """*fMRIPrep*'s version."""
259
+
260
+
230
261
class nipype (_Config ):
231
262
"""Nipype configuration."""
232
263
233
264
crashfile_format = 'txt'
234
265
"""The file format for crashfiles, either text or pickle."""
235
- free_mem = _free_mem_at_start
236
- """Free memory at start."""
237
266
get_linked_libs = False
238
267
"""Run NiPype's tool to enlist linked libraries for every interface."""
239
268
memory_gb = None
@@ -242,10 +271,6 @@ class nipype(_Config):
242
271
"""Number of processes (compute tasks) that can be run in parallel (multiprocessing only)."""
243
272
omp_nthreads = os .cpu_count ()
244
273
"""Number of CPUs a single process can access for multithreaded execution."""
245
- overcommit_policy = _oc_policy
246
- """Linux's kernel virtual memory overcommit policy."""
247
- overcommit_limit = _oc_limit
248
- """Linux's kernel virtual memory overcommit limits."""
249
274
plugin = 'MultiProc'
250
275
"""NiPype's execution plugin."""
251
276
plugin_args = {
@@ -257,8 +282,6 @@ class nipype(_Config):
257
282
"""Enable resource monitor."""
258
283
stop_on_first_crash = True
259
284
"""Whether the workflow should stop or continue after the first error."""
260
- version = _nipype_ver
261
- """Nipype's current version."""
262
285
263
286
@classmethod
264
287
def get_plugin (cls ):
@@ -279,6 +302,8 @@ class execution(_Config):
279
302
280
303
bids_dir = None
281
304
"""An existing path to the dataset, which must be BIDS-compliant."""
305
+ bids_description_hash = None
306
+ """Checksum (SHA256) of the ``dataset_description.json`` of the BIDS dataset."""
282
307
bids_filters = None
283
308
"""A dictionary of BIDS selection filters."""
284
309
boilerplate_only = False
@@ -287,10 +312,6 @@ class execution(_Config):
287
312
"""Run in sloppy mode (meaning, suboptimal parameters that minimize run-time)."""
288
313
echo_idx = None
289
314
"""Select a particular echo for multi-echo EPI datasets."""
290
- exec_docker_version = _docker_ver
291
- """Version of Docker Engine."""
292
- exec_env = _exec_env
293
- """A string representing the execution platform."""
294
315
fs_license_file = _fs_license
295
316
"""An existing file containing a FreeSurfer license."""
296
317
fs_subjects_dir = None
@@ -321,10 +342,6 @@ class execution(_Config):
321
342
"""Select a particular task from all available in the dataset."""
322
343
templateflow_home = _templateflow_home
323
344
"""The root folder of the TemplateFlow client."""
324
- templateflow_version = _tf_ver
325
- """The TemplateFlow client version installed."""
326
- version = __version__
327
- """*fMRIPrep*'s version."""
328
345
work_dir = Path ('work' ).absolute ()
329
346
"""Path to a working directory where intermediate results will be available."""
330
347
write_graph = False
@@ -436,8 +453,9 @@ def load(filename):
436
453
filename = Path (filename )
437
454
settings = loads (filename .read_text ())
438
455
for sectionname , configs in settings .items ():
439
- section = getattr (sys .modules [__name__ ], sectionname )
440
- section .load (configs )
456
+ if sectionname != 'environment' :
457
+ section = getattr (sys .modules [__name__ ], sectionname )
458
+ section .load (configs )
441
459
set_logger_level ()
442
460
init_spaces ()
443
461
init_layout ()
@@ -446,9 +464,10 @@ def load(filename):
446
464
def get (flat = False ):
447
465
"""Get config as a dict."""
448
466
settings = {
449
- 'nipype ' : nipype .get (),
467
+ 'environment ' : environment .get (),
450
468
'execution' : execution .get (),
451
469
'workflow' : workflow .get (),
470
+ 'nipype' : nipype .get (),
452
471
}
453
472
if not flat :
454
473
return settings
0 commit comments