From 4fbff1648c5e916263d0f2c541d96d2d795b0352 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 19 Jul 2023 13:10:53 +0800 Subject: [PATCH] scientific_spinbox: rename precision to sig_figs --- artiq/gui/scientific_spinbox.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/artiq/gui/scientific_spinbox.py b/artiq/gui/scientific_spinbox.py index 27d415b02..fcbf48c29 100644 --- a/artiq/gui/scientific_spinbox.py +++ b/artiq/gui/scientific_spinbox.py @@ -20,21 +20,21 @@ class ScientificSpinBox(QtWidgets.QDoubleSpinBox): self.setCorrectionMode(self.CorrectToPreviousValue) # singleStep: resolution for step, buttons, accelerators # decimals: absolute rounding granularity - # precision: number of significant digits shown, %g precision - self.setPrecision() + # sigFigs: number of significant digits shown + self.setSigFigs() self.setRelativeStep() self.setRange(-inf, inf) self.setValue(0) # self.setKeyboardTracking(False) - def setPrecision(self, d=None): + def setSigFigs(self, d=None): if d is None: d = self.decimals() + 3 - self._precision = max(1, int(d)) - self._fmt = "{{:.{}g}}".format(self._precision) + self._sig_figs = max(1, int(d)) + self._fmt = "{{:.{}g}}".format(self._sig_figs) - def precision(self): - return self._precision + def sigFigs(self): + return self._sig_figs def setRelativeStep(self, s=None): if s is None: