Skip to content

Commit a088bb6

Browse files
committed
MAINT: Ensure multiple paths print/load nicely
1 parent 177de34 commit a088bb6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nibabies/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def load(cls, settings, init=True, ignore=None):
202202
if k in ignore or v is None:
203203
continue
204204
if k in cls._paths:
205-
setattr(cls, k, Path(v).absolute())
205+
if isinstance(v, (list, tuple)): # Multiple paths
206+
setattr(cls, k, [Path(p).absolute() for p in v])
207+
else:
208+
setattr(cls, k, Path(v).absolute())
206209
elif hasattr(cls, k):
207210
setattr(cls, k, v)
208211

@@ -221,7 +224,10 @@ def get(cls):
221224
if callable(getattr(cls, k)):
222225
continue
223226
if k in cls._paths:
224-
v = str(v)
227+
if isinstance(v, (list, tuple)): # Multiple paths
228+
v = [str(p) for p in v]
229+
else:
230+
v = str(v)
225231
if isinstance(v, SpatialReferences):
226232
v = " ".join([str(s) for s in v.references]) or None
227233
if isinstance(v, Reference):
@@ -412,6 +418,7 @@ class execution(_Config):
412418
"anat_derivatives",
413419
"bids_dir",
414420
"bids_database_dir",
421+
"derivatives",
415422
"fs_license_file",
416423
"fs_subjects_dir",
417424
"layout",

0 commit comments

Comments
 (0)