pyfebiopt.optimize.formatting
=============================

.. py:module:: pyfebiopt.optimize.formatting

.. autoapi-nested-parse::

   Formatting helpers for optimization reporters.



Functions
---------

.. autoapisummary::

   pyfebiopt.optimize.formatting.is_finite_number
   pyfebiopt.optimize.formatting.format_scientific
   pyfebiopt.optimize.formatting.format_fixed
   pyfebiopt.optimize.formatting.format_params_table
   pyfebiopt.optimize.formatting.format_r2_table
   pyfebiopt.optimize.formatting.normalise_experiments
   pyfebiopt.optimize.formatting.format_grid


Module Contents
---------------

.. py:function:: is_finite_number(value: Any) -> bool

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


.. py:function:: format_scientific(value: Any) -> str

   Format numeric values for compact optimization logs.

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


.. py:function:: format_fixed(value: Any) -> str

   Format numeric values with six decimal places.

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


.. py:function:: 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.


.. py:function:: format_r2_table(r_squared: Any) -> list[str]

   Build an R-squared summary table.

   :returns: Lines ready to join into a console message.


.. py:function:: normalise_experiments(experiments: Any) -> list[dict[str, Any]]

   Normalize case experiment descriptors for display.

   :returns: List of mapping-shaped experiment descriptors.


.. py:function:: format_grid(grid: Any) -> str

   Format a grid policy descriptor.

   :returns: Human-readable grid policy text.


