lsst.daf.persistence  21.0.0-8-g5674e7b+aee49eae85
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.daf.persistence.access.AccessCfg Class Reference
Inheritance diagram for lsst.daf.persistence.access.AccessCfg:
lsst.daf.persistence.policy.Policy lsst.daf.persistence.policy._PolicyBase lsst.daf.persistence.policy._PolicyMeta

Public Member Functions

def __init__ (self, cls, storageCfg)
 
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
 

Static Public Attributes

string yaml_tag = u"!AccessCfg"
 

Detailed Description

Definition at line 29 of file access.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.access.AccessCfg.__init__ (   self,
  cls,
  storageCfg 
)

Definition at line 32 of file access.py.

Member Function Documentation

◆ __contains__()

def lsst.daf.persistence.policy.Policy.__contains__ (   self,
  key 
)
inherited

Definition at line 161 of file policy.py.

◆ __eq__()

def lsst.daf.persistence.policy.Policy.__eq__ (   self,
  other 
)
inherited

Definition at line 352 of file policy.py.

◆ __ge__()

def lsst.daf.persistence.policy.Policy.__ge__ (   self,
  other 
)
inherited

Definition at line 367 of file policy.py.

◆ __getitem__()

def lsst.daf.persistence.policy.Policy.__getitem__ (   self,
  name 
)
inherited

Definition at line 132 of file policy.py.

◆ __gt__()

def lsst.daf.persistence.policy.Policy.__gt__ (   self,
  other 
)
inherited

Definition at line 362 of file policy.py.

◆ __le__()

def lsst.daf.persistence.policy.Policy.__le__ (   self,
  other 
)
inherited

Definition at line 347 of file policy.py.

◆ __lt__()

def lsst.daf.persistence.policy.Policy.__lt__ (   self,
  other 
)
inherited

Definition at line 342 of file policy.py.

◆ __ne__()

def lsst.daf.persistence.policy.Policy.__ne__ (   self,
  other 
)
inherited

Definition at line 357 of file policy.py.

◆ __repr__()

def lsst.daf.persistence.policy.Policy.__repr__ (   self)
inherited

Definition at line 91 of file policy.py.

◆ __setitem__()

def lsst.daf.persistence.policy.Policy.__setitem__ (   self,
  name,
  value 
)
inherited

Definition at line 145 of file policy.py.

◆ asArray()

def lsst.daf.persistence.policy.Policy.asArray (   self,
  name 
)
inherited
Get a value as an array. May contain one or more elements.

:param key:
:return:

Definition at line 249 of file policy.py.

◆ defaultPolicyFile()

def lsst.daf.persistence.policy.Policy.defaultPolicyFile (   productName,
  fileName,
  relativePath = None 
)
staticinherited
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.

Definition at line 172 of file policy.py.

◆ dump()

def lsst.daf.persistence.policy.Policy.dump (   self,
  output 
)
inherited

i/o #

Writes the policy to a yaml stream.

:param stream:
:return:

Definition at line 375 of file policy.py.

◆ dumpToFile()

def lsst.daf.persistence.policy.Policy.dumpToFile (   self,
  path 
)
inherited
Writes the policy to a file.

:param path:
:return:

Definition at line 396 of file policy.py.

◆ exists()

def lsst.daf.persistence.policy.Policy.exists (   self,
  key 
)
inherited
Query if a key exists in this Policy

:param key:
:return: True if the key exists, else false.

Definition at line 292 of file policy.py.

◆ getBool()

def lsst.daf.persistence.policy.Policy.getBool (   self,
  key 
)
inherited
Get the value of a key.

:param key:
:return: the value for key

Definition at line 310 of file policy.py.

◆ getPolicy()

def lsst.daf.persistence.policy.Policy.getPolicy (   self,
  key 
)
inherited
Get a subpolicy.

:param key:
:return:

Definition at line 319 of file policy.py.

◆ getString()

def lsst.daf.persistence.policy.Policy.getString (   self,
  key 
)
inherited
Get the string value of a key.

:param key:
:return: the value for key

Definition at line 301 of file policy.py.

◆ getStringArray()

def lsst.daf.persistence.policy.Policy.getStringArray (   self,
  key 
)
inherited
Get a value as an array. May contain one or more elements.

:param key:
:return:

Definition at line 328 of file policy.py.

◆ getValue()

def lsst.daf.persistence.policy.Policy.getValue (   self,
  name 
)
inherited
Get the value for a parameter name/key. See class notes about dot-delimited access.

:param name:
:return: the value for the given name.

Definition at line 265 of file policy.py.

◆ merge()

def lsst.daf.persistence.policy.Policy.merge (   self,
  other 
)
inherited
Like Policy.update, but will add keys & values from other that DO NOT EXIST in self. Keys and
values that already exist in self will NOT be overwritten.

:param other:
:return:

Definition at line 219 of file policy.py.

◆ mergeDefaults()

def lsst.daf.persistence.policy.Policy.mergeDefaults (   self,
  other 
)
inherited
For any keys in other that are not present in self, sets that key and its value into self.

:param other: another Policy
:return: None

Definition at line 283 of file policy.py.

◆ names()

def lsst.daf.persistence.policy.Policy.names (   self,
  topLevelOnly = False 
)
inherited
Get the dot-delimited name of all the keys in the hierarchy.
NOTE: this is different than the built-in method dict.keys, which will return only the first level
keys.

Definition at line 230 of file policy.py.

◆ ppprint()

def lsst.daf.persistence.policy.Policy.ppprint (   self)
inherited
helper function for debugging, prints a policy out in a readable way in the debugger.

use: pdb> print myPolicyObject.pprint()
:return: a prettyprint formatted string representing the policy

Definition at line 82 of file policy.py.

◆ setValue()

def lsst.daf.persistence.policy.Policy.setValue (   self,
  name,
  value 
)
inherited
Set the value for a parameter name/key. See class notes about dot-delimited access.

:param name:
:return: None

Definition at line 274 of file policy.py.

◆ update()

def lsst.daf.persistence.policy.Policy.update (   self,
  other 
)
inherited
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}}

Definition at line 195 of file policy.py.

Member Data Documentation

◆ data

lsst.daf.persistence.policy.Policy.data
inherited

Definition at line 74 of file policy.py.

◆ yaml_tag

string lsst.daf.persistence.access.AccessCfg.yaml_tag = u"!AccessCfg"
static

Definition at line 30 of file access.py.


The documentation for this class was generated from the following file: