Skip to content

Commit

Permalink
Add docstring to ConfigurableInstance.
Browse files Browse the repository at this point in the history
Also fix a couple of minor other docstring problems, but not yet conforming to numpydoc standards.
  • Loading branch information
ktlim committed Sep 18, 2018
1 parent 9645794 commit c5951b7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions python/lsst/pex/config/configurableField.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@


class ConfigurableInstance:
"""A retargetable configuration for a configurable object.
Use the `value` property to access the actual Config instance; use the
target` property to access the associated configurable object (e.g. a
`Task`).
"""

def __initValue(self, at, label):
"""
if field.default is an instance of ConfigClass, custom construct
Expand Down Expand Up @@ -74,15 +81,14 @@ def __init__(self, config, field, at=None, label="default"):

def apply(self, *args, **kw):
"""
Call the confirurable.
Call the configurable.
With argument config=self.value along with any positional and kw args
"""
return self.target(*args, config=self.value, **kw)

"""
Target a new configurable and ConfigClass
"""
def retarget(self, target, ConfigClass=None, at=None, label="retarget"):
"""Target a new configurable and ConfigClass
"""
if self._config._frozen:
raise FieldValidationError(self._field, self._config, "Cannot modify a frozen Config")

Expand Down

0 comments on commit c5951b7

Please sign in to comment.