Skip to content

hertzforge.core.tables

tables

An object's contents as a table: headers and rows of text.

The app has its own table models, which are editable, colored, aware of units and built on Qt. This module is the read-only version: the table that goes in a report, and the one a script gets when it asks what is in a channel table without opening a window. The report and a script use the same functions here, so they always show the same table.

Functions:

Name Description
matched_rows

The table of a MatchedModes object, as values.

cell_text

One matched-modes value as text, to decimals places; None is a dash.

shape_value_text

One shape value as text, to six significant figures; a complex

shape_values

(headers, rows) of a shape set's values, or of one of its

cell_value_text

shape_value_text, and blank where there is no value.

transformation_table

(headers, rows) of a control loop's transformation

table_of

(headers, rows) for an object that has a table, else None.

Functions:

matched_rows

matched_rows(matched: Any, objects: Mapping[str, Any]) -> tuple[list[str], list[tuple[Any, ...]]]

The table of a MatchedModes object, as values.

Returns the headers and one row per pair: each set's mode number (one-based), frequency [Hz] and damping [%], the frequency error of the second set against the first as signed text in percent, the pair's MAC, and the size of the second set's mode relative to the first's (scale_ratios).

The two sets are looked up by name in objects each time, so the frequencies and damping follow any change to the sets. The MAC is the value stored in the object, because it came from the comparison as it was displayed, possibly after a projection. A set missing from objects, or a mode number past the end of its set, gives None (and a dash for the frequency error). The last column shows how the two shapes of each pair are scaled relative to each other, which an overlay cannot show because it draws each shape to its own peak; a column of 1.00 means the comparison is of shape alone.

The window's table and the report's table are drawn from these rows; table_of gives the same rows as text.

cell_text

cell_text(value: Any, decimals: int | None) -> str

One matched-modes value as text, to decimals places; None is a dash.

shape_value_text

shape_value_text(value: Any) -> str

One shape value as text, to six significant figures; a complex one as its real and imaginary parts, '0.5-0.25j'.

shape_values

shape_values(shapes: Any, dofs: Any = None, form: str = 'shapes') -> tuple[list[str], list[list[str]]]

(headers, rows) of a shape set's values, or of one of its transformations, at dofs (transform.matrix_at).

The shapes are a row per DOF, the DOF first, then a column per mode ('M1', 'M2', ...), the way a mode shape matrix is usually written: the transpose of ShapeSet.shape_matrix. The two transformations are a row per mode, then a column per DOF. A DOF the set does not have is labeled so and its values are blank.

cell_value_text

cell_value_text(value: Any) -> str

shape_value_text, and blank where there is no value.

transformation_table

transformation_table(table: Any, environment: str, form: str = 'response') -> tuple[list[str], list[list[str]]]

(headers, rows) of a control loop's transformation (ChannelTable.transformation): a row per transformation row, numbered from 1, then a column per control (or drive) channel headed by its DOF.

table_of

table_of(obj: Any, geometry: Any = None, objects: Mapping[str, Any] | None = None, environment: str | None = None) -> tuple[list[str], list[list[str]]] | None

(headers, rows) for an object that has a table, else None.

A shape set gives its modal parameters (mode, frequency, damping, description). A channel table gives its columns, plus the direction columns derived from geometry when one is given, its Control column that of environment when one is named. Matched modes give the pairs beside both sets' parameters (matched_rows), with the sets looked up in objects. Every cell is text, formatted the way it is usually quoted rather than the way it is stored: a damping of 0.0213 is '2.130' percent.