calamari.exceptions.RepeatWeightError#

exception calamari.exceptions.RepeatWeightError#

A repeat group mixes zero and non-zero standard errors.

A zero error is not “exact”: these instruments write a zero standard error when only one scan was averaged, so a zero and a real error inside one group are two different conventions in one column (see the warning on calamari.measurement.Measurement.moment_err_emu). Inverse-variance weighting cannot span them – a zero is an infinite weight, so the non-zero points would contribute nothing at all and the “weighted mean” would silently be whichever row happened to carry the zero.

Falling back to an unweighted mean would be a guess about which convention the caller meant. The message names the group and both resolutions: drop the offending rows with restrict(), or pass error='external' to weight nothing and take the observed scatter.