hertzforge.report.runs¶
runs
¶
Runs and chronology (report feature run_sections).
A real test is a dozen runs on three axes, and a report bound to one time history cannot be the report of the test. With the feature on:
- every time history in the project is a run, with its identity
(
identity): what its file's name said on import (core.runs.read_name), what was entered (set_identity), and the level the comparison with a specification detects (compliance.read_scale_db) when nothing else gives it. Anything read two ways is refused with the record named, and stays unknown until it is entered. A history cut or filtered from another is the same run as the one it came from (root_of), not a run of its own; - the Results section of the skeleton is grouped by run
(
group_results): each generated section whose figures all come from one run goes under that run's heading, in the order the runs were run, and a section that compares runs, or comes from none, stays first.repeatadds the Results sections a report has for one run again for each other run, bound to that run's own objects; - the chronology of the runs (
chronology): each run in order with its axis, level, start, the time it was at level and the interruptions found in its record (core.runs.read_levels), offered as draft text for the skeleton's Chronology section (draft). The chronology is the author's: the draft is placed only when the author accepts it (skeleton.write), and the outcome of each run and the explanation of each interruption are left to the author.
A run log brought into the project (Project.attach_run_log) is a
second, optional source (read_log): the outcome of each run as the
log records it, the cause of each interruption where the record and the
log agree on how many there were, and, under the table, the log's own
interruptions with their cause, path and restart and the time credited
on each axis. A record is matched to the log's run by its run number and
axis; a record the log does not hold, or holds more than once, keeps its
Outcome blank and the draft says why. Without an extract nothing here
changes, and a project with an extract but no time history is offered
the log's own chronology (RunLogExtract.draft_chronology). The draft
says which log, test and entry it was drawn from, with the extract's
badge when the log has newer entries, and the editing page marks it as
drafted from the run log until the author accepts it.
A run the control service recorded carries its own record
(core.run_record, linked to its histories by one object group), and
that record is read before anything is inferred
(report.run_records): the run's level is the level it ended at, as the
controller logged it; the chronology lists the run once, however many
streams it has, with the holds, resumes and trips the controller logged
and the outcome in the record's own words, and under the table its
operator, article, specification, level changes, alarms and counts. A
run with no record is read from its name and its signal levels exactly
as before, and where the two kinds are mixed the table says which each
row was read from.
Classes:
| Name | Description |
|---|---|
Outcome |
What a source other than the record says of a run: its outcome |
LogSource |
What the run log extracts in a project say of its runs |
RunRow |
One run in the chronology: its record, identity, what its record |
Chronology |
The runs in the order they were run ( |
Functions:
| Name | Description |
|---|---|
root_of |
The run |
histories |
The runs of the project: each time history not computed from |
identity |
The run identity of the time history |
set_identity |
Enter fields of the run identity of the time history |
read_record |
What the record of run |
read_log |
What the run log extracts in the project say of its runs. |
outcomes |
The outcome of each run, by record name, from a source other than |
chronology |
The runs of the project in the order they were run, each with its |
draft |
The chronology as Markdown for the skeleton's Chronology section: |
runs_of |
The runs a report block draws from: the run of each object its |
run_order |
The runs |
heading |
A run's heading over its results: 'Run 7, Z axis, -6 dB, |
group_results |
The page laid out by |
finish |
Draw each run heading |
offer |
Offer |
drafted |
The chronology on offer, '' when there is none. |
accept |
Make the chronology on offer the section's words, or |
mark_drafted |
Put the chronology on offer on the Chronology head the skeleton |
counterpart |
The object computed from run |
repeat |
Add, for each run the report does not draw on yet, the report's |
Classes¶
Outcome
dataclass
¶
What a source other than the record says of a run: its outcome ('completed', 'aborted by the limit channel') and an explanation for each interruption found, in order.
LogSource
dataclass
¶
LogSource(outcomes: Mapping[str, Outcome] = dict(), notes: tuple[str, ...] = (), lines: tuple[str, ...] = (), logs: tuple[str, ...] = ())
What the run log extracts in a project say of its runs
(read_log): the outcome of each run by record name, a note on each
record the log could not answer for, the Markdown the chronology
draft carries under its table, and the extracts read, by name. Empty
when the project holds no extract.
RunRow
dataclass
¶
RunRow(name: str, identity: RunIdentity, reading: RecordReading, outcome: Outcome = Outcome(), record: RunFacts | None = None, together: tuple[str, ...] = ())
One run in the chronology: its record, identity, what its record shows, and what a later source says of it.
Chronology
dataclass
¶
Chronology(rows: tuple[RunRow, ...], ordered_by: str, notes: tuple[str, ...] = (), logged: tuple[str, ...] = (), logs: tuple[str, ...] = ())
The runs in the order they were run (chronology). ordered_by
is 'start' or 'run number', '' for a lone run; notes are what was
refused or left out, each naming its record.
Functions:¶
root_of
¶
The run name belongs to: the time history it was computed from,
through any number of steps, back to the first. A history derived
from another (cut, filtered) answers with the one it came from.
None when name comes from no time history.
histories
¶
The runs of the project: each time history not computed from another, in the project's order.
identity
¶
identity(objects: Mapping[str, Any], name: str, object_groups: Sequence[Mapping[str, Any]] | None = None) -> RunIdentity
The run identity of the time history name, as the report reads it.
What the history carries (read from its file's name on import, or entered), and the level from the comparison with its specification when nothing else gives one. A level read from a name and a different one read from the comparison is refused, named; an entered level stands over both. An object computed from a history answers with that run's identity.
Raises ValueError for a name not in the project, and TypeError
for an object that is not a time history and comes from none.
set_identity
¶
set_identity(objects: Mapping[str, Any], name: str, **fields: Any) -> RunIdentity
Enter fields of the run identity of the time history name, and
return what it carries afterwards.
An entered field stands over what was read; an empty string clears
it, back to what the record shows. Refused, before anything
changes: a history computed from another (its run is that one's),
with ValueError; an object that is not a time history, with
TypeError; and every refusal of core.runs.entered, each naming
the record.
read_record
¶
read_record(objects: Mapping[str, Any], name: str, object_groups: Sequence[Mapping[str, Any]] | None = None, window_s: float = WINDOW_S, drop_db: float = DROP_DB, min_s: float = MIN_S) -> RecordReading
What the record of run name shows: its time at level and the
interruptions in it (core.runs.read_levels), on its control
channels. A record of bursts or events (a shock, a transient, a
modal survey, a stack of captures) is not one run at level, and is
not read: not_read says so. That is read from the record, so one
record gives one reading whichever module last worked it up.
read_log
¶
read_log(objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> LogSource
What the run log extracts in the project say of its runs.
Each run of the project (each time history not computed from another) is matched to a run of an extract by its run number and, where both are known, its axis. A record matched to one logged run gets that run's outcome and an explanation for each of the run's logged interruptions, in order. A record with no run number, one the logs do not hold, and one they hold more than once (two tests, or two axes when the record's axis is not known) get no outcome and a note naming them. Under the table go, for each extract, which log, test and entry it holds (with its badge when the log has newer entries), its interruptions with their cause, path and restart, and the time credited on each axis; a log with no interruption says it holds none and leaves to the author whether the test ran without one.
Empty when the project holds no extract, so the chronology is then the records' alone.
outcomes
¶
outcomes(objects: Mapping[str, Any]) -> dict[str, Outcome]
The outcome of each run, by record name, from a source other than
its signal: its run record where it has one, in the record's words,
else the run log extracts in the project (read_log). Empty when
the project holds neither, and the chronology then leaves the
Outcome column and the explanation of each interruption to the
author.
chronology
¶
chronology(objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None, window_s: float = WINDOW_S, drop_db: float = DROP_DB, min_s: float = MIN_S, progress: Callable[[int, int], None] | None = None) -> Chronology
The runs of the project in the order they were run, each with its
identity and what its record shows, and what the run log extracts
in the project say of them (read_log) when there are any.
Raises ValueError when the project holds no time history, when
the order cannot be read from the identities (naming the records
with neither a start nor a run number), and for a window, drop or
duration core.runs.read_levels refuses.
draft
¶
draft(found: Chronology) -> str
The chronology as Markdown for the skeleton's Chronology section: a table of the runs in order, then how the time at level and the interruptions were read, and what is the author's to add.
Draft text only: nothing places it in a report until the author
accepts it (Project.report_section).
runs_of
¶
runs_of(block: Mapping[str, Any], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> set[str]
The runs a report block draws from: the run of each object its data fields bind. Empty for text, and for a figure of a specification alone.
run_order
¶
run_order(objects: Mapping[str, Any], names: Sequence[str], object_groups: Sequence[Mapping[str, Any]]) -> tuple[list[str], dict[str, RunIdentity]]
The runs names in the order they were run, and each one's
identity. When the identities cannot say the order, the project's
order: a page keeps showing the runs, and the chronology, which
refuses, names what to enter.
heading
¶
heading(name: str, found: RunIdentity) -> str
A run's heading over its results: 'Run 7, Z axis, -6 dB, 2026-10-11 11:11:05 (Time History 2)', or the record's name alone when nothing identifies the run.
group_results
¶
group_results(blocks: list[dict[str, Any]], origin_of: Mapping[int, Mapping[str, Any]], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> list[dict[str, Any]]
The page laid out by skeleton.arrange, with its Results section
grouped by run.
origin_of maps each built block (by id) to the report block it
was built from. The blocks under the Results head are read in their
generated sections; a section whose figures all come from one run
goes under that run's heading (a text block carrying run_head, for
finish), runs in the order they were run; a section that draws on
no run, or on several, stays first. The checks (feature
check_blocks, their blocks still carrying 'check_head') stay where
that feature puts them, closing the section. Nothing is grouped when
no section comes from a run, or when the only run is one nothing
identifies.
finish
¶
Draw each run heading group_results made, and the drafted
chronology mark_drafted put on the Chronology head, in place.
offer
¶
Offer text as the drafted chronology of report, and return the
index of the Chronology section's block.
The draft is kept on the section's block as 'draft', apart from the
section's words, which do not change: the section stays owed, and
the editing page shows the draft under the owed card, marked as
drafted. A new draft replaces the one on offer. logs names the run
log extracts the draft drew on, so the editing page can show their
badge when a log has grown since, and mark is what it is marked
with; both are kept only for a draft that drew on a run log.
accept
¶
Make the chronology on offer the section's words, or text, the
draft as the author edited it, and return the block's index. The
draft is no longer on offer afterwards.
Raises ValueError when there is no draft on offer and no text.
mark_drafted
¶
mark_drafted(blocks: Sequence[dict[str, Any]], report: Any, objects: Mapping[str, Any] | None = None) -> None
Put the chronology on offer on the Chronology head the skeleton
laid out, while that section is owed, for finish to draw marked
as drafted. Once the author has written the section, a draft left
on its block is not shown. With objects, a draft that drew on a
run log is marked with the badge of each extract whose log has
grown or changed since, or that is no longer in the project.
counterpart
¶
The object computed from run run the way name was computed from
its own run: same kind, same steps with the same parameters. (name,
'') when there is one; (None, why) when there is none, or more than
one.
repeat
¶
repeat(report: Any, objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> list[str]
Add, for each run the report does not draw on yet, the report's Results sections for its first run again, bound to that run's own objects. Returns a line per run on what was added or why not.
A section is a generated section of the report (its '## ' heading
and what follows) that the skeleton places under Results and whose
figures all come from one run, the first run the report draws on in
time order. Each copy binds by name the
object computed from the other run the same way (counterpart),
and its captions name that run; a section with a figure that has no
counterpart is not copied, and the line says what to compute. The
copies are placed after the first run's last section, so the
report's closing text stays last. A check of its own is not copied:
it is drawn with the checks, not in a section. A run already drawn
on is left alone, so a second call adds nothing.
Raises ValueError when the report draws on no run, or has no
Results section drawn from one: there is then nothing to repeat.