lsst.daf.persistence  21.0.0-2-ga885a99+4aa8b35973
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.daf.persistence.repositoryCfg.RepositoryCfg Class Reference
Inheritance diagram for lsst.daf.persistence.repositoryCfg.RepositoryCfg:

Public Member Functions

def __init__ (self, root, mapper, mapperArgs, parents, policy)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def extend (self, other)
 
def extendParents (self, newParents)
 
def root (self)
 
def root (self, root)
 
def mapper (self)
 
def mapper (self, mapper)
 
def mapperArgs (self)
 
def mapperArgs (self, newDict)
 
def parents (self)
 
def addParents (self, newParents)
 
def policy (self)
 
def matchesArgs (self, repositoryArgs)
 
def __repr__ (self)
 

Static Public Member Functions

def v1Constructor (loader, node)
 
def makeFromArgs (repositoryArgs)
 

Public Attributes

 dirty
 
 root
 
 mapper
 
 mapperArgs
 
 parents
 
 policy
 

Static Public Attributes

string yaml_tag = u"!RepositoryCfg_v1"
 

Detailed Description

RepositoryCfg stores the configuration of a repository. Its contents are persisted to the repository
when the repository is created in persistent storage. Thereafter the the RepositoryCfg should not change.

Parameters
----------
mapper : string
    The mapper associated with the repository. The string should be importable to a class object.
mapperArgs : dict
    Arguments & values to pass to the mapper when initializing it.
parents : list of URI
    URIs to the locaiton of the parent RepositoryCfgs of this repository.
policy : dict
    Policy associated with this repository, overrides all other policy data (which may be loaded from
    policies in derived packages).
deserializing : bool
    Butler internal use only. This flag is used to indicate to the init funciton that the repository class
    is being deserialized and should not perform certain operations that normally happen in other uses of
    init.

Definition at line 32 of file repositoryCfg.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.__init__ (   self,
  root,
  mapper,
  mapperArgs,
  parents,
  policy 
)

Definition at line 54 of file repositoryCfg.py.

Member Function Documentation

◆ __eq__()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.__eq__ (   self,
  other 
)

Definition at line 93 of file repositoryCfg.py.

◆ __ne__()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.__ne__ (   self,
  other 
)

Definition at line 102 of file repositoryCfg.py.

◆ __repr__()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.__repr__ (   self)

Definition at line 309 of file repositoryCfg.py.

◆ addParents()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.addParents (   self,
  newParents 
)
Add a parent or list of parents to this RepositoryCfg

Parameters
----------
newParents : string or RepositoryCfg instance, or list of these.
    If string, newParents should be a path or URI to the parent
    repository. If RepositoryCfg, newParents should be a RepositoryCfg
    that describes the parent repository in part or whole.

Definition at line 255 of file repositoryCfg.py.

◆ extend()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.extend (   self,
  other 
)
Extend this RepositoryCfg with extendable values from the other RepositoryCfg.

Currently the only extendable value is parents; see `extendParents` for more detials about extending
the parents list.

Parameters
----------
other : RepositoryCfg
    A RepositoryCfg instance to update values from.

Raises
------
RuntimeError
    If non-extendable parameters do not match a RuntimeError will be raised.
    (If this RepositoryCfg's parents can not be extended with the parents of the other repository,
    extendParents will raise).

Definition at line 105 of file repositoryCfg.py.

◆ extendParents()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.extendParents (   self,
  newParents 
)
Determine if a parents list matches our parents list, with extra items at the end. If a list of
parents does not match but the mismatch is because of new parents at the end of the list, then they
can be added to the cfg.

Parameters
----------
newParents : list of string
    A list of parents that contains all the parents that are to be recorded into this RepositoryCfg.
    This must include parents that may already be in this RepositoryCfg's parents list

Raises
------
ParentsListMismatch
    Description

Definition at line 149 of file repositoryCfg.py.

◆ makeFromArgs()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.makeFromArgs (   repositoryArgs)
static

Definition at line 276 of file repositoryCfg.py.

◆ mapper() [1/2]

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.mapper (   self)

Definition at line 194 of file repositoryCfg.py.

◆ mapper() [2/2]

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.mapper (   self,
  mapper 
)

Definition at line 198 of file repositoryCfg.py.

◆ mapperArgs() [1/2]

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.mapperArgs (   self)

Definition at line 205 of file repositoryCfg.py.

◆ mapperArgs() [2/2]

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.mapperArgs (   self,
  newDict 
)

Definition at line 209 of file repositoryCfg.py.

◆ matchesArgs()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.matchesArgs (   self,
  repositoryArgs 
)
Checks that a repositoryArgs instance will work with this repositoryCfg. This is useful
when loading an already-existing repository that has a persisted cfg, to ensure that the args that are
passed into butler do not conflict with the persisted cfg.

Definition at line 284 of file repositoryCfg.py.

◆ parents()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.parents (   self)

Definition at line 214 of file repositoryCfg.py.

◆ policy()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.policy (   self)

Definition at line 272 of file repositoryCfg.py.

◆ root() [1/2]

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.root (   self)

Definition at line 184 of file repositoryCfg.py.

◆ root() [2/2]

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.root (   self,
  root 
)

Definition at line 188 of file repositoryCfg.py.

◆ v1Constructor()

def lsst.daf.persistence.repositoryCfg.RepositoryCfg.v1Constructor (   loader,
  node 
)
static
Constructor for 'version 1' of the serlized RepositoryCfg.

If new parameters are added to RepositoryCfg they will have to be checked for in d; if they are there
then their value should be used and if they are not there a default value must be used in place.

In case the structure of the serialzed file must be changed in a way that invalidates some of the
keys:
1. Increment the version number (after _v1) in the yaml_tag of this class.
2. Add a new constructor (similar to this one) to deserialze new serializations of this class.
3. Registered the new constructor for the new version with yaml, the same way it is done at the bottom
   of this file.
4. All constructors for the older version(s) of persisted RepositoryCfg must be changed to adapt
   the old keys to their new uses and create the current (new) version of a repository cfg, or raise a
   RuntimeError in the case that older versions of serialized RepositoryCfgs can not be adapted.
There is an example of migrating from a fictitious v0 to v1 in tests/repositoryCfg.py

Definition at line 64 of file repositoryCfg.py.

Member Data Documentation

◆ dirty

lsst.daf.persistence.repositoryCfg.RepositoryCfg.dirty

Definition at line 61 of file repositoryCfg.py.

◆ mapper

lsst.daf.persistence.repositoryCfg.RepositoryCfg.mapper

Definition at line 97 of file repositoryCfg.py.

◆ mapperArgs

lsst.daf.persistence.repositoryCfg.RepositoryCfg.mapperArgs

Definition at line 98 of file repositoryCfg.py.

◆ parents

lsst.daf.persistence.repositoryCfg.RepositoryCfg.parents

Definition at line 99 of file repositoryCfg.py.

◆ policy

lsst.daf.persistence.repositoryCfg.RepositoryCfg.policy

Definition at line 100 of file repositoryCfg.py.

◆ root

lsst.daf.persistence.repositoryCfg.RepositoryCfg.root

Definition at line 96 of file repositoryCfg.py.

◆ yaml_tag

string lsst.daf.persistence.repositoryCfg.RepositoryCfg.yaml_tag = u"!RepositoryCfg_v1"
static

Definition at line 52 of file repositoryCfg.py.


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