forked from M-Labs/artiq
language/environment: be more verbose in NumberValue unit/scale documentation (#448)
This commit is contained in:
parent
6c39d939d8
commit
b57b1ddc57
|
@ -85,10 +85,16 @@ class NumberValue(_SimpleArgProcessor):
|
||||||
The simplest way to represent an integer argument is
|
The simplest way to represent an integer argument is
|
||||||
``NumberValue(step=1, ndecimals=0)``.
|
``NumberValue(step=1, ndecimals=0)``.
|
||||||
|
|
||||||
:param unit: A string representing the unit of the value, for user
|
For arguments with units, use both the unit parameter (a string for
|
||||||
interface (UI) purposes.
|
display) and the scale parameter (a numerical scale for experiments).
|
||||||
:param scale: The scale of value for UI purposes. The displayed value is
|
For example, ``NumberValue(1, unit="ms", scale=1*ms)`` will display as
|
||||||
divided by the scale.
|
1 ms in the GUI window because of the unit setting, and appear as the
|
||||||
|
numerical value 0.001 in the code because of the scale setting.
|
||||||
|
|
||||||
|
:param unit: A string representing the unit of the value, for display
|
||||||
|
purposes only.
|
||||||
|
:param scale: A numerical scaling factor by which the displayed value is
|
||||||
|
multiplied when referenced in the experiment.
|
||||||
:param step: The step with which the value should be modified by up/down
|
:param step: The step with which the value should be modified by up/down
|
||||||
buttons in a UI. The default is the scale divided by 10.
|
buttons in a UI. The default is the scale divided by 10.
|
||||||
:param min: The minimum value of the argument.
|
:param min: The minimum value of the argument.
|
||||||
|
|
|
@ -141,6 +141,9 @@ class Scannable:
|
||||||
"""An argument (as defined in :class:`artiq.language.environment`) that
|
"""An argument (as defined in :class:`artiq.language.environment`) that
|
||||||
takes a scan object.
|
takes a scan object.
|
||||||
|
|
||||||
|
For arguments with units, use both the unit parameter (a string for
|
||||||
|
display) and the scale parameter (a numerical scale for experiments).
|
||||||
|
|
||||||
:param global_min: The minimum value taken by the scanned variable, common
|
:param global_min: The minimum value taken by the scanned variable, common
|
||||||
to all scan modes. The user interface takes this value to set the
|
to all scan modes. The user interface takes this value to set the
|
||||||
range of its input widgets.
|
range of its input widgets.
|
||||||
|
@ -149,9 +152,9 @@ class Scannable:
|
||||||
up/down buttons in a user interface. The default is the scale divided
|
up/down buttons in a user interface. The default is the scale divided
|
||||||
by 10.
|
by 10.
|
||||||
:param unit: A string representing the unit of the scanned variable, for
|
:param unit: A string representing the unit of the scanned variable, for
|
||||||
user interface (UI) purposes.
|
display purposes only.
|
||||||
:param scale: The scale of value for UI purposes. The displayed value is
|
:param scale: A numerical scaling factor by which the displayed values
|
||||||
divided by the scale.
|
are multiplied when referenced in the experiment.
|
||||||
:param ndecimals: The number of decimals a UI should use.
|
:param ndecimals: The number of decimals a UI should use.
|
||||||
"""
|
"""
|
||||||
def __init__(self, default=NoDefault, unit="", scale=1.0,
|
def __init__(self, default=NoDefault, unit="", scale=1.0,
|
||||||
|
|
Loading…
Reference in New Issue