Plugin Discovery and Validation
ropt provides helper functions for querying installed plugins at runtime.
These are useful for verifying your environment or building dynamic
configurations.
get_plugin_name looks up which plugin
provides a given method. It takes the plugin area and a method string — the same
"plugin/method" or "method" strings used in the configuration (see
Configuration) — and
returns the plugin name, or None if no plugin supports the method:
from ropt.plugins import get_plugin_name
get_plugin_name("backend", "slsqp") # "scipy"
get_plugin_name("backend", "scipy/L-BFGS-B") # "scipy"
get_plugin_name("backend", "unknown") # None
get_plugin_name("sampler", "scipy/default") # "scipy"
The area is one of "backend", "sampler", "realization_filter" or
"function_estimator".
validate_backend_options checks
whether a set of backend-specific options is valid for a given method, raising
an error if not. Call it before starting a long optimization to catch
configuration mistakes early: