Skip to content

For-node pain? #728

@liamhuber

Description

@liamhuber

I already wince every time I have to write a custom function to access the output of the for nodes

Wait, this should not hurt! Can you give me an example? If there's something that's is regularly annoying, we should 100% fix it. Does this have to do with type-hinting like #703?

Don't forget, you can get the outputs as individual channels instead of a dataframe!

import pyiron_workflow as pwf

wf = pwf.Workflow("no_custom_reading")
wf.produce_list = pwf.for_node(
    pwf.std.Add,
    iter_on="obj",
    obj=[1, 2, 3],
    other=10,
    output_as_dataframe=False,
)
wf.consume_list = pwf.for_node(
    pwf.std.Add,
    iter_on="other",
    obj=-10,
    other=wf.produce_list.outputs.add,
    output_as_dataframe=False,
)
wf()

Gives the output, but also the input being iterated over (#674):

{'produce_list__obj': [1, 2, 3],
 'consume_list__other': [11, 12, 13],
 'consume_list__add': [1, 2, 3]}

TBH, I'd actually prefer output_as_dataframe=False as the default, or to get rid of the pandas dependence entirely...

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions