Skip to content

hertzforge.core.run_record

run_record

The control service's own record of one run, held in a project.

A run that the control service records leaves a run folder: a manifest, the channel table it armed with, the setup as accepted and as resolved, the law it ran, its log, its streams and results, and how it ended (hertzforge.io.run_folder). Converting the folder (hertzforge.io.run_convert) turns the streams and results into the analysis objects they are, time histories, PSDs, FRFs and the rest, and keeps everything else here, in one RunRecord per run: what the run was, what it was set to, what happened during it, and the results no analysis class holds, as named arrays with their description. Nothing in the folder is lost by the conversion.

A record is saved in the project file as the run_record kind (docs/hforge-format.md), so it survives saving, reopening and importing into another project like any other object, and the run's objects are linked to it through one object group.

Classes:

Name Description
RunRecord

What the control service recorded of one run, beyond its data.

Classes

RunRecord

RunRecord(manifest: Mapping[str, Any], table: Mapping[str, Any], setup: Mapping[str, Any], log: Sequence[Mapping[str, Any]] = (), end: Mapping[str, Any] | None = None, law: Mapping[str, Any] | None = None, law_file: tuple[str, bytes] | None = None, streams: Mapping[str, Mapping[str, Any]] | None = None, results: Mapping[str, Mapping[str, Any]] | None = None, arrays: Mapping[str, Mapping[str, ndarray]] | None = None, missing: Sequence[str] = ())

What the control service recorded of one run, beyond its data.

The members are kept as the folder had them, parsed from JSON, so a member this build knows nothing of is carried, not dropped.

Parameters:

Name Type Description Default
manifest mapping

The run's manifest (run.json): its test, identity, title, operator, article, specification, source, station, build, start, declared streams and results, and whether it completed.

required
table mapping

The channel table as armed (table.json), every row in the control service's spelling, with its revision and hash.

required
setup mapping

The setup (setup.json): config as accepted, resolved as the service resolved it, and derived, feasibility and seeded_from when the service wrote them.

required
log sequence of mapping

The run's log entries, in order.

()
end mapping

How the run ended (end.json); None for a run that did not end cleanly.

None
law mapping

The law's identity (law/law.json); None when no law ran.

None
law_file tuple of (str, bytes)

The law file's name and bytes, when the law is a file.

None
streams mapping of str to mapping

Each stream's description (stream.json) by name: its channels, rate, first station frame, gaps and shots.

None
results mapping of str to mapping

Each result's description by name, with the records of a repeating one under records.

None
arrays mapping of str to mapping of str to numpy.ndarray

The arrays of each result no analysis class holds, by result and array name; a repeating result's arrays have the record first.

None
missing sequence of str

What the folder lacked when it was converted, in words (a run that did not end, a stream cut short).

()

Attributes:

Name Type Description
source str or None

'SIM' or 'HARDWARE', from the manifest.

Methods:

Name Description
describe

A few words on the run: its test, its outcome and its log.

Attributes
test property
test: str

The test the run was ('random', 'recorder', ...).

run_uid property
run_uid: str

The run's identity, unique across restarts and machines.

run_id property
run_id: str

The service's own id for the run, which repeats after a restart.

title property
title: str

The operator's title for the run, '' when none was given.

complete property
complete: bool

Whether the run ended cleanly: its manifest says so and it has an end.

outcome property
outcome: str

How the run ended ('completed', 'aborted', 'operator_stop'), '' for a run that did not end cleanly.

config property
config: dict[str, Any]

The setup exactly as the service accepted it.

resolved property
resolved: dict[str, Any]

What the service resolved the setup to: profile, limits, schedule, control settings.

table_revision property
table_revision: int | None

The revision of the channel table the run used, as run.json names it (channel_table.revision); None when the folder does not say. It is never read from anywhere else.

table_sha256 property
table_sha256: str | None

The SHA-256 of the rows of the channel table the run used, as run.json names it (channel_table.sha256): equal for two runs on one table. None when the folder does not say.

Methods:
describe
describe() -> str

A few words on the run: its test, its outcome and its log.

Returns:

Type Description
str

Such as 'random run, completed, 14 log entries'.