mirror of https://github.com/m-labs/artiq.git
scan: rename ndecimals to precison
This commit is contained in:
parent
a0094aafbb
commit
94e076e976
|
@ -191,11 +191,14 @@ class Scannable:
|
|||
:param unit: A string representing the unit of the scanned variable.
|
||||
:param scale: A numerical scaling factor by which the displayed values
|
||||
are multiplied when referenced in the experiment.
|
||||
:param ndecimals: The number of decimals a UI should use.
|
||||
:param precision: The maximum number of decimals a UI should use.
|
||||
"""
|
||||
def __init__(self, default=NoDefault, unit="", scale=None,
|
||||
def __init__(self, default=NoDefault, unit="", *, scale=None,
|
||||
global_step=None, global_min=None, global_max=None,
|
||||
ndecimals=2):
|
||||
precision=2, ndecimals=None):
|
||||
if ndecimals is not None:
|
||||
print("DeprecationWarning: 'ndecimals' is deprecated. Please use 'precision' instead.")
|
||||
precision = ndecimals
|
||||
if scale is None:
|
||||
if unit == "":
|
||||
scale = 1.0
|
||||
|
@ -216,7 +219,7 @@ class Scannable:
|
|||
self.global_step = global_step
|
||||
self.global_min = global_min
|
||||
self.global_max = global_max
|
||||
self.ndecimals = ndecimals
|
||||
self.precision = precision
|
||||
|
||||
def default(self):
|
||||
if not hasattr(self, "default_values"):
|
||||
|
@ -240,7 +243,7 @@ class Scannable:
|
|||
d["global_step"] = self.global_step
|
||||
d["global_min"] = self.global_min
|
||||
d["global_max"] = self.global_max
|
||||
d["ndecimals"] = self.ndecimals
|
||||
d["precision"] = self.precision
|
||||
return d
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue