LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Classes | Functions
lsst.pex.config.registry Namespace Reference

Classes

class  ConfigurableWrapper
 
class  Registry
 
class  RegistryAdaptor
 
class  RegistryField
 
class  RegistryInstanceDict
 

Functions

def makeRegistry (doc, configBaseType=Config)
 
def registerConfigurable (name, registry, ConfigClass=None)
 
def registerConfig (name, registry, target)
 

Function Documentation

◆ makeRegistry()

def lsst.pex.config.registry.makeRegistry (   doc,
  configBaseType = Config 
)
Create a `Registry`.

Parameters
----------
doc : `str`
    Docstring for the created `Registry` (this is set as the ``__doc__``
    attribute of the `Registry` instance.
configBaseType : `lsst.pex.config.Config`-type
    Base type of config classes in the `Registry`
    (`lsst.pex.config.Registry.configBaseType`).

Returns
-------
registry : `Registry`
    Registry with ``__doc__`` and `~Registry.configBaseType` attributes
    set.

Definition at line 331 of file registry.py.

331 def makeRegistry(doc, configBaseType=Config):
332  """Create a `Registry`.
333 
334  Parameters
335  ----------
336  doc : `str`
337  Docstring for the created `Registry` (this is set as the ``__doc__``
338  attribute of the `Registry` instance.
339  configBaseType : `lsst.pex.config.Config`-type
340  Base type of config classes in the `Registry`
341  (`lsst.pex.config.Registry.configBaseType`).
342 
343  Returns
344  -------
345  registry : `Registry`
346  Registry with ``__doc__`` and `~Registry.configBaseType` attributes
347  set.
348  """
349  cls = type("Registry", (Registry,), {"__doc__": doc})
350  return cls(configBaseType=configBaseType)
351 
352 
table::Key< int > type
Definition: Detector.cc:167
def makeRegistry(doc, configBaseType=Config)
Definition: registry.py:331

◆ registerConfig()

def lsst.pex.config.registry.registerConfig (   name,
  registry,
  target 
)
Decorator that adds a class as a ``ConfigClass`` in a `Registry` and
associates it with the given configurable.

Parameters
----------
name : `str`
    Name of the ``target`` in the ``registry``.
registry : `Registry`
    The registry containing the ``target``.
target : obj
    A configurable type, such as a subclass of `lsst.pipe.base.Task`.

See also
--------
registerConfigurable

Notes
-----
Internally, this decorator runs `Registry.register`.

Definition at line 381 of file registry.py.

381 def registerConfig(name, registry, target):
382  """Decorator that adds a class as a ``ConfigClass`` in a `Registry` and
383  associates it with the given configurable.
384 
385  Parameters
386  ----------
387  name : `str`
388  Name of the ``target`` in the ``registry``.
389  registry : `Registry`
390  The registry containing the ``target``.
391  target : obj
392  A configurable type, such as a subclass of `lsst.pipe.base.Task`.
393 
394  See also
395  --------
396  registerConfigurable
397 
398  Notes
399  -----
400  Internally, this decorator runs `Registry.register`.
401  """
402  def decorate(cls):
403  registry.register(name, target=target, ConfigClass=cls)
404  return cls
405  return decorate
406 
def registerConfig(name, registry, target)
Definition: registry.py:381

◆ registerConfigurable()

def lsst.pex.config.registry.registerConfigurable (   name,
  registry,
  ConfigClass = None 
)
A decorator that adds a class as a configurable in a `Registry`
instance.

Parameters
----------
name : `str`
    Name of the target (the decorated class) in the ``registry``.
registry : `Registry`
    The `Registry` instance that the decorated class is added to.
ConfigClass : `lsst.pex.config.Config`-type, optional
    Config class associated with the configurable. If `None`, the class's
    ``ConfigClass`` attribute is used instead.

See also
--------
registerConfig

Notes
-----
Internally, this decorator runs `Registry.register`.

Definition at line 353 of file registry.py.

353 def registerConfigurable(name, registry, ConfigClass=None):
354  """A decorator that adds a class as a configurable in a `Registry`
355  instance.
356 
357  Parameters
358  ----------
359  name : `str`
360  Name of the target (the decorated class) in the ``registry``.
361  registry : `Registry`
362  The `Registry` instance that the decorated class is added to.
363  ConfigClass : `lsst.pex.config.Config`-type, optional
364  Config class associated with the configurable. If `None`, the class's
365  ``ConfigClass`` attribute is used instead.
366 
367  See also
368  --------
369  registerConfig
370 
371  Notes
372  -----
373  Internally, this decorator runs `Registry.register`.
374  """
375  def decorate(cls):
376  registry.register(name, target=cls, ConfigClass=ConfigClass)
377  return cls
378  return decorate
379 
380 
def registerConfigurable(name, registry, ConfigClass=None)
Definition: registry.py:353