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 | Public Attributes | List of all members
lsst.daf.persistence.registries.PosixRegistry.LookupData Class Reference

Public Member Functions

def __init__ (self, lookupProperties, dataId)
 
def __repr__ (self)
 
def status (self)
 
def setFoundItems (self, items)
 
def addFoundItems (self, items)
 
def getMissingKeys (self)
 

Public Attributes

 dataId
 
 lookupProperties
 
 foundItems
 
 cachedStatus
 
 neededKeys
 

Detailed Description

Definition at line 137 of file registries.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.registries.PosixRegistry.LookupData.__init__ (   self,
  lookupProperties,
  dataId 
)

Definition at line 139 of file registries.py.

139  def __init__(self, lookupProperties, dataId):
140  self.dataId = copy.copy(dataId)
141  lookupProperties = sequencify(lookupProperties)
142  self.lookupProperties = copy.copy(lookupProperties)
143  self.foundItems = {}
144  self.cachedStatus = None
145  self.neededKeys = set(lookupProperties).union(dataId.keys())
146 
daf::base::PropertySet * set
Definition: fits.cc:912

Member Function Documentation

◆ __repr__()

def lsst.daf.persistence.registries.PosixRegistry.LookupData.__repr__ (   self)

Definition at line 147 of file registries.py.

147  def __repr__(self):
148  return "LookupData lookupProperties:%s dataId:%s foundItems:%s cachedStatus:%s" % \
149  (self.lookupProperties, self.dataId, self.foundItems, self.cachedStatus)
150 

◆ addFoundItems()

def lsst.daf.persistence.registries.PosixRegistry.LookupData.addFoundItems (   self,
  items 
)

Definition at line 185 of file registries.py.

185  def addFoundItems(self, items):
186  self.cachedStatus = None
187  self.foundItems.update(items)
188 

◆ getMissingKeys()

def lsst.daf.persistence.registries.PosixRegistry.LookupData.getMissingKeys (   self)

Definition at line 189 of file registries.py.

189  def getMissingKeys(self):
190  return self.neededKeys - set(self.foundItems.keys())
191 
192  def lookup(self, lookupProperties, reference, dataId, **kwargs):

◆ setFoundItems()

def lsst.daf.persistence.registries.PosixRegistry.LookupData.setFoundItems (   self,
  items 
)

Definition at line 181 of file registries.py.

181  def setFoundItems(self, items):
182  self.cachedStatus = None
183  self.foundItems = items
184 

◆ status()

def lsst.daf.persistence.registries.PosixRegistry.LookupData.status (   self)
Query the lookup status

:return: 'match' if the key+value pairs in dataId have been satisifed and keys in
lookupProperties have found and their key+value added to resolvedId
'incomplete' if the found data matches but not all keys in lookupProperties have been matched
'not match' if data in foundId does not match data in dataId

Definition at line 151 of file registries.py.

151  def status(self):
152  """Query the lookup status
153 
154  :return: 'match' if the key+value pairs in dataId have been satisifed and keys in
155  lookupProperties have found and their key+value added to resolvedId
156  'incomplete' if the found data matches but not all keys in lookupProperties have been matched
157  'not match' if data in foundId does not match data in dataId
158  """
159  class NotFound:
160  """Placeholder class for item not found.
161 
162  (None might be a valid value so we don't want to use that)
163  """
164  pass
165 
166  if self.cachedStatus is not None:
167  return self.cachedStatus
168  self.cachedStatus = 'match'
169  for key in self.lookupProperties:
170  val = self.foundItems.get(key, NotFound)
171  if val is NotFound:
172  self.cachedStatus = 'incomplete'
173  break
174  for dataIdKey, dataIdValue in self.dataId.items():
175  foundValue = self.foundItems.get(dataIdKey, NotFound)
176  if foundValue is not NotFound and foundValue != dataIdValue:
177  self.cachedStatus = 'notMatch'
178  break
179  return self.cachedStatus
180 
std::vector< SchemaItem< Flag > > * items

Member Data Documentation

◆ cachedStatus

lsst.daf.persistence.registries.PosixRegistry.LookupData.cachedStatus

Definition at line 144 of file registries.py.

◆ dataId

lsst.daf.persistence.registries.PosixRegistry.LookupData.dataId

Definition at line 140 of file registries.py.

◆ foundItems

lsst.daf.persistence.registries.PosixRegistry.LookupData.foundItems

Definition at line 143 of file registries.py.

◆ lookupProperties

lsst.daf.persistence.registries.PosixRegistry.LookupData.lookupProperties

Definition at line 142 of file registries.py.

◆ neededKeys

lsst.daf.persistence.registries.PosixRegistry.LookupData.neededKeys

Definition at line 145 of file registries.py.


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