Skip to content

hertzforge.service.display_units

display_units

The display unit system: the views the service sends, drawn in SI by every operation, put into the units the connection has chosen.

A view says its units as text (waterfalls.unit_text, SI's label for a dimension), so the dimension is found again from that text (dimension_of) over the dimensions the core names, their squares and densities per hertz, and the ratios and products of two (an FRF, a CPSD). A value is then taken out of SI by the system's own transform (UnitSystem.transform: SI = value * scale + offset) and labeled by it. Text the map does not hold, and anything without a unit, is left as it is.

A sentence holds its numbers where nothing can find them again, so the operation writes it in the system to begin with: the server runs it under running_in, and it asks words_system or words_in.

Converted: a spectrum's axes, its series (and a stepped series' edges) and regions; a reading's rows; a waterfall's axes, values and stage marks; a table's columns headed " []", each number in them; a column typed into (edit) too when each of its cells is one number, its to_si taking a value typed back to SI, and otherwise it stays in SI. A shape3d's coordinates are put in the system's length unit, and a measured motion's values in their own; its shapes are a picture and stay as they are, and a click that places a point (pick) says how to take its coordinates back to SI. A geometry whose units are undefined is drawn in its file's own numbers. A matrix whose value_label ends in "[]" (a scalogram's level) has its values, its color range and that unit converted; any other carries its own words.

Functions:

Name Description
systems

The unit systems a connection may choose, the core's, by name.

dimension_of

The dimension whose SI label is unit, or None.

running_in

call(*args) with its sentences in the system name. Called on the

words_system

The UnitSystem an operation's sentences are written in; SI, as its

words_in

(label, scale) for writing a value in SI of dimension in a

length_of

What the shell labels and converts a typed length by in the system name.

quantities_of

What the shell labels and converts a typed number of each of quantities (a param's

typed_lengths

values with each length param taken from the system name to meters, and each

lengths_in_words

text with each length said in meters, and each stiffness in N/m, said in the system

say_lengths

The lengths in a reading's words and in a table's length cells, in the system name.

element_values_in

A shape3d view's element_values put into the system name, in place, and

pressure_to_si

A stress typed in the system name, in pascals.

convert

views put into the system name, in place; returned for chaining.

Functions:

systems

systems() -> list[str]

The unit systems a connection may choose, the core's, by name.

dimension_of

dimension_of(unit: str | None) -> str | None

The dimension whose SI label is unit, or None.

running_in

running_in(name: str, call: Callable[..., Any], *args: Any) -> Any

call(*args) with its sentences in the system name. Called on the thread call runs on, so nothing depends on a context being carried across to a worker.

words_system

words_system() -> Any

The UnitSystem an operation's sentences are written in; SI, as its numbers are, outside running_in.

words_in

words_in(dimension: str) -> tuple[str, float]

(label, scale) for writing a value in SI of dimension in a sentence: the system's label, and what takes the value into it.

length_of

length_of(name: str) -> dict[str, Any]

What the shell labels and converts a typed length by in the system name.

quantities_of

quantities_of(name: str, quantities: set[str]) -> dict[str, dict[str, Any]]

What the shell labels and converts a typed number of each of quantities (a param's quantity, 'force/length') by in the system name.

typed_lengths

typed_lengths(params: Any, values: dict[str, Any], name: str, geometry: Any) -> dict[str, Any]

values with each length param taken from the system name to meters, and each quantity param to SI. An undefined geometry's numbers are its own, and pass as they are; with no geometry (None) they are taken as the system's.

lengths_in_words

lengths_in_words(text: str, name: str) -> str

text with each length said in meters, and each stiffness in N/m, said in the system name, to four figures; a stiffness is said at its full precision, and rounded once here.

say_lengths

say_lengths(views: list[dict], name: str) -> None

The lengths in a reading's words and in a table's length cells, in the system name.

element_values_in

element_values_in(view: dict, name: str) -> dict

A shape3d view's element_values put into the system name, in place, and nothing else of it: a recording draws the model in meters and says its stress in the system chosen. Returned for chaining.

pressure_to_si

pressure_to_si(value: float, name: str) -> float

A stress typed in the system name, in pascals.

convert

convert(views: list[dict], name: str) -> list[dict]

views put into the system name, in place; returned for chaining. SI leaves them untouched.