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.butler.RepoData Class Reference

Public Member Functions

def __init__ (self, args, role)
 
def repoArgs (self)
 
def repoData (self)
 
def __repr__ (self)
 
def setCfg (self, cfg, origin, root, isV1Repository)
 
def cfgOrigin (self)
 
def isNewRepository (self)
 
def role (self)
 
def role (self, val)
 
def getParentRepoDatas (self, context=None)
 
def addParentRepoData (self, parentRepoData)
 
def addTags (self, tags)
 

Public Attributes

 cfg
 
 cfgRoot
 
 repo
 
 parentRepoDatas
 
 isV1Repository
 
 tags
 
 role
 
 parentRegistry
 
 cfgOrigin
 

Detailed Description

Container object for repository data used by Butler

Parameters
----------
args : RepositoryArgs
    The arguments that are used to find or create the RepositoryCfg.
role : string
    "input", "output", or "parent", indicating why Butler loaded this repository.
    * input: the Repository was passed as a Butler input.
    * output: the Repository was passed as a Butler output.
    * parent: the Repository was specified in the RepositoryCfg parents list of a readable repository.

Attributes
----------
cfg: RepositoryCfg
    The configuration for the Repository.

_cfgOrigin : string
    "new", "existing", or "nested". Indicates the origin of the repository and its RepositoryCfg:
    * new: it was created by this instance of Butler, and this instance of Butler will generate the
      RepositoryCfg file.
    * existing: it was found (via the root or cfgRoot argument)
    * nested: the full RepositoryCfg was nested in another RepositoryCfg's parents list (this can happen
      if parameters of an input specified by RepositoryArgs or dict does not entirely match an existing
      RepositoryCfg).

cfgRoot : string
    Path or URI to the location of the RepositoryCfg file.

repo : lsst.daf.persistence.Repository
    The Repository class instance.

parentRepoDatas : list of RepoData
    The parents of this Repository, as indicated this Repository's RepositoryCfg. If this is a new
    Repository then these are the inputs to this Butler (and will be saved in the RepositoryCfg). These
    RepoData objects are not owned by this RepoData, these are references to peer RepoData objects in the
    Butler's RepoDataContainer.

isV1Repository : bool
    True if this is an Old Butler repository. In this case the repository does not have a RepositoryCfg
    file. It may have a _mapper file and may have a _parent symlink. It will never be treated as a "new"
    repository, i.e. even though there is not a RepositoryCfg file, one will not be generated.
    If False, this is a New Butler repository and is specified by RepositoryCfg file.

tags : set
    These are values that may be used to restrict the search of input repositories. Details are available
    in the RepositoryArgs and DataId classes.

role : string
    "input", "output", or "parent", indicating why Butler loaded this repository.
    * input: the Repository was passed as a Butler input.
    * output: the Repository was passed as a Butler output.
    * parent: the Repository was specified in the RepositoryCfg parents list of a readable repository.

_repoArgs : RepositoryArgs
    Contains the arguments that were used to specify this Repository.

Definition at line 62 of file butler.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.butler.RepoData.__init__ (   self,
  args,
  role 
)

Definition at line 121 of file butler.py.

121  def __init__(self, args, role):
122  self.cfg = None
123  self._cfgOrigin = None
124  self.cfgRoot = None
125  self.repo = None
126  self.parentRepoDatas = []
127  self.isV1Repository = False
128  self.tags = set()
129  self.role = role
130  self.parentRegistry = None
131  self._repoArgs = args
132 
daf::base::PropertySet * set
Definition: fits.cc:912

Member Function Documentation

◆ __repr__()

def lsst.daf.persistence.butler.RepoData.__repr__ (   self)

Definition at line 141 of file butler.py.

141  def __repr__(self):
142  return ("{}(id={},"
143  "repoArgs={}"
144  "cfg={!r},"
145  "cfgOrigin={},"
146  "cfgRoot={},"
147  "repo={},"
148  "parentRepoDatas={},"
149  "isV1Repository={},"
150  "role={},"
151  "parentRegistry={})").format(
152  self.__class__.__name__,
153  id(self),
154  self.repoArgs,
155  self.cfg,
156  self.cfgOrigin,
157  self.cfgRoot,
158  self.repo,
159  [id(p) for p in self.parentRepoDatas],
160  self.isV1Repository,
161  self.role,
162  self.parentRegistry)
163 
table::Key< int > id
Definition: Detector.cc:162
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174

◆ addParentRepoData()

def lsst.daf.persistence.butler.RepoData.addParentRepoData (   self,
  parentRepoData 
)

Definition at line 233 of file butler.py.

233  def addParentRepoData(self, parentRepoData):
234  self.parentRepoDatas.append(parentRepoData)
235 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

◆ addTags()

def lsst.daf.persistence.butler.RepoData.addTags (   self,
  tags 
)

Definition at line 236 of file butler.py.

236  def addTags(self, tags):
237  self.tags = self.tags.union(tags)
238 
239 

◆ cfgOrigin()

def lsst.daf.persistence.butler.RepoData.cfgOrigin (   self)

Definition at line 188 of file butler.py.

188  def cfgOrigin(self):
189  return self._cfgOrigin
190 

◆ getParentRepoDatas()

def lsst.daf.persistence.butler.RepoData.getParentRepoDatas (   self,
  context = None 
)
Get the parents & grandparents etc of this repo data, in depth-first search order.

Duplicate entries will be removed in cases where the same parent appears more than once in the parent
graph.

Parameters
----------
context : set, optional
    Users should typically omit context and accept the default argument. Context is used to keep a set
    of known RepoDatas when calling this function recursively, for duplicate elimination.

Returns
-------
list of RepoData
    A list of the parents & grandparents etc of a given repo data, in depth-first search order.

Definition at line 205 of file butler.py.

205  def getParentRepoDatas(self, context=None):
206  """Get the parents & grandparents etc of this repo data, in depth-first search order.
207 
208  Duplicate entries will be removed in cases where the same parent appears more than once in the parent
209  graph.
210 
211  Parameters
212  ----------
213  context : set, optional
214  Users should typically omit context and accept the default argument. Context is used to keep a set
215  of known RepoDatas when calling this function recursively, for duplicate elimination.
216 
217  Returns
218  -------
219  list of RepoData
220  A list of the parents & grandparents etc of a given repo data, in depth-first search order.
221  """
222  if context is None:
223  context = set()
224  parents = []
225  if id(self) in context:
226  return parents
227  context.add(id(self))
228  for parent in self.parentRepoDatas:
229  parents.append(parent)
230  parents += parent.getParentRepoDatas(context)
231  return parents
232 

◆ isNewRepository()

def lsst.daf.persistence.butler.RepoData.isNewRepository (   self)

Definition at line 192 of file butler.py.

192  def isNewRepository(self):
193  return self.cfgOrigin == 'new'
194 

◆ repoArgs()

def lsst.daf.persistence.butler.RepoData.repoArgs (   self)

Definition at line 134 of file butler.py.

134  def repoArgs(self):
135  return self._repoArgs
136 

◆ repoData()

def lsst.daf.persistence.butler.RepoData.repoData (   self)

Definition at line 138 of file butler.py.

138  def repoData(self):
139  return self
140 

◆ role() [1/2]

def lsst.daf.persistence.butler.RepoData.role (   self)

Definition at line 196 of file butler.py.

196  def role(self):
197  return self._role
198 

◆ role() [2/2]

def lsst.daf.persistence.butler.RepoData.role (   self,
  val 
)

Definition at line 200 of file butler.py.

200  def role(self, val):
201  if val not in ('input', 'output', 'parent'):
202  raise RuntimeError("Invalid value for role: {}".format(val))
203  self._role = val
204 

◆ setCfg()

def lsst.daf.persistence.butler.RepoData.setCfg (   self,
  cfg,
  origin,
  root,
  isV1Repository 
)
Set information about the cfg into the RepoData

Parameters
----------
cfg : RepositoryCfg
    The RepositoryCfg for the repo.
origin : string
    'new', 'existing', or 'nested'
root : string
    URI or absolute path to the location of the RepositoryCfg.yaml file.

Returns
-------
None

Definition at line 164 of file butler.py.

164  def setCfg(self, cfg, origin, root, isV1Repository):
165  """Set information about the cfg into the RepoData
166 
167  Parameters
168  ----------
169  cfg : RepositoryCfg
170  The RepositoryCfg for the repo.
171  origin : string
172  'new', 'existing', or 'nested'
173  root : string
174  URI or absolute path to the location of the RepositoryCfg.yaml file.
175 
176  Returns
177  -------
178  None
179  """
180  if origin not in ('new', 'existing', 'nested'):
181  raise RuntimeError("Invalid value for origin:{}".format(origin))
182  self.cfg = cfg
183  self._cfgOrigin = origin
184  self.cfgRoot = root
185  self.isV1Repository = isV1Repository
186 

Member Data Documentation

◆ cfg

lsst.daf.persistence.butler.RepoData.cfg

Definition at line 122 of file butler.py.

◆ cfgOrigin

lsst.daf.persistence.butler.RepoData.cfgOrigin

Definition at line 193 of file butler.py.

◆ cfgRoot

lsst.daf.persistence.butler.RepoData.cfgRoot

Definition at line 124 of file butler.py.

◆ isV1Repository

lsst.daf.persistence.butler.RepoData.isV1Repository

Definition at line 127 of file butler.py.

◆ parentRegistry

lsst.daf.persistence.butler.RepoData.parentRegistry

Definition at line 130 of file butler.py.

◆ parentRepoDatas

lsst.daf.persistence.butler.RepoData.parentRepoDatas

Definition at line 126 of file butler.py.

◆ repo

lsst.daf.persistence.butler.RepoData.repo

Definition at line 125 of file butler.py.

◆ role

lsst.daf.persistence.butler.RepoData.role

Definition at line 129 of file butler.py.

◆ tags

lsst.daf.persistence.butler.RepoData.tags

Definition at line 128 of file butler.py.


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