forked from M-Labs/artiq
1
0
Fork 0

language/environment: be more verbose in NumberValue unit/scale documentation (#448)

This commit is contained in:
Sebastien Bourdeauducq 2016-05-28 13:05:25 -05:00
parent 7851391666
commit 8b556ef6d5
2 changed files with 16 additions and 7 deletions

View File

@ -88,10 +88,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.

View File

@ -143,6 +143,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 default: The default scan object. This parameter can be a list of :param default: The default scan object. This parameter can be a list of
scan objects, in which case the first one is used as default and the scan objects, in which case the first one is used as default and the
others are used to configure the default values of scan types that are others are used to configure the default values of scan types that are
@ -155,9 +158,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,