Skip to content

run_optimization_problem: Allow passing arguments to problem class

Tjerk Vreeken requested to merge allow-passing-kwargs-to-problem-class into master

The functions run_optimization_problem() and run_simulation_problem() are commonly used to instantiate and run models. Sometimes it can be useful to override some default instance/class variables on the problem class. This commit makes that much easier by allowing one to pass additional keyword arguments to run_optimization_problem() and run_simulation_problem(), which are then passed through to the problem class's init().

Note that additional positional arguments are not allowed for future compatibility. We may want to pass additional arguments ourselves to a problem class in the future.

Merge request reports