Skip to main content

Module stats_widget

Module stats_widget 

Source
Expand description

Statistics table widget ported from silx gui/plot/StatsWidget.py.

StatsWidget renders one row per tracked item and one column per statistic (min / coords min / max / coords max / COM / mean / sum / delta), mirroring silx DEFAULT_STATS (StatsWidget.py:1266-1276) extended with the sum/delta aggregates exposed by crate::core::stats::Stats.

It carries an auto/manual update toggle (silx setUpdateMode, StatsWidget.py:1258-1263) and a “use visible data range” toggle (silx setStatsOnVisibleData, StatsWidget.py:1254) that selects between StatScope::All and StatScope::OnLimits.

Numeric formatting uses format_stat, a pure port of silx StatFormatter.format (statshandler.py:77-84: "{0:.3f}", "--" for None). A pure significant-digits helper format_significant is also provided for callers that prefer significant-figure rounding.

Structs§

StatsWidget
A scrollable statistics table over a set of named items.

Enums§

StatsInput
One tracked input row for the table.
UpdateMode
How the table refreshes its computed values.

Functions§

format_significant
Pure significant-digits formatter: round value to digits significant figures and render without trailing zeros, switching to exponential notation for very large/small magnitudes (mirrors C %g).
format_stat
Port of silx StatFormatter.format with the default "{0:.3f}" formatter (statshandler.py:71-84): None -> "--", otherwise three fixed decimals.