Setup of iteratedata1d#1632
Conversation
trisyoungs
left a comment
There was a problem hiding this comment.
I think this is exactly what we're after. Just small comments and suggestions again, and you also need to create the parameter variables in the setupKeywords() function. You also need to reimplement the setName() virtual since otherwise your parameters won't get renamed if the node does (see srrc/procedure/nodes/select.cpp, line 61 for example).
5f69c88 to
8e9c9c7
Compare
rprospero
left a comment
There was a problem hiding this comment.
I'm approving this, but I've also included an improvement in the comments. You can make those changes now or you can write an issue for it and we'll merge what we have.
| std::shared_ptr<const Collect1DProcedureNode> sourceData_; | ||
| std::shared_ptr<const IntegerCollect1DProcedureNode> sourceIntegerData_; |
There was a problem hiding this comment.
We could make an abstract class AbstractCollect1DProcedureNode and have both Collect1DProcedureNode and IntegerCollect1DProcedureNode descend from it. This would allow IterateData1D to have a single sourceData_ pointer that could reference either type, depending on which concrete class it's pointing toward. This would simplify a bunch of the logic in the prepare and execute functions.
trisyoungs
left a comment
There was a problem hiding this comment.
Sorry - also just noticed that the new files don't conform to lowerCamelCase - the source files should be iterateData1D.h and iterateData1D.cpp.
Closes #1630 . Sometimes there is a need for an "intermediate" processing of Collected data in a Procedure - i.e. the collected data does not represent the final result, and must be further and non-trivially transformed in some way first.
To achieve that we should introduce something akin to an IterateData1DProcedureNode which, for now, can take a Collect1D or IntegerCollect1D node (in the same way that Process1D can). The ForEach loop of the new node will iterate over points in the (averaged) Data1D which those nodes provide, setting the values into parameters for use by other nodes.
Note that we need to follow the convention of the DataND classes when it comes to variables: one-dimensional data comprises an "x" axis with each point having an associated "value" (not "y").