CustomFormattedValueWithMetadata#

class mobgap.utils.tables.CustomFormattedValueWithMetadata(
value: float,
metadata: dict[str, Any] | None = None,
precision: int = 2,
)[source]#

A custom object to represent a value with a range and stats results.

In the context of comparisons, it acts like it’s value, but it can also be used to display the value and range.

Methods

html_styler(st)

Apply HTML styling to the DataFrame using the custom HTML representation.

style_html(value)

Return a string representation of the value for styling purposes.

__init__(
value: float,
metadata: dict[str, Any] | None = None,
precision: int = 2,
) None[source]#

Initialize the ValueWithMetadata object.

Parameters:
value

The value to be stored.

metadata

Optional metadata associated with the value.

precision

The number of decimal places to use for formatting the value.

classmethod html_styler(
st: Styler,
) Styler[source]#

Apply HTML styling to the DataFrame using the custom HTML representation.

classmethod style_html(value: Any) Any[source]#

Return a string representation of the value for styling purposes.