-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
I have got an interface which expects a parameter foo
as a triple with the following format --foo 1 2 3
I reached for the following definition as a first attempt:
input_spec = pydra.specs.SpecInfo(
name="Input",
fields=[
(
"foo",
ty.Tuple[int, int, int],
{
"help_string": "foo triple",
"argstr": "--foo {foo}",
},
),
],
bases=(pydra.specs.ShellSpec,),
Which does not work since it produces --foo (1, 2, 3)
.
If I use --foo...
and instantiate the interface with a list instead of tuple then I get --foo 1 --foo 2 --foo 3
.
If I use formatter
instead of argstr
with "formatter": lambda field: f"--foo {' '.join(field)}"
, I get an error because formatter seem to be called with each element of the list instead of the entire list (TypeError: sequence item 0: expected str instance, int found
).
I am probably missing another option, hence this support request 🙏
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested