lsst.daf.persistence  21.0.0-5-gdf36809+87b8d260e6
Public Member Functions | Public Attributes | List of all members
lsst.daf.persistence.access.Access Class Reference

Public Member Functions

def cfg (cls, storageCfg)
 
def __init__ (self, cfg)
 
def __repr__ (self)
 
def mapperClass (self)
 
def root (self)
 
def locationWithRoot (self, location)
 
def setCfg (self, repoCfg)
 
def loadCfg (self)
 
def write (self, butlerLocation, obj)
 
def read (self, butlerLocation)
 
def exists (self, location)
 
def lookup (self, *args, **kwargs)
 

Public Attributes

 storage
 

Detailed Description

Implements an butler framework interface for Transport, Storage, and Registry

.. warning::

    Access is 'wet paint' and very likely to change. Use of it in production
    code other than via the 'old butler' API is strongly discouraged.

Definition at line 36 of file access.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.access.Access.__init__ (   self,
  cfg 
)
Initializer

:param cfg: a Policy that defines the configuration for this class. It is recommended that the cfg be
            created by calling Access.cfg()
:return:

Definition at line 55 of file access.py.

Member Function Documentation

◆ __repr__()

def lsst.daf.persistence.access.Access.__repr__ (   self)

Definition at line 64 of file access.py.

◆ cfg()

def lsst.daf.persistence.access.Access.cfg (   cls,
  storageCfg 
)
Helper func to create a properly formatted Policy to configure an Access instance.

:param storageCfg: a cfg to instantiate a storage.
:return:

Definition at line 47 of file access.py.

◆ exists()

def lsst.daf.persistence.access.Access.exists (   self,
  location 
)
Query if a location exists.

As of this writing the only storage type is PosixStorage, and it works to say that 'location' is a
simple locaiton descriptor. In the case of PosixStorage that's a path. If this needs to become more
complex it could be changed to be a butlerLocation, or something else, as needed.
:param location: a simple location descriptor, type is dependent on Storage.
:return: True if location exists, else False.

Definition at line 125 of file access.py.

◆ loadCfg()

def lsst.daf.persistence.access.Access.loadCfg (   self)
Reads the repository configuration from Storage.

:return: the Policy cfg

Definition at line 101 of file access.py.

◆ locationWithRoot()

def lsst.daf.persistence.access.Access.locationWithRoot (   self,
  location 
)
Given a location, get a fully qualified handle to location including storage root.

Note; at the time of this writing the only existing storage type is PosixStorage. This returns the
root+location.
:param location:
:return:

Definition at line 83 of file access.py.

◆ lookup()

def lsst.daf.persistence.access.Access.lookup (   self,
args,
**  kwargs 
)
Perform a lookup in the registry.

Returns a list of dataId for each valid lookup (right? TODO VERIFY)

Definition at line 136 of file access.py.

◆ mapperClass()

def lsst.daf.persistence.access.Access.mapperClass (   self)
Get the mapper class associated with a repository root.

:return: the mapper class

Definition at line 67 of file access.py.

◆ read()

def lsst.daf.persistence.access.Access.read (   self,
  butlerLocation 
)
Reads an object from storage

:param butlerLocation: describes the location & how to load the object.
:return:

Definition at line 117 of file access.py.

◆ root()

def lsst.daf.persistence.access.Access.root (   self)
Get the repository root as defined by the Storage class, this refers to the 'top' of a persisted
repository. The exact type of Root can vary based on Storage type.

:return: the root of the persisted repository.

Definition at line 74 of file access.py.

◆ setCfg()

def lsst.daf.persistence.access.Access.setCfg (   self,
  repoCfg 
)
Writes the repository configuration to Storage.

:param repoCfg: the Policy cfg to be written
:return: None

Definition at line 93 of file access.py.

◆ write()

def lsst.daf.persistence.access.Access.write (   self,
  butlerLocation,
  obj 
)
Passes an object to Storage to be written into the repository.

:param butlerLocation: the location & formatting for the object to be written.
:param obj: the object to be written.
:return: None

Definition at line 108 of file access.py.

Member Data Documentation

◆ storage

lsst.daf.persistence.access.Access.storage

Definition at line 62 of file access.py.


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