mythos.ui.loggers.disk ====================== .. py:module:: mythos.ui.loggers.disk .. autoapi-nested-parse:: Base logger protocol. Attributes ---------- .. autoapisummary:: mythos.ui.loggers.disk.MISSING_LOGDIR_WARNING Classes ------- .. autoapisummary:: mythos.ui.loggers.disk.FileLogger mythos.ui.loggers.disk.PerMetricFileLogger Functions --------- .. autoapisummary:: mythos.ui.loggers.disk.convert_to_fname mythos.ui.loggers.disk.tsnow Module Contents --------------- .. py:data:: MISSING_LOGDIR_WARNING :value: '`log_dir` not results might not be saved to disk.' .. py:function:: convert_to_fname(name: str) -> str Convert a metric name to a valid filename. .. py:function:: tsnow() -> str Get the current timestamp as a string. .. py:class:: FileLogger(log_file: str | pathlib.Path, mode: str = 'a') Logger that writes all data to a single file. .. py:attribute:: log_file .. py:method:: log_metric(name: str, value: float, step: int) -> None Log the `value` for `name` at `step`. :param name: the name of the metric :type name: str :param value: the value of the metric :type value: float :param step: the step at which the metric was recorded :type step: int .. py:method:: update_status(name: str, kind: mythos.ui.loggers.logger.StatusKind, status: mythos.ui.loggers.logger.Status) -> None Updates the status of a simulator, objective, or observable. .. py:class:: PerMetricFileLogger(log_dir: str | pathlib.Path) Bases: :py:obj:`mythos.ui.loggers.logger.Logger` Logger that writes each metric/status to its own file. .. py:attribute:: log_dir .. py:attribute:: file_handles .. py:method:: _get_file_handle(name: str) -> TextIO .. py:method:: log_metric(name: str, value: float, step: int) -> None Log the `value` for `name` at `step`. :param name: the name of the metric :type name: str :param value: the value of the metric :type value: float :param step: the step at which the metric was recorded :type step: int .. py:method:: update_status(name: str, kind: mythos.ui.loggers.logger.StatusKind, status: mythos.ui.loggers.logger.Status) -> None Updates the status of a simulator, objective, or observable.