From f962092b38191be64685b5b726f4b17ef10c1fb4 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 16 Apr 2016 19:38:52 +0800 Subject: [PATCH] environment: cleanup docs --- artiq/language/environment.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/artiq/language/environment.py b/artiq/language/environment.py index 0adf299be..ce8a610ab 100644 --- a/artiq/language/environment.py +++ b/artiq/language/environment.py @@ -146,8 +146,8 @@ class StringValue(_SimpleArgProcessor): class HasEnvironment: - """Provides methods to manage the environment of an experiment (devices, - parameters, results, arguments).""" + """Provides methods to manage the environment of an experiment (arguments, + devices, datasets).""" def __init__(self, device_mgr=None, dataset_mgr=None, *, parent=None, default_arg_none=False, enable_processors=False, **kwargs): self.requested_args = OrderedDict() @@ -170,11 +170,12 @@ class HasEnvironment: def build(self): """Must be implemented by the user to request arguments. - Other initialization steps such as requesting devices and parameters - or initializing real-time results may also be performed here. + Other initialization steps such as requesting devices may also be + performed here. - When the repository is scanned, any requested devices and parameters - are set to ``None``.""" + When the repository is scanned, any requested devices and arguments + are set to ``None``. + """ raise NotImplementedError def managers(self): @@ -191,6 +192,8 @@ class HasEnvironment: def get_argument(self, key, processor=None, group=None): """Retrieves and returns the value of an argument. + This function should only be called from ``build``. + :param key: Name of the argument. :param processor: A description of how to process the argument, such as instances of ``BooleanValue`` and ``NumberValue``. @@ -308,7 +311,7 @@ class HasEnvironment: class Experiment: - """Base class for experiments. + """Base class for top-level experiments. Deriving from this class enables automatic experiment discovery in Python modules. @@ -354,15 +357,15 @@ class Experiment: class EnvExperiment(Experiment, HasEnvironment): - """Base class for experiments that use the ``HasEnvironment`` environment - manager. + """Base class for top-level experiments that use the ``HasEnvironment`` + environment manager. Most experiment should derive from this class.""" pass def is_experiment(o): - """Checks if a Python object is an instantiable user experiment.""" + """Checks if a Python object is a top-level experiment class.""" return (isclass(o) and issubclass(o, Experiment) and o is not Experiment