LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
Classes | Functions | Variables
lsst.pex.config.config Namespace Reference

Classes

class  ConfigMeta
 
class  FieldValidationError
 
class  Field
 
class  RecordingImporter
 
class  Config
 

Functions

def _joinNamePath
 
def _autocast
 
def _typeStr
 
def unreduceConfig
 

Variables

tuple __all__ = ("Config", "Field", "FieldValidationError")
 

Function Documentation

def lsst.pex.config.config._autocast (   x,
  dtype 
)
private
If appropriate perform type casting of value x to type dtype,
otherwise return the original value x

Definition at line 50 of file config.py.

50 
51 def _autocast(x, dtype):
52  """
53  If appropriate perform type casting of value x to type dtype,
54  otherwise return the original value x
55  """
56  if dtype==float and type(x)==int:
57  return float(x)
58  if dtype==int and type(x)==long:
59  return int(x)
60  return x
def lsst.pex.config.config._joinNamePath (   prefix = None,
  name = None,
  index = None 
)
private
Utility function for generating nested configuration names

Definition at line 34 of file config.py.

34 
35 def _joinNamePath(prefix=None, name=None, index=None):
36  """
37  Utility function for generating nested configuration names
38  """
39  if not prefix and not name:
40  raise ValueError("Invalid name: cannot be None")
41  elif not name:
42  name = prefix
43  elif prefix and name:
44  name = prefix + "." + name
45 
46  if index is not None:
47  return "%s[%r]"%(name, index)
48  else:
49  return name
def lsst.pex.config.config._typeStr (   x)
private
Utility function to generate a fully qualified type name.

This is used primarily in writing config files to be 
executed later upon 'load'.

Definition at line 61 of file config.py.

61 
62 def _typeStr(x):
63  """
64  Utility function to generate a fully qualified type name.
65 
66  This is used primarily in writing config files to be
67  executed later upon 'load'.
68  """
69  if hasattr(x, '__module__') and hasattr(x, '__name__'):
70  xtype = x
71  else:
72  xtype = type(x)
73  if xtype.__module__ == '__builtin__':
74  return xtype.__name__
75  else:
76  return "%s.%s"%(xtype.__module__, xtype.__name__)
def lsst.pex.config.config.unreduceConfig (   cls,
  stream 
)

Definition at line 738 of file config.py.

739 def unreduceConfig(cls, stream):
740  config = cls()
741  config.loadFromStream(stream)
742  return config

Variable Documentation

tuple lsst.pex.config.config.__all__ = ("Config", "Field", "FieldValidationError")

Definition at line 32 of file config.py.