pyiron / pyiron_workflow

Graph-and-node based workflows
BSD 3-Clause "New" or "Revised" License
15 stars 1 forks source link

Architecture: can `Transformer` nodes be `Function`? #504

Open liamhuber opened 4 days ago

liamhuber commented 4 days ago

In principle, the Transformer nodes all just run a simple function -- can we make them all inherit directly from Function? Of course the constructor calls to generate the transformer node classes dynamically will look different, since the point there is that we know basically what the function should look like but the number/names of I/O varies, whereas when we transform a function into a node the function signature is already fully known, but after they're created they look remarkably similar. It would be nice to bring the architecture together this way to minimize the number of different node classes floating around -- ideally users should only ever have to deal with Macro and Function, where Function may come in the flavour of transformer/dataclass nodes rather than those being something actually distinct.