8000 Typing of workflow input/output specs · Issue #661 · nipype/pydra · GitHub
[go: up one dir, main page]

Skip to content

Typing of workflow input/output specs #661

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

Closed
tclose opened this issue Jun 2, 2023 · 1 comment
Closed

Typing of workflow input/output specs #661

tclose opened this issue Jun 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@tclose
Copy link
Contributor
tclose commented Jun 2, 2023

What would you like changed/added and why?

I would like the option/requirement to declare and type the inputs and outputs of workflows e.g.

wf = pydra.Workflow(name="myworkflow", input_spec=[("in_file", File), ("in_dir", Directory)], output_spec=[("out_file", File)])

Since workflows and tasks can be used interchangeably in Pydra it seems an oversight not to be able to type workflow inputs/outputs. Also, it would enable us to type the LazyField objects from Workflow.lzin and perform type checking on the inputs of workflows, e.g.

    wf = Workflow(name="wf", input_spec=["cmd", "file"])
    wf.inputs.cmd = cmd
    wf.inputs.file = filename

    docky = DockerTask(
        name="docky",
        image="busybox",
        executable=wf.lzin.cmd,  # this can't be type-checked currently
        file=wf.lzin.file,  # nor this
        input_spec=my_input_spec,
        strip=True,
    )
    wf.add(docky)

What would be the benefit? Does the change make something easier to use?

It would help round of dynamic type-checking at construction time, thereby catching
more errors before costly workflow runs

@tclose tclose added the enhancement New feature or request label Jun 2, 2023
@tclose
Copy link
Contributor Author
tclose commented Apr 1, 2025

#768

@tclose tclose closed this as completed Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant
0