lsst.daf.persistence g17e5ecfddb+e5f640545a
|
Public Member Functions | |
def | __init__ (self, other=None) |
def | ppprint (self) |
def | __repr__ (self) |
def | __getitem__ (self, name) |
def | __setitem__ (self, name, value) |
def | __contains__ (self, key) |
def | update (self, other) |
def | merge (self, other) |
def | names (self, topLevelOnly=False) |
def | asArray (self, name) |
def | getValue (self, name) |
def | setValue (self, name, value) |
def | mergeDefaults (self, other) |
def | exists (self, key) |
def | getString (self, key) |
def | getBool (self, key) |
def | getPolicy (self, key) |
def | getStringArray (self, key) |
def | __lt__ (self, other) |
def | __le__ (self, other) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __gt__ (self, other) |
def | __ge__ (self, other) |
def | dump (self, output) |
i/o # More... | |
def | dumpToFile (self, path) |
Static Public Member Functions | |
def | defaultPolicyFile (productName, fileName, relativePath=None) |
Public Attributes | |
data | |
Policy implements a datatype that is used by Butler for configuration parameters. It is essentially a dict with key/value pairs, including nested dicts (as values). In fact, it can be initialized with a dict. The only caveat is that keys may NOT contain dots ('.'). This is explained next: Policy extends the dict api so that hierarchical values may be accessed with dot-delimited notiation. That is, foo.getValue('a.b.c') is the same as foo['a']['b']['c'] is the same as foo['a.b.c'], and either of these syntaxes may be used. Storage format supported: - yaml: read and write is supported.
def lsst.daf.persistence.policy.Policy.__init__ | ( | self, | |
other = None |
|||
) |
Initialize the Policy. Other can be used to initialize the Policy in a variety of ways: other (string) Treated as a path to a policy file on disk. Must end with '.yaml'. other (Policy) Copies the other Policy's values into this one. other (dict) Copies the values from the dict into this Policy.
Reimplemented in lsst.daf.persistence.access.AccessCfg.
def lsst.daf.persistence.policy.Policy.__contains__ | ( | self, | |
key | |||
) |
def lsst.daf.persistence.policy.Policy.__eq__ | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.__ge__ | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.__getitem__ | ( | self, | |
name | |||
) |
def lsst.daf.persistence.policy.Policy.__gt__ | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.__le__ | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.__lt__ | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.__ne__ | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.__setitem__ | ( | self, | |
name, | |||
value | |||
) |
def lsst.daf.persistence.policy.Policy.asArray | ( | self, | |
name | |||
) |
|
static |
Get the path to a default policy file. Determines a directory for the product specified by productName. Then Concatenates productDir/relativePath/fileName (or productDir/fileName if relativePath is None) to find the path to the default Policy file @param productName (string) The name of the product that the default policy is installed as part of @param fileName (string) The name of the policy file. Can also include a path to the file relative to the directory where the product is installed. @param relativePath (string) The relative path from the directior where the product is installed to the location where the file (or the path to the file) is found. If None (default), the fileName argument is relative to the installation directory.
def lsst.daf.persistence.policy.Policy.dump | ( | self, | |
output | |||
) |
def lsst.daf.persistence.policy.Policy.dumpToFile | ( | self, | |
path | |||
) |
def lsst.daf.persistence.policy.Policy.exists | ( | self, | |
key | |||
) |
def lsst.daf.persistence.policy.Policy.getBool | ( | self, | |
key | |||
) |
def lsst.daf.persistence.policy.Policy.getPolicy | ( | self, | |
key | |||
) |
def lsst.daf.persistence.policy.Policy.getString | ( | self, | |
key | |||
) |
def lsst.daf.persistence.policy.Policy.getStringArray | ( | self, | |
key | |||
) |
def lsst.daf.persistence.policy.Policy.getValue | ( | self, | |
name | |||
) |
def lsst.daf.persistence.policy.Policy.merge | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.mergeDefaults | ( | self, | |
other | |||
) |
def lsst.daf.persistence.policy.Policy.names | ( | self, | |
topLevelOnly = False |
|||
) |
def lsst.daf.persistence.policy.Policy.ppprint | ( | self | ) |
def lsst.daf.persistence.policy.Policy.setValue | ( | self, | |
name, | |||
value | |||
) |
def lsst.daf.persistence.policy.Policy.update | ( | self, | |
other | |||
) |
Like dict.update, but will add or modify keys in nested dicts, instead of overwriting the nested dict entirely. For example, for the given code: foo = {'a': {'b': 1}} foo.update({'a': {'c': 2}}) If foo is a dict, then after the update foo == {'a': {'c': 2}} But if foo is a Policy, then after the update foo == {'a': {'b': 1, 'c': 2}}