nvflare.app_common.executors.task_script_runner module

class TaskScriptRunner(custom_dir: str, script_path: str, script_args: str | list[str] | None = None, redirect_print_to_log=True)[source]

Bases: object

Wrapper for function given function path and args

Parameters:
  • custom_dir (str) – site name

  • script_path (str) – script file name, such as train.py

  • script_args – Script arguments as a legacy whitespace-delimited string or pre-tokenized argv. Use argv when values contain whitespace or quotes.

get_script_full_path(custom_dir, script_path) str[source]
get_sys_argv()[source]
logger = <Logger nvflare.app_common.executors.task_script_runner.TaskScriptRunner (WARNING)>
release_runtime()[source]

Restore globals owned by this runner, even when its thread must be abandoned.

run()[source]

Call the task_fn with any required arguments.

log_print(*args, logger=<Logger nvflare.app_common.executors.task_script_runner.TaskScriptRunner (WARNING)>, **kwargs)[source]