Skip to content

Text format

subsurfaceio.logplot.render.text_format

Shared text-field resolution for text and graphic columns.

Functions:

Name Description
resolve_text_field

Resolve a text or format-string field from a data record.

resolve_text_field

resolve_text_field(
    text_field: str,
    data: dict[str, Any],
    *,
    round_precision: int | None = None
) -> str | None

Resolve a text or format-string field from a data record.

Parameters:

Name Type Description Default
text_field str

Attribute name or str.format template.

required
data dict[str, Any]

One dumped data row.

required
round_precision int | None

Optional numeric rounding before stringifying.

None

Returns:

Type Description
str | None

Display string, or None when the cell should be skipped.