ogstools.logparser.monitor_cli module#
- class ogstools.logparser.monitor_cli.ExitCode[source]#
Bases:
IntEnumExit codes returned by the
cli()function.Attributes#
- SUCCESSint
0 – completed successfully.
- BOKEH_FAILEDint
1 – the bokeh subprocess exited with a non-zero return code.
- INVALID_INPUTint
2 – invalid input, e.g. the specified JSON file was not found.
- SUCCESS = 0#
- BOKEH_FAILED = 1#
- INVALID_INPUT = 2#
- __new__(value)#
- ogstools.logparser.monitor_cli.write_monitor_config(log_data='step_start_time', time_y_axis_type='linear', time_window_length=0, iteration_window_length=0, update_interval=2.0)[source]#
Write a temporary monitor.json config for the ogsmonitor dashboard app.
- Parameters:
log_data (
str|list[list[str]]) – Plot type. Can be a single string or a list of list of strings. E.g., [[‘step_start_time’, ‘step_size’], [‘assembly_time’, ‘linear_solver_time’]]time_y_axis_type (
str) – Type of the y-axis (‘linear’ or ‘log’) for simulation time-based data.time_window_length (
int) – Length of the time window (number of timesteps) for the plot. 0 plots the whole log file.iteration_window_length (
int) – Length of the iteration window (number of iterations) for the plot. 0 plots the whole log file.update_interval (
float) – Interval in seconds between plot updates.
- Return type:
- Returns:
Path to the written JSON config file.
- ogstools.logparser.monitor_cli.launch_dashboard(logfile, config=None, show=True)[source]#
Launch the ogsmonitor Bokeh dashboard for a log file, without blocking.
This starts the same
bokeh serveprocess used by theogsmonitorcommand line tool, so the dashboard opens in a real browser tab rather than trying to embed a live plot in a notebook cell’s output.- Parameters:
- Return type:
- Returns:
The running Bokeh server subprocess. Call
.terminate()on it to close the dashboard.