Skip to content

Commit 690ba6c

Browse files
committed
add cache_root to convert method
1 parent 1aa50a1 commit 690ba6c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fileformats/core/fileset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ def matching_exts(
502502
def convert(
503503
cls,
504504
fileset: "FileSet",
505+
cache_root: ty.Optional[Path] = None,
505506
**kwargs: ty.Any,
506507
) -> Self:
507508
"""Convert a given file-set into the format specified by the class
@@ -510,6 +511,9 @@ def convert(
510511
----------
511512
fileset : FileSet
512513
the file-set object to convert
514+
cache_root : Path, optional
515+
a directory to use for any temporary files created during the conversion,
516+
by default None which will use the default Pydra cache
513517
**kwargs
514518
args to pass to customise the converter task definition
515519
@@ -527,7 +531,7 @@ def convert(
527531
return copy(fileset)
528532
kwargs[converter.in_file] = fileset
529533
task = attrs.evolve(converter.task, **kwargs)
530-
outputs = task()
534+
outputs = task(cache_root=cache_root) # type: ignore[call-arg]
531535
out_file = getattr(outputs, converter.out_file)
532536
if not isinstance(out_file, cls):
533537
out_file = cls(out_file)

0 commit comments

Comments
 (0)