Skip to content

RFC: Task initialization syntax #295

Closed
@effigies

Description

@effigies

Let's break things!

Right now, when you instantiate a Task, you can give it a name:

@pydra.mark.task
def greet(name : str) -> str:
    return f"Hi, {name}"

greeter = greet(name="greeter")
print(greeter(name="@effigies").output.out)
Hi, @effigies

So this works, but it might be worth considering whether this is going to cause confusion in a workflow context:

wf = pydra.Workflow(name="myworkflow", input_spec=["name"])
wf.add(greet(name="greeter"))
wf.greeter.inputs.name = wf.lzin.name
wf.set_output([("out", wf.greeger.lzout.out")])
wf.inputs.name = "@effigies"

with pydra.Submitter() as sub: 
    print(sub(wf).output.out)
Hi, myworkflow

So this is both confusing and actually doesn't work.

In any event, I wanted to open discussion about possibly rethinking the syntax, or possibly just some names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    to considersuggesting changes that require more discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions