|
HOPS
HOPS class reference
|
Evaluates a Python control file (.py) and returns the resulting control statements in the same mho_json format produced by MHO_ControlFileParser + MHO_ControlConditionEvaluator. More...
#include <MHO_PyControlEvaluator.hh>
Static Public Member Functions | |
| static bool | Evaluate (MHO_ParameterStore *paramStore, const mho_json &control_format, mho_json &control_statements) |
| Evaluate a Python control script and populate control_statements. More... | |
Evaluates a Python control file (.py) and returns the resulting control statements in the same mho_json format produced by MHO_ControlFileParser + MHO_ControlConditionEvaluator.
The Python control file must define a top-level function::
from hops_control import PassInfo, Config
def configure(p: PassInfo, cfg: Config):
...
MHO_PyControlEvaluator constructs a PassInfo object (from the current pass metadata in the parameter store) and a Config object (from the control-format dict), calls configure(pass_info, config), and then converts config.to_json() back into the mho_json control_statements consumed by MHO_ParameterManager and MHO_OperatorBuilderManager.
The Python interpreter must already be initialised before calling Evaluate() - use MHO_PythonPluginInterface::EnsureInitialized().
|
static |
Evaluate a Python control script and populate control_statements.
| paramStore | Pointer to the current pass parameter store. |
| control_format | The canonical control-format dict (loaded from JSON files). |
| control_statements | Output: populated with the applicable statements. |