nipype / pydra

Pydra Dataflow Engine
https://nipype.github.io/pydra/
Other
122 stars 59 forks source link

cmdline raise an error for tasks with state and template #439

Closed djarecka closed 3 years ago

djarecka commented 3 years ago

this will fail right now

def test_shell_cmd_inputs_template_1_st():
    """ additional inputs, one uses output_file_template (and argstr)
        testing cmdline when splitter defined
    """
    my_input_spec = SpecInfo(
        name="Input",
        fields=[
            (
                "inpA",
                attr.ib(
                    type=str,
                    metadata={
                        "position": 1,
                        "help_string": "inpA",
                        "argstr": "",
                        "mandatory": True,
                    },
                ),
            ),
            (
                "outA",
                attr.ib(
                    type=str,
                    metadata={
                        "position": 2,
                        "help_string": "outA",
                        "argstr": "-o",
                        "output_file_template": "{inpA}_out",
                    },
                ),
            ),
        ],
        bases=(ShellSpec,),
    )

    shelly = ShellCommandTask(
        name="f",
        executable="executable",
        input_spec=my_input_spec,
        inpA=["inpA", "inpB"],
    ).split("inpA")

    assert shelly.cmdline
djarecka commented 3 years ago

suggestions from @jw-96: I'm passing entire input here, and should take the state elements for all inputs that might be part of the formatting.

This should be fixed before #471