pyfebiopt.optimize.formatting

Formatting helpers for optimization reporters.

Functions

is_finite_number(→ bool)

Return True when value can be represented as a finite float.

format_scientific(→ str)

Format numeric values for compact optimization logs.

format_fixed(→ str)

Format numeric values with six decimal places.

format_params_table(→ list[str])

Build a parameter table for console output.

format_r2_table(→ list[str])

Build an R-squared summary table.

normalise_experiments(→ list[dict[str, Any]])

Normalize case experiment descriptors for display.

format_grid(→ str)

Format a grid policy descriptor.

Module Contents

pyfebiopt.optimize.formatting.is_finite_number(value: Any) bool

Return True when value can be represented as a finite float.

pyfebiopt.optimize.formatting.format_scientific(value: Any) str

Format numeric values for compact optimization logs.

Returns:

Scientific-notation text, or "nan" for non-finite values.

pyfebiopt.optimize.formatting.format_fixed(value: Any) str

Format numeric values with six decimal places.

Returns:

Fixed-decimal text, or "nan" for non-finite values.

pyfebiopt.optimize.formatting.format_params_table(names: collections.abc.Sequence[str], values: Array, *, optimizer_vec: Array | None = None) list[str]

Build a parameter table for console output.

Returns:

Lines ready to join into a console message.

pyfebiopt.optimize.formatting.format_r2_table(r_squared: Any) list[str]

Build an R-squared summary table.

Returns:

Lines ready to join into a console message.

pyfebiopt.optimize.formatting.normalise_experiments(experiments: Any) list[dict[str, Any]]

Normalize case experiment descriptors for display.

Returns:

List of mapping-shaped experiment descriptors.

pyfebiopt.optimize.formatting.format_grid(grid: Any) str

Format a grid policy descriptor.

Returns:

Human-readable grid policy text.