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

Add shorter methods for creating shell and func-processes, with auto-generated names. #124

Open
samuell opened this issue Apr 8, 2021 · 0 comments

Comments

@samuell
Copy link
Member

samuell commented Apr 8, 2021

Right now, to create a new process, you have to give it a name, which sometimes takes focus away from the actuall shell command. Also, the method name wf.NewProc is a bit technical.

We could add an alternative, wf.Shell(), that just takes the shell command as parameter, and auto-generates a name, to make simpler workflows more fluent to write. One could still give a name with wf.Name = "some-name", and we could retain wf.NewProc() for compatibility.

So, this:

proc := wf.NewProc("proc", "echo hi > {o:hi}")
proc.SetOut("hi", "hi.txt")

... would become this:

proc := wf.Shell("echo hi > {o:hi}")
proc.SetOut("hi", "hi.txt")

Together with the suggestion in #123, the total would be:

proc := wf.Shell("echo hi > {o:hi:hi.txt}")

We would also then probably do something similar for inline-Go-function based processes:

proc := wf.Func(
    func(t *scipipe.Task) {
        // Function implementation here ...
    },
    []string{"in1", "in2"}, // Specifying inputs
    []string{"out1", "out2"}, // Specifying outputs
    []string{"param1", "param2"} // Specifying params
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant