LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
Classes | Functions
lsst.pex.config.registry Namespace Reference

Classes

class  ConfigurableWrapper
 
class  Registry
 
class  RegistryAdaptor
 
class  RegistryInstanceDict
 
class  RegistryField
 

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 336 of file registry.py.

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

◆ 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 386 of file registry.py.

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

◆ 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 358 of file registry.py.

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