accelmo.runlog.reader

Reading run logs, including those of fits that are still running.

accelmo.runlog.reader.find_stages(root)[source]

Every stage logged anywhere below root (or root itself), oldest first.

root may be several directories, e.g. the run logs of runs that sit side by side.

Return type:

list[StageLog]

Parameters:

root (Path | Sequence[Path])

class accelmo.runlog.reader.StageLog(directory)[source]

Bases: object

Read access to one stage directory written by RunLog.

Nothing is cached: every call reads the files again, so a stage that is still running shows its newest steps. Use version() to tell whether anything changed since the last read.

Parameters:

directory (Path)

directory: Path
property info: dict[str, Any]

The contents of stage.json.

property name: str

Stage name.

property started: float

Start time, seconds since the epoch.

property knob_names: list[str]

Fitted knob names.

property metadata: dict[str, Any]

Stage metadata given by the fitter.

property result: dict[str, Any] | None

How the fit ended, or None while it is still running (or was killed).

property uncertainty: dict[str, Any] | None

The uncertainty stage’s state (fitted knobs, progress, timing), or None before it starts.

property label: str

name plus the run’s own label (metadata) and the directory, to tell repeated stages apart.

version()[source]

Sizes of the growing files: changes whenever a step is logged.

Return type:

tuple[int, int]

history()[source]

The logged scalars, one row per step, indexed by step.

Return type:

DataFrame

knob_history()[source]

Knob values, one row per recorded step (the start is step -1), one column per knob.

Return type:

DataFrame

steps()[source]

Every step with recorded knobs, in order.

Return type:

list[int]

knobs_at(step)[source]

The knobs after step.

Return type:

dict[str, float]

Parameters:

step (int)

best_step()[source]

The last step logged as a new best, if the fit logs new_best.

Return type:

int | None