LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
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 348 of file registry.py.

348def makeRegistry(doc, configBaseType=Config):
349 """Create a `Registry`.
350
351 Parameters
352 ----------
353 doc : `str`
354 Docstring for the created `Registry` (this is set as the ``__doc__``
355 attribute of the `Registry` instance.
356 configBaseType : `lsst.pex.config.Config`-type
357 Base type of config classes in the `Registry`
358 (`lsst.pex.config.Registry.configBaseType`).
359
360 Returns
361 -------
362 registry : `Registry`
363 Registry with ``__doc__`` and `~Registry.configBaseType` attributes
364 set.
365 """
366 cls = type("Registry", (Registry,), {"__doc__": doc})
367 return cls(configBaseType=configBaseType)
368
369
table::Key< int > type
Definition: Detector.cc:163
def makeRegistry(doc, configBaseType=Config)
Definition: registry.py:348

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

400def registerConfig(name, registry, target):
401 """Decorator that adds a class as a ``ConfigClass`` in a `Registry` and
402 associates it with the given configurable.
403
404 Parameters
405 ----------
406 name : `str`
407 Name of the ``target`` in the ``registry``.
408 registry : `Registry`
409 The registry containing the ``target``.
410 target : obj
411 A configurable type, such as a subclass of `lsst.pipe.base.Task`.
412
413 See also
414 --------
415 registerConfigurable
416
417 Notes
418 -----
419 Internally, this decorator runs `Registry.register`.
420 """
421
422 def decorate(cls):
423 registry.register(name, target=target, ConfigClass=cls)
424 return cls
425
426 return decorate
def registerConfig(name, registry, target)
Definition: registry.py:400

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

370def registerConfigurable(name, registry, ConfigClass=None):
371 """A decorator that adds a class as a configurable in a `Registry`
372 instance.
373
374 Parameters
375 ----------
376 name : `str`
377 Name of the target (the decorated class) in the ``registry``.
378 registry : `Registry`
379 The `Registry` instance that the decorated class is added to.
380 ConfigClass : `lsst.pex.config.Config`-type, optional
381 Config class associated with the configurable. If `None`, the class's
382 ``ConfigClass`` attribute is used instead.
383
384 See also
385 --------
386 registerConfig
387
388 Notes
389 -----
390 Internally, this decorator runs `Registry.register`.
391 """
392
393 def decorate(cls):
394 registry.register(name, target=cls, ConfigClass=ConfigClass)
395 return cls
396
397 return decorate
398
399
table::Key< int > to
def registerConfigurable(name, registry, ConfigClass=None)
Definition: registry.py:370