populse / capsul

Collaborative Analysis Platform : Simple, Unifying, Lean
Other
7 stars 14 forks source link

Make pipeline definition working #202

Closed sapetnioc closed 2 years ago

denisri commented 2 years ago

The Node and Pipeline classes have been simplified, but there is now a confusion between ProcessNode and non-process Node: in non-process Node instances, plugs are fields on the Node instance. For ProcessNode instances, plugs fields/values are actually in the underlying process. Node methods get_plug_value() and get_trait() have disappeared, but then we don't have a transparent way of getting / setting fields and values. For instance in Pipeline.export_parameters(), we have:

        # Make a copy of the field
        source_field = node.process.field(plug_name)

assumes the node has a process inside, which doesn't work for non-process nodes (switches etc) then, later in the same function:

        # Propagate the parameter value to the new exported one
        v = getattr(node, plug_name, undefined)

which, on the contrary, assumes that plug values are on the Node instance itself, which will work for a switch, but not for a process... So:

denisri commented 2 years ago

So I will try implementing the Pipeline(Node) inheritance. I will need to move the pipeline_nodes.py file since it will be used by Process.