jax_dna.ui.loggers.logger

Base logger protocol.

Attributes

MISSING_LOGDIR_WANING

Classes

Status

Status of a simulator, objective, or observable.

Logger

Base Logger that logs to disk.

Functions

convert_to_fname(→ str)

Convert a metric name to a valid filename.

Module Contents

jax_dna.ui.loggers.logger.MISSING_LOGDIR_WANING = '`log_dir` not results might not be saved to disk.'
class jax_dna.ui.loggers.logger.Status(*args, **kwds)[source]

Bases: enum.Enum

Status of a simulator, objective, or observable.

STARTED = 0
RUNNING = 1
COMPLETE = 2
ERROR = 3
jax_dna.ui.loggers.logger.convert_to_fname(name: str) str[source]

Convert a metric name to a valid filename.

class jax_dna.ui.loggers.logger.Logger(log_dir: str | pathlib.Path | None = None)[source]

Base Logger that logs to disk.

log_dir = None
log_metric(name: str, value: float, step: int) None[source]

Log the value for name at step.

Parameters:
  • name (str) – the name of the metric

  • value (float) – the value of the metric

  • step (int) – the step at which the metric was recorded

__update_status(name: str, status: Status) None

Updates the status of a simulator, objective, or observable.

update_simulator_status(name: str, status: Status) None[source]

Updates the status of a simulator.

set_simulator_started(name: str) None[source]

Sets the status of a simulator to STARTED.

set_simulator_running(name: str) None[source]

Sets the status of a simulator to RUNNING.

set_simulator_complete(name: str) None[source]

Sets the status of a simulator to COMPLETE.

set_simulator_error(name: str) None[source]

Sets the status of a simulator to ERROR.

update_objective_status(name: str, status: Status) None[source]

Updates the status of an objective.

set_objective_started(name: str) None[source]

Sets the status of an objective to STARTED.

set_objective_running(name: str) None[source]

Sets the status of an objective to RUNNING.

set_objective_complete(name: str) None[source]

Sets the status of an objective to COMPLETE.

set_objective_error(name: str) None[source]

Sets the status of an objective to ERROR.

update_observable_status(name: str, status: Status) None[source]

Updates the status of an observable.

set_observable_started(name: str) None[source]

Sets the status of an observable to STARTED.

set_observable_running(name: str) None[source]

Sets the status of an observable to RUNNING.

set_observable_complete(name: str) None[source]

Sets the status of an observable to COMPLETE.

set_observable_error(name: str) None[source]

Sets the status of an observable to ERROR.