PythonExecutor
PythonExecutor(solver_func, outcome_col)Runs a Python function in the current process, one sample at a time.
Fast and simple, so suited to analytical or surrogate models. For heavy FEA/CFD libraries prefer CLIExecutor, which runs each batch in a separate process so memory is released between batches.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| solver_func | Callable | Function taking one row of inputs (a pd.Series) and returning a number. |
required |
| outcome_col | str | Name of the outcome column to add (e.g. 'Max_Stress'). |
required |
Examples
def my_math_model(row):
return row['Length'] * 2 + row['Angle']
executor = PythonExecutor(solver_func=my_math_model, outcome_col='Signal')Methods
| Name | Description |
|---|---|
| run | Applies solver_func to each row of samples. |