-
Notifications
You must be signed in to change notification settings - Fork 12
Expose workflow to extract results from simulation #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #543 +/- ##
==========================================
+ Coverage 83.82% 83.86% +0.04%
==========================================
Files 47 47
Lines 5068 5083 +15
==========================================
+ Hits 4248 4263 +15
Misses 820 820 |
comp = None | ||
base_name += "_N" | ||
|
||
return wf, out, selection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FedericoNegri why do you need to define the output of the workflow (set_output_name
) later and not here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PProfizi In a different context, I'm using the _get_result_workflow
function to get the workflow and chain additional operators, for instance:
wf, out = _get_result_workflow(...)
# add min/max filters
min_max_op = simulation._model.operator(name="min_max_fc")
min_max_op.connect(0, out)
wf.add_operator(operator=min_max_op)
# Set the workflow output
wf.set_output_name("min", min_max_op.outputs.field_min)
wf.set_output_name("max", min_max_op.outputs.field_max)
Do you suggest doing differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FedericoNegri @cbellot000 I've had the same sort of issues while trying to make dynamic workflows, I think what we need is to add getter to Workflow
, such as Workflow.get_output_by_name
which returns the input/ouput as a proper Operator.Input
or Operator.Output
the same way we can set_output_name
or set_input_name
, otherwise we keep having to pass a variable to not loose it. The alternative is to use Workflow.connect_with where you gather what you want to add in a second worklow. In your case though it may be exactly what you need. This is for example what we do here where we create a mesh extraction workflow which we connect to the result extraction workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PProfizi thanks for the feedback. I can try out the connect_with
route, but yeah ideally the first approach would be more convenient. Anyways, I've reworked the _get_result_workflow
so that now it only returns the workflow. Please have a look.
No description provided.