Skip to content

hertzforge.report.calibration

calibration

Calibration in date: each sensor against the test date (report feature calibration_in_date).

The first thing a quality signer checks is that every sensor was in calibration on the test date. The channel table already holds each channel's expiration; this feature compares it with the dates of the test (core.calibration) and puts the answer where the report's reader looks for it.

  • Instrumentation. The channel table gains a Calibration column: in date, expired so many days before the test, lapses during the test, or no date given. An expired or lapsing channel's Expiration and Calibration cells are shaded in the exceedance red. Under the table, a paragraph says what was found: how many channels are in date, each one out of date by name and by how much, and the channels with no date, which were not checked. With no test date entered, or a date or cell that cannot be read, it says calibration was not checked and why.
  • Setup and Method. That section is the author's and is never generated. draft offers its equipment list with each sensor's calibration status as Markdown, a table the author may put in the section (the editor's Insert Calibration Status button, or Project.report_section with Project.report_calibration_text).

The test dates are kept on the channel-table blocks of the report (START, END), written by set_dates (Project.report_test_date, and the dates in the editor's pane on the channel table). A template keeps no dates (io.report_template), so a house template never judges the next test against the last one's date.

Functions:

Name Description
channel_table_of

The channel table a block shows, or None.

table_blocks

The indices of report's blocks showing a channel table.

span_for

The test dates a channel-table block keeps, or None.

set_dates

Set the test's dates on every channel-table block of report,

checked

(the check, the channel table) for report's first channel-table

apply

A built table block with the calibration added, when it shows a

draft

The Setup and Method section's equipment list, with each sensor's

Classes

Functions:

channel_table_of

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

The channel table a block shows, or None.

table_blocks

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

The indices of report's blocks showing a channel table.

span_for

span_for(block: Mapping[str, Any]) -> DateSpan | None

The test dates a channel-table block keeps, or None.

Raises ValueError when a kept date cannot be read one way (a file edited by hand), naming it.

set_dates

set_dates(report: Any, objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None, start: Any = None, end: Any = None) -> DateSpan | None

Set the test's dates on every channel-table block of report, and return them.

start is the first test day and end the last, for a test over several days; each a date or a YYYY-MM-DD string. A start of None or '' clears the dates.

Refused, before anything changes: a report without the feature enabled (the dates would do nothing), a report with no channel table block, and dates that cannot be read one way or run backwards.

Raises:

Type Description
ValueError

For a refusal, naming the reason.

TypeError

For a date that is neither a date nor a string.

checked

checked(report: Any, objects: Mapping[str, Any], object_groups: Sequence[Mapping[str, Any]] | None = None) -> tuple[CalibrationCheck, Any]

(the check, the channel table) for report's first channel-table block.

Raises ValueError without the feature enabled, without a channel table block, without a test date (there is then nothing to judge against, and no answer would read as in date), and for a date or an Expiration cell that cannot be read one way.

apply

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

A built table block with the calibration added, when it shows a channel table: the block with its Calibration column and marks, and the paragraph that says what was found. Any other block is returned as it was.

draft

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

The Setup and Method section's equipment list, with each sensor's calibration status on the test date, as Markdown for the author to put in the section: a sentence, a table of the sensors (channel, DOF, quantity, make, model, serial number, expiration and status), and the lines of the check.

It is offered, never written in: the section stays the author's. Refused as checked refuses.