LSSTApplications  17.0+10,17.0+51,17.0+88,18.0.0+10,18.0.0+15,18.0.0+34,18.0.0+4,18.0.0+6,18.0.0-2-ge43143a+6,18.1.0-1-g0001055+2,18.1.0-1-g0896a44+10,18.1.0-1-g1349e88+9,18.1.0-1-g2505f39+7,18.1.0-1-g380d4d4+9,18.1.0-1-g5e4b7ea+2,18.1.0-1-g7e8fceb,18.1.0-1-g85f8cd4+7,18.1.0-1-g9a6769a+3,18.1.0-1-ga1a4c1a+6,18.1.0-1-gc037db8+2,18.1.0-1-gd55f500+3,18.1.0-1-ge10677a+7,18.1.0-10-g73b8679e+12,18.1.0-12-gf30922b,18.1.0-13-g451e75588,18.1.0-13-gbfe7f7f,18.1.0-2-g31c43f9+7,18.1.0-2-g9c63283+9,18.1.0-2-gdf0b915+9,18.1.0-2-gf03bb23+2,18.1.0-3-g52aa583+3,18.1.0-3-g8f4a2b1+1,18.1.0-3-g9cb968e+8,18.1.0-4-g7bbbad0,18.1.0-5-g510c42a+8,18.1.0-5-ga46117f,18.1.0-5-gaeab27e+9,18.1.0-6-gdda7f3e+11,18.1.0-8-g4084bf03+1,w.2019.34
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