pyiron / pyiron_workflow

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

Refactor: `Workflow` not a `Node`, and all `Node` with as `HasIOPreview` #360

Open liamhuber opened 2 weeks ago

liamhuber commented 2 weeks ago

Right now Workflow(ParentMost, Composite) ultimately inherits from Node and StaticNode(Node, HasIOPreview, ABC) has class-level IO but is a child of Node.

I would like to refactor so that Workflow does not inherit from Node. In this way, everything that's actually a "node" has class-level IO, and that can be a true feature of "nodes". This feature is important for things like node recommendation systems, and just generally a really useful thing to have. Workflow meanwhile is a lot like a Node (they probably need a shared ancestor), but is not one itself -- it always needs to be parent-most in it's graph, and has dynamic IO.

Then we can remove the creator instance from Composite and just have it on Workflow. At that point it should be possible to avoid all the delayed imports we have on Creator (and similar interface classes) and just leverage things directly. This would be great because the current delayed imports really screw up propagating the docstrings! (I'm not 100% sure yet if the reparenting will be sufficient to avoid circular imports or if a few more adjustments will be needed, but I think it will at least be possible.) The interfaces could then eventually be massaged into a formal public API to guide versioning decisions.