silx.gui.plot.stats.statshandler

class StatFormatter(formatter='{0:.3f}', qItemClass=<class 'silx.gui.plot.stats.statshandler._FloatItem'>)[source]

Class used to apply format on Stat

Parameters:
  • formatter – the formatter. Defined as str.format()
  • qItemClass – the class inheriting from QTableWidgetItem which will be used to display the result of the statistic computation.
class StatsHandler(statFormatters)[source]

Give create:

  • Stats object which will manage the statistic computation
  • Associate formatter and Stat
Parameters:statFormatters – Stat and optional formatter. If elements are given as a tuple, elements should be (Stat, formatter). Otherwise should be Stat elements.
Return type:List or tuple
format(name, val)[source]

Apply the format for the name statistic and the given value :param name: the name of the associated statistic :param val: value before formatting :return: formatted value

calculate(item, plot, onlimits)[source]

compute all statistic registred and return the list of formatted statistics result.

Parameters:
  • item – item for which we want to compute statistics
  • plot – plot containing the item
  • onlimits – True if we want to compute statistics on visible data only
Returns:

list of formatted statistics (as str)

Return type:

dict