LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.daf.persistence.butlerLocation.ButlerLocation Class Reference
Inheritance diagram for lsst.daf.persistence.butlerLocation.ButlerLocation:

Public Member Functions

def __repr__ (self)
 
def __init__ (self, pythonType, cppType, storageName, locationList, dataId, mapper, storage, usedDataId=None, datasetType=None, additionalData=None)
 
def __str__ (self)
 
def setRepository (self, repository)
 
def getRepository (self)
 
def getPythonType (self)
 
def getCppType (self)
 
def getStorageName (self)
 
def getLocations (self)
 
def getLocationsWithRoot (self)
 
def getAdditionalData (self)
 
def getStorage (self)
 

Static Public Member Functions

def to_yaml (dumper, obj)
 
def from_yaml (loader, node)
 

Public Attributes

 pythonType
 
 cppType
 
 storageName
 
 mapper
 
 storage
 
 locationList
 
 additionalData
 
 dataId
 
 usedDataId
 
 datasetType
 
 repository
 

Static Public Attributes

string yaml_tag = u"!ButlerLocation"
 
 yaml_loader = yaml.UnsafeLoader
 
 yaml_dumper = yaml.Dumper
 

Detailed Description

ButlerLocation is a struct-like class that holds information needed to
persist and retrieve an object using the LSST Persistence Framework.

Mappers should create and return ButlerLocations from their
map_{datasetType} methods.

Parameters
----------
pythonType - string or class instance
    This is the type of python object that should be created when reading the location.

cppType - string or None
    The type of cpp object represented by the location (optional, may be None)

storageName - string
    The type of storage the object is in or should be place into.

locationList - list of string
    A list of URI to place the object or where the object might be found. (Typically when reading the
    length is expected to be exactly 1).

dataId - dict
    The dataId that was passed in when mapping the location. This may include keys that were not used for
    mapping this location.

mapper - mapper class instance
    The mapper object that mapped this location.

storage - storage class instance
    The storage interface that can be used to read or write this location.

usedDataId - dict
    The dataId components that were used to map this location. If the mapper had to look up keys those
    will be in this dict (even though they may not appear in the dataId parameter). If the dataId
    parameter contained keys that were not required to map this item then those keys will NOT be in this
    parameter.

datasetType - string
    The datasetType that this location represents.

additionalData : `lsst.daf.base.PropertySet`, optional
    Additional metadata to be passed to the persistence framework,
    or `None`.

Definition at line 148 of file butlerLocation.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.butlerLocation.ButlerLocation.__init__ (   self,
  pythonType,
  cppType,
  storageName,
  locationList,
  dataId,
  mapper,
  storage,
  usedDataId = None,
  datasetType = None,
  additionalData = None 
)

Definition at line 209 of file butlerLocation.py.

210  usedDataId=None, datasetType=None, additionalData=None):
211  self.pythonType = pythonType
212  self.cppType = cppType
213  self.storageName = storageName
214  self.mapper = mapper
215  self.storage = storage
216  self.locationList = iterify(locationList)
217  self.additionalData = additionalData if additionalData else dafBase.PropertySet()
218  for k, v in dataId.items():
219  self.additionalData.set(k, v)
220  self.dataId = dataId
221  self.usedDataId = usedDataId
222  self.datasetType = datasetType
223 
Class for storing generic metadata.
Definition: PropertySet.h:66
daf::base::PropertySet * set
Definition: fits.cc:912

Member Function Documentation

◆ __repr__()

def lsst.daf.persistence.butlerLocation.ButlerLocation.__repr__ (   self)

Definition at line 202 of file butlerLocation.py.

202  def __repr__(self):
203  return \
204  'ButlerLocation(pythonType=%r, cppType=%r, storageName=%r, storage=%r, locationList=%r,' \
205  ' additionalData=%r, mapper=%r, dataId=%r)' % \
206  (self.pythonType, self.cppType, self.storageName, self.storage, self.locationList,
207  self.additionalData, self.mapper, self.dataId)
208 

◆ __str__()

def lsst.daf.persistence.butlerLocation.ButlerLocation.__str__ (   self)

Definition at line 224 of file butlerLocation.py.

224  def __str__(self):
225  s = "%s at %s(%s)" % (self.pythonType, self.storageName,
226  ", ".join(self.locationList))
227  return s
228 

◆ from_yaml()

def lsst.daf.persistence.butlerLocation.ButlerLocation.from_yaml (   loader,
  node 
)
static

Definition at line 243 of file butlerLocation.py.

243  def from_yaml(loader, node):
244  obj = loader.construct_mapping(node)
245  return ButlerLocation(**obj)
246 

◆ getAdditionalData()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getAdditionalData (   self)

Definition at line 268 of file butlerLocation.py.

268  def getAdditionalData(self):
269  return self.additionalData
270 

◆ getCppType()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getCppType (   self)

Definition at line 256 of file butlerLocation.py.

256  def getCppType(self):
257  return self.cppType
258 

◆ getLocations()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getLocations (   self)

Definition at line 262 of file butlerLocation.py.

262  def getLocations(self):
263  return self.locationList
264 

◆ getLocationsWithRoot()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getLocationsWithRoot (   self)

Definition at line 265 of file butlerLocation.py.

265  def getLocationsWithRoot(self):
266  return [os.path.join(self.storage.root, loc) for loc in self.getLocations()]
267 

◆ getPythonType()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getPythonType (   self)

Definition at line 253 of file butlerLocation.py.

253  def getPythonType(self):
254  return self.pythonType
255 

◆ getRepository()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getRepository (   self)

Definition at line 250 of file butlerLocation.py.

250  def getRepository(self):
251  return self.repository
252 

◆ getStorage()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getStorage (   self)

Definition at line 271 of file butlerLocation.py.

271  def getStorage(self):
272  return self.storage

◆ getStorageName()

def lsst.daf.persistence.butlerLocation.ButlerLocation.getStorageName (   self)

Definition at line 259 of file butlerLocation.py.

259  def getStorageName(self):
260  return self.storageName
261 

◆ setRepository()

def lsst.daf.persistence.butlerLocation.ButlerLocation.setRepository (   self,
  repository 
)

Definition at line 247 of file butlerLocation.py.

247  def setRepository(self, repository):
248  self.repository = repository
249 

◆ to_yaml()

def lsst.daf.persistence.butlerLocation.ButlerLocation.to_yaml (   dumper,
  obj 
)
static
Representer for dumping to YAML
:param dumper:
:param obj:
:return:

Definition at line 230 of file butlerLocation.py.

230  def to_yaml(dumper, obj):
231  """Representer for dumping to YAML
232  :param dumper:
233  :param obj:
234  :return:
235  """
236  return dumper.represent_mapping(ButlerLocation.yaml_tag,
237  {'pythonType': obj.pythonType, 'cppType': obj.cppType,
238  'storageName': obj.storageName,
239  'locationList': obj.locationList, 'mapper': obj.mapper,
240  'storage': obj.storage, 'dataId': obj.dataId})
241 

Member Data Documentation

◆ additionalData

lsst.daf.persistence.butlerLocation.ButlerLocation.additionalData

Definition at line 217 of file butlerLocation.py.

◆ cppType

lsst.daf.persistence.butlerLocation.ButlerLocation.cppType

Definition at line 212 of file butlerLocation.py.

◆ dataId

lsst.daf.persistence.butlerLocation.ButlerLocation.dataId

Definition at line 220 of file butlerLocation.py.

◆ datasetType

lsst.daf.persistence.butlerLocation.ButlerLocation.datasetType

Definition at line 222 of file butlerLocation.py.

◆ locationList

lsst.daf.persistence.butlerLocation.ButlerLocation.locationList

Definition at line 216 of file butlerLocation.py.

◆ mapper

lsst.daf.persistence.butlerLocation.ButlerLocation.mapper

Definition at line 214 of file butlerLocation.py.

◆ pythonType

lsst.daf.persistence.butlerLocation.ButlerLocation.pythonType

Definition at line 211 of file butlerLocation.py.

◆ repository

lsst.daf.persistence.butlerLocation.ButlerLocation.repository

Definition at line 248 of file butlerLocation.py.

◆ storage

lsst.daf.persistence.butlerLocation.ButlerLocation.storage

Definition at line 215 of file butlerLocation.py.

◆ storageName

lsst.daf.persistence.butlerLocation.ButlerLocation.storageName

Definition at line 213 of file butlerLocation.py.

◆ usedDataId

lsst.daf.persistence.butlerLocation.ButlerLocation.usedDataId

Definition at line 221 of file butlerLocation.py.

◆ yaml_dumper

lsst.daf.persistence.butlerLocation.ButlerLocation.yaml_dumper = yaml.Dumper
static

Definition at line 200 of file butlerLocation.py.

◆ yaml_loader

lsst.daf.persistence.butlerLocation.ButlerLocation.yaml_loader = yaml.UnsafeLoader
static

Definition at line 197 of file butlerLocation.py.

◆ yaml_tag

string lsst.daf.persistence.butlerLocation.ButlerLocation.yaml_tag = u"!ButlerLocation"
static

Definition at line 194 of file butlerLocation.py.


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