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

On the fly lzin modifier ? #723

Open
BastienCagna opened this issue Dec 4, 2023 · 2 comments
Open

On the fly lzin modifier ? #723

BastienCagna opened this issue Dec 4, 2023 · 2 comments
Labels
question Further information is requested

Comments

@BastienCagna
Copy link

BastienCagna commented Dec 4, 2023

Hi there!
I'm building a workflow that take as input some strings and want to use a modified version of those lazy inputs to set some inputs of a node.

For example, my workflow include a "subject_name" input which is a string giving the subject name and I wan to use this input for a node which have a "output_prefix" input to the subject name + "_". Can I do this without creating a new node ...etc ?

wf = pydra.Workflow(
    "name of the workflow",
    input_spec=["subject_name",  ...] 
)

wf.add(some_node(
    name="Node name",
    output_prefix = wf.lzin.subject_name + "_" # <------- i want to get this: f"{subject_name}_"
))
@BastienCagna BastienCagna added the question Further information is requested label Dec 4, 2023
@satra
Copy link
Contributor

satra commented Dec 4, 2023

@BastienCagna - at present i don't believe LazyField's have any operators.

This may also be a good question in the context of output field templates. perhaps @tclose or @djarecka have thought of this.

@tclose
Copy link
Contributor

tclose commented Dec 4, 2023

I had been thinking of a feature like this for accessing properties of lazily accessed objects, whereby Pydra automatically inserts a new node behind the scenes to perform the access operation. This could be extended to handle operators or perhaps even lambdas too.

From my experience teaching people how to use Pydra, people intuitively expect these sort of operations are to be able to work so it would be good to support it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants