pyfebiopt.optimize.runners
Lightweight helpers for launching local FEBio runs.
Classes
Summary information about a finished simulation command. |
|
Future-like wrapper returned by runner implementations. |
|
Minimal interface expected by the optimization engine. |
|
Execute simulations sequentially on the local machine. |
|
Execute simulations concurrently using a thread pool. |
Module Contents
- class pyfebiopt.optimize.runners.RunResult
Summary information about a finished simulation command.
- exit_code: int
- started_at: float
- ended_at: float
- log_path: pathlib.Path
- metadata: dict[str, object]
- property duration: float
Execution time in seconds.
- class pyfebiopt.optimize.runners.RunHandle
Future-like wrapper returned by runner implementations.
- wait(timeout: float | None = None) RunResult
Block until the underlying future completes.
- Returns:
RunResult containing exit code and metadata.
- done() bool
Return True when the run has finished.
- cancel() bool
Attempt to cancel the run.
- Returns:
Trueif cancellation succeeded.
- class pyfebiopt.optimize.runners.Runner
Minimal interface expected by the optimization engine.
- abstractmethod run(job_dir: str | pathlib.Path, feb_name: str | pathlib.Path, *, env: dict[str, str] | None = None) RunHandle
Schedule a FEBio run and return a handle for tracking completion.
- shutdown() None
Clean up any resources held by the runner.
- class pyfebiopt.optimize.runners.LocalSerialRunner(command: collections.abc.Sequence[str] | None = None, *, env: dict[str, str] | None = None)
Bases:
_BaseLocalRunnerExecute simulations sequentially on the local machine.
Create a serial runner for single-threaded execution.