pwrs.core.feval_w_path#
- pwrs.core.feval_w_path.feval_w_path(fpath, fname, *args, nargout=None)[source]#
Evaluate a function with an optional temporary search path.
Resolves and executes
fnameeither from the current Python/MATPOWER dispatch environment or from the supplied directory path, temporarily adjusting the working directory and import path to mimic MATPOWER’sfeval_w_pathbehavior.- Parameters:
fpath (str) – Directory path to add temporarily before resolving
fname. Use an empty string to resolve in the current environment.fname (str) – Function name to resolve and call.
*args – Positional arguments passed to the resolved function.
nargout (int, optional) – MATLAB compatibility flag controlling tuple slicing for multiple outputs.
- Returns:
Function return value, or the leading
nargoutitems when the underlying function returns a tuple.- Return type:
Any