Skip to content

hertzforge.report.requirement

requirement

The test requirement and the result against it, in a report (report feature test_requirement).

A requirement block carries the requirement the plan states (core.requirement.TestRequirement), the specification it is held to and the run it reads, and is saved with the report and its template. With the feature on it draws two things:

  • the requirement in words: the governing document and its revision, the tolerance clause, the control strategy, each band and tolerance, the decision rule, and where each number came from, with "supplied by the customer; the laboratory has not verified its derivation" for a number the customer supplied. With skeleton sections on, it falls under the Requirement section, where the author still owes the plan, the failure definition and the completion criteria.
  • beneath it, with the feature control_uncertainty on as well, the control channels' measurement uncertainty against one third of the tolerance (uncertainty): a row per control channel with its contributions, the combined uncertainty in percent on the acceleration, on the ASD and in dB, the third it is held against, and met, not met or not judged; one line saying it was not judged when nothing is entered.
  • the result table: a row per criterion with what was required, what was measured (each miss with its band, its worst size in dB and its line count) and the result, worded met, not met or not judged, and a note beneath with what the rows cannot say. Its cross-axis rows read each cross-axis channel against its in-axis channel, and its limit-channel rows give each notch a limit channel cut, the as-run notch, against the notches the plan names. A row with a notch the plan does not name, and a cross-axis row over its limit, offers its fact to the findings register (core.requirement.Criterion.finding): draft_finding builds the fact draft, naming the record, and hands it to the register's one entry point for drafts (report.findings.offer), as a comparison's draft is handed. With the feature findings on, a Finding column gives each such row the number of the finding its fact went to, or says none is entered. With skeleton sections on, the table falls under Results.

The pass/fail box reads from a requirement bound to the same specification and run: MET, NOT MET or NOT JUDGED, how many criteria were met against which document, the criteria not met and not judged, and the decision rule. A box with no requirement bound to its pair keeps its reading and is labeled a screening by the Hertzforge default rule, so it is never read as a statement of conformity. Both only while the feature is on; with it off a requirement block is not drawn and the box is the box it was.

Nothing here is the author's text: the requirement is the author's own numbers in words, and the table states what the program measured. The statement of conformity in the conclusion stays the author's.

Where the requirement's run takes its duration at level is one function, run_duration, so a later source of run identity feeds it there and nowhere else.

Classes:

Name Description
Made

The page blocks one requirement block draws: its words, for the

Functions:

Name Description
add

Give report a requirement block and return its index.

run_duration

How long the block's run was at level, seconds, or None when

inputs

(requirement, specification, run, the specification's name, the

channel_table

The project's channel table, whose Control flags name the control

roles_on

Whether report reads the cross-axis and limit channels (the

read

The block's core.requirement.Results, or None while a binding

pending

The requirement blocks of report with no kept reading, or whose

prepare

Read every requirement block of report with no kept reading, so

build

The page blocks of one requirement block, or None while a binding

place

The skeleton's page blocks with each requirement's words at the

requirement_lines

The block's requirement in words, a line each

uncertainty

The control channels' measurement uncertainty against one third

table

The result table: a row per criterion, its result cell marked by

fact_draft

The report.findings.FactDraft a row of the result table offers:

draft_finding

Offer finding number the fact a row of a result table offers,

matching

The requirement block the pass/fail block verdict reads from:

verdict

The pass/fail box built from block, as the feature draws it.

Classes

Made dataclass

Made(words: list[dict[str, Any]], results: list[dict[str, Any]])

The page blocks one requirement block draws: its words, for the Requirement section, and its result table and note, for Results.

Functions:

add

add(report: Any, requirement: Any, *, source: str, measured: str, duration_run: float | None = None, caption: str = '', at: int | None = None) -> int

Give report a requirement block and return its index.

The block is a text block carrying the requirement's values (TestRequirement.as_record), the specification (source) and the run (measured) it reads, the run's duration at level when stated, and the table's caption. It is drawn only while the feature is on, and is saved with the report and its template. It is put at at, or after the report's first pass/fail box, or at the end; without the skeleton it draws where it stands.

Raises TypeError when requirement is not a TestRequirement, and ValueError for a duration that is not a positive number or a binding left empty. Nothing is changed when it raises.

run_duration

run_duration(block: Mapping[str, Any], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> float | None

How long the block's run was at level, seconds, or None when nothing says.

Today it is the controller's counter, typed on the block (duration_run). This is the one place the result table takes it from, so a later source (a run's own identity) is read here.

inputs

inputs(block: Mapping[str, Any], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> tuple[Any, Any, Any, str, str] | None

(requirement, specification, run, the specification's name, the run's name), or None while either binding does not resolve.

Raises ValueError for stored values the requirement refuses.

channel_table

channel_table(objects: Mapping[str, Any]) -> Any

The project's channel table, whose Control flags name the control channels, or None.

roles_on

roles_on(report: Any) -> bool

Whether report reads the cross-axis and limit channels (the feature cross_axis).

read

read(block: Mapping[str, Any], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None, *, roles: bool = True) -> Any

The block's core.requirement.Results, or None while a binding does not resolve. Refusals raise ValueError as core.requirement.evaluate raises them. With roles False (the report's feature cross_axis off) the cross-axis and limit channels are not read, and their rows say so.

Made once and kept while the requirement, the duration and the objects it read stay the same (in check_blocks's store of readings), since a reading of several control channels takes longer than the GUI thread may wait; the app makes it on its worker first (prepare).

pending

pending(report: Any, objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> list[Mapping[str, Any]]

The requirement blocks of report with no kept reading, or whose reading was canceled: what prepare would read. Empty when the feature is off.

prepare

prepare(report: Any, objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None, *, progress: Any = None) -> int

Read every requirement block of report with no kept reading, so the page is drawn without reading any. progress(done, total) is told before each and at the end; what it raises (a cancel) stops there, and each block not yet read is kept as canceled, drawn as nothing judged and offered again by pending. Returns how many were read.

build

build(block: Mapping[str, Any], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None, *, uncertainty_on: bool = False, roles_on: bool = False, register: Sequence[Mapping[str, Any]] | None = None) -> Made | None

The page blocks of one requirement block, or None while a binding does not resolve. A requirement that cannot be read against its run at all draws its words and, for the results, one paragraph saying why, since a reading that judged nothing says so. uncertainty_on (the feature control_uncertainty) adds the control channels' uncertainty under the words, roles_on (the feature cross_axis) reads the cross-axis and limit channels, and register (the findings entered, with the feature findings on) gives a row that offers a finding its Finding cell.

place

place(blocks: Sequence[dict[str, Any]], made: Sequence[Made]) -> list[dict[str, Any]]

The skeleton's page blocks with each requirement's words at the end of the Requirement section and its result table and note at the head of Results, before the figures, since the control result against the tolerance is what that section opens with.

requirement_lines

requirement_lines(block: Mapping[str, Any]) -> list[str]

The block's requirement in words, a line each (TestRequirement.describe). Raises ValueError for stored values the requirement refuses.

uncertainty

uncertainty(requirement: Any, channels: Sequence[str] | None = None) -> list[dict[str, Any]]

The control channels' measurement uncertainty against one third of the tolerance (core.requirement.uncertainty_budget): a table with a row per control channel and a note, or, with nothing entered for any, one line saying it was not judged.

table

table(results: Any, name: str = '', caption: str = '', register: Sequence[Mapping[str, Any]] | None = None) -> dict[str, Any]

The result table: a row per criterion, its result cell marked by state. With a findings register (the feature findings on), a Finding column is added when any row offers a finding (Criterion.finding): the numbers of the findings its fact went to, or UNENTERED; blank on a row that offers none.

fact_draft

fact_draft(row: Any, results: Any, measured: str, specification: str, provenance: Mapping[str, Mapping[str, Any]] | None = None) -> Any

The report.findings.FactDraft a row of the result table offers: its fact (Criterion.finding), the record it was read off and the time history that record came from where provenance (the project's) says, and the scale the run was compared at. The time history, or else the record, is the run; the channel and band are the offer's.

Raises ValueError for a row that offers no finding.

draft_finding

draft_finding(report: Any, number: str, objects: Mapping[str, Any], measured: str, specification: str, criterion: int | str, object_groups: Sequence[Mapping[str, Any]] | None = None, *, provenance: Mapping[str, Mapping[str, Any]] | None = None) -> Any

Offer finding number the fact a row of a result table offers, and return the draft (fact_draft).

The row is of the requirement bound to specification and measured, read as the page reads it, and is named by criterion: its number in the table from 1, or its name. The draft goes to the finding through the register's one entry point for drafts (report.findings.offer), so it fills nothing until the author accepts it.

Raises:

Type Description
ValueError

When the report does not have the features test_requirement and findings enabled; for an unknown finding, no requirement bound to the pair, one that cannot be read, a row number out of range, a name no row has, a name two offering rows share, and a row that offers no finding. Nothing is changed.

matching

matching(report: Any, verdict: Mapping[str, Any], objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> Mapping[str, Any] | None

The requirement block the pass/fail block verdict reads from: the first bound to the same specification and run, else the one requirement of a report that holds one (the box of a generated report judges the octave-band pair, the requirement the narrowband run of the same test), else None.

verdict

verdict(built: dict[str, Any] | None, block: Mapping[str, Any], report: Any, objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> dict[str, Any] | None

The pass/fail box built from block, as the feature draws it.

Read from a requirement bound to the same pair when the report has one: 'requirement' carries the result (its state, how many criteria were met of how many, the document, the criteria not met and not judged, and the rule). Otherwise the box keeps its reading and is marked 'screening'. None stays None.