pyfebiopt.monitoring.client
Emit optimization lifecycle events to a monitoring service.
Classes
Hold options for the optimization monitoring client. |
|
Emit optimization lifecycle events to the monitor service. |
Functions
|
Produce a fresh run identifier using the provided label. |
|
Return the human label portion of a generated run id. |
Module Contents
- pyfebiopt.monitoring.client.generate_run_id(label: str | None = None) str
Produce a fresh run identifier using the provided label.
- Returns:
Run identifier combining the label slug and a random suffix.
- Return type:
str
- pyfebiopt.monitoring.client.display_label_from_run_id(run_id: str) str
Return the human label portion of a generated run id.
- Returns:
Run id without the generated random suffix when present.
- Return type:
str
- class pyfebiopt.monitoring.client.MonitorConfig
Hold options for the optimization monitoring client.
- socket_path: pathlib.Path | None = None
- run_id: str | None = None
- label: str | None = None
- class pyfebiopt.monitoring.client.OptimizationMonitorClient(config: MonitorConfig | None = None)
Emit optimization lifecycle events to the monitor service.
Initialize the emitter and run metadata.
- run_id
- label
- run_started(*, parameters: collections.abc.Mapping[str, Any] | None = None, cases: list[collections.abc.Mapping[str, Any]] | None = None, optimizer: collections.abc.Mapping[str, Any] | None = None, meta: collections.abc.Mapping[str, Any] | None = None) None
Emit the run started event.
- record_iteration(*, index: int, cost: float, theta: collections.abc.Mapping[str, float], metrics: collections.abc.Mapping[str, Any] | None = None, series: collections.abc.Mapping[str, collections.abc.Mapping[str, Any]] | None = None) None
Emit iteration progress with metrics and series data.
- run_completed(*, summary: collections.abc.Mapping[str, Any] | None = None, exit_code: int | None = None) None
Announce the completed run with optional summary.
- run_failed(*, reason: str, exit_code: int | None = None) None
Notify the monitor of a failed run.
- emit_meta(meta: collections.abc.Mapping[str, Any]) None
Send additional metadata to the monitor.