Any operation in a SFG should be able to be replaced with another operation with the same amount of in/output ports. The resulting SFG should be valid.
Any operation in a SFG should be able to be replaced with another set of operations with the same amount of in/output ports. The resulting SFG should be valid.
Comment:
The resulting SFG should be valid according to #12 (closed).
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related or that one is blocking others.
Learn more.
As a user I want to be able to switch out an operation with another operation with the same amount of input ports and the same amount of output ports.
As a developer, given the identifier of the operation to replace and a new operation(s), then the operation should be able to be decoupled and replaced with a new operation. The function should then return a new sfg.
I implemented the functionality as described in the issue, I also fixed some issues with the tests. However, I had to decide how we should handle when we want to replace multiple operations, should we automagically create new operations or always assume that the number of output ports and input ports match in the given input to the method. I went with the second approach, but I am not sure it is intended.
The issue, as it is described right now, doesn't say anything about replacing multiple operations at once. It only describes that we want to change any operation to another operation or a set of operations. Is the issue wrongly described? @jacwa448
Well, the set of operations is the thing that is confusing, either it is supposed to be an SFG or something, then it is basically #14 (closed). Or it is to replace several operations in the SFG, otherwise the output_count and input_count will never match, or atleast in very few cases it might.
I have discussed this further with @felgo673 regarding the set replacement of operations, and decided that replacing several operations should be left to another implementation, like looping and for each operation calling the replacement method. This could be done in some sort of wrapper.