visualdynamics.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.
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())
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.
Source code in src/visualdynamics/report/runs.py
histories
¶
The runs of the project: each time history not computed from another, in the project's order.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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 or system-ID run, a stack of captures) is not one run at
level, and is not read: not_read says so.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | |
outcomes
¶
outcomes(objects: Mapping[str, Any]) -> dict[str, Outcome]
The outcome of each run, by record name, from a source other than
the record: the run log extracts in the project (read_log). Empty
when the project holds none, and the chronology then leaves the
Outcome column and the explanation of each interruption to the
author.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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).
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
finish
¶
Draw each run heading group_results made, and the drafted
chronology mark_drafted put on the Chronology head, in place.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
drafted
¶
The chronology on offer, '' when there is none.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
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.
Source code in src/visualdynamics/report/runs.py
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | |