Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argstr interpolation for tuples is not the same as lists #418

Open
effigies opened this issue Feb 18, 2021 · 2 comments
Open

argstr interpolation for tuples is not the same as lists #418

effigies opened this issue Feb 18, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@effigies
Copy link
Contributor

xref nipype/pydra-mrtrix3#1 (comment)

@effigies effigies added the bug Something isn't working label Feb 18, 2021
@ghisvail
Copy link
Collaborator

I am having a similar issue with FreeSurfer's long option for recon-all whereby the expected format is a tuple of strings:

recon-all -long <tpNid> <templateid> -all

I'd expect to just be able to declare it as:

{
    "longitudinal",
    Tuple[str, str],
    {
        "help_string": "longitudinal processing scheme",
        "argstr": "-long",
    }
}

But it's getting interpolated as -long (tpNid, templateid).

I don't think using a list is the right solution here, since we want to constrain both the number of arguments (2) and their respective types (both string).

@ghisvail
Copy link
Collaborator

ghisvail commented May 17, 2022

An alternative could be:

[
    {
        "longitudinal_timepoint_id",
        str,
        {
            "help_string": "longitudinal timepoint identifier",
            "argstr": "-long {longitudinal_timepoint_id} {longitudinal_template_id}",
            "requires": ["longitudinal_template_id"]
         },
    },
    {
         "longitudinal_template_id",
         str,
         {
             "help_string": "longitudinal template identifier",
             "argstr": None,  # handled by longitudinal_timepoint_id
             "requires": ["longitudinal_timepoint_id"],
         },
    },
]

which produces the expected output, but I am not familiar enough with pydra yet to figure out whether this is legit or a hack 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants