LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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.