idaholab / raven

RAVEN is a flexible and multi-purpose probabilistic risk analysis, validation and uncertainty quantification, parameter optimization, model reduction and data knowledge-discovering framework.
https://raven.inl.gov/
Apache License 2.0
218 stars 133 forks source link

[TASK] Sampler/Optimizer function execution order #2302

Closed aalfonsi closed 3 months ago

aalfonsi commented 5 months ago

Issue Description

Is your feature request related to a problem? Please describe. For complex problems, a set of functions (in Samplers/Optimizers) might depend on another one/another set. Currently there is no way in RAVEN to specify an order of execution or for RAVEN to infer the order of execution as function of the input/output variables.

Describe the solution you'd like 2 options are possible:

Describe alternatives you've considered In all the functions that depend on another function/function set, the code snippet needed to compute the "common quantity" is copied pasted in each function.


For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.


For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

aalfonsi commented 5 months ago

@wangcj05 @mandd @PaulTalbot-INL @joshua-cogliati-inl ALL what do you think?

wangcj05 commented 5 months ago

@aalfonsi Both are good for me. If you choose the option two, I think we need to switch "variables" of "Functions" to "Inputs"/"Outputs" instead.

alfoa commented 5 months ago

@aalfonsi Both are good for me. If you choose the option two, I think we need to switch "variables" of "Functions" to "Inputs"/"Outputs" instead.

Oh Yes absolutely that can be done to be more explicit. Implicitly in case of "functions" i think the input output relation is in their definition. For example in a case like the one below:

<Functions>
  <External file="myFile.py" name="myFunction">
    <variables>sampleVar1,variablefromOtherFunction</variables>
  </External>
</Functions>

<variable name="myVar">
  <function>myFunction</function>
</variable>

The output is myVar (the variable name) and the inputs are the Functions variables.

wangcj05 commented 3 months ago

issue closure checklist is good.