perun.io.util

IO Util.

Module Contents

Functions

getTFactorMag(→ Tuple[float, ...)

Get transformation factor and magnitude to improve string formating.

value2ValueUnitStr(→ str)

Return a printable representation as [Value:.3f][mag][unit] (e.g. 3.05mV) of the value based on its metric metadata.

value2MeanStdStr(→ str)

Return a printable representation as [Value:.3f]±[std:.3f][mag][unit] (e.g. 3.05±0.1mV) of the value based on its metric metadata.

perun.io.util.getTFactorMag(value: numpy.number, metric_md: perun.data_model.measurement_type.MetricMetaData) Tuple[float, perun.data_model.measurement_type.Magnitude]

Get transformation factor and magnitude to improve string formating.

Parameters

valuenp.number

Reference value

metric_mdMetricMetaData

Value description

Returns

Tuple[float, Magnitude]

Scaling factor and Magnitude Enum

perun.io.util.value2ValueUnitStr(value: numpy.number, metric_md: perun.data_model.measurement_type.MetricMetaData) str

Return a printable representation as [Value:.3f][mag][unit] (e.g. 3.05mV) of the value based on its metric metadata.

Parameters

valuenp.number

Value to apply formating to.

metric_mdMetricMetaData

Value metadata.

Returns

str

String represenation

perun.io.util.value2MeanStdStr(stats: perun.data_model.data.Stats) str

Return a printable representation as [Value:.3f]±[std:.3f][mag][unit] (e.g. 3.05±0.1mV) of the value based on its metric metadata.

Parameters

statsStats obj

Stats to apply formating to.

metric_mdMetricMetaData

Value metadata.

Returns

str

String represenation