LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.daf.persistence.butler.RepoData Class Reference
Inheritance diagram for lsst.daf.persistence.butler.RepoData:

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 65 of file butler.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 124 of file butler.py.

124  def __init__(self, args, role):
125  self.cfg = None
126  self._cfgOrigin = None
127  self.cfgRoot = None
128  self.repo = None
129  self.parentRepoDatas = []
130  self.isV1Repository = False
131  self.tags = set()
132  self.role = role
133  self.parentRegistry = None
134  self._repoArgs = args
135 
daf::base::PropertySet * set
Definition: fits.cc:884
def __init__(self, minimum, dataRange, Q)

Member Function Documentation

◆ __repr__()

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

Definition at line 144 of file butler.py.

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

◆ addParentRepoData()

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

Definition at line 236 of file butler.py.

236  def addParentRepoData(self, parentRepoData):
237  self.parentRepoDatas.append(parentRepoData)
238 
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 239 of file butler.py.

239  def addTags(self, tags):
240  self.tags = self.tags.union(tags)
241 
242 

◆ cfgOrigin()

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

Definition at line 191 of file butler.py.

191  def cfgOrigin(self):
192  return self._cfgOrigin
193 

◆ 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 208 of file butler.py.

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

◆ isNewRepository()

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

Definition at line 195 of file butler.py.

195  def isNewRepository(self):
196  return self.cfgOrigin == 'new'
197 

◆ repoArgs()

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

Definition at line 137 of file butler.py.

137  def repoArgs(self):
138  return self._repoArgs
139 

◆ repoData()

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

Definition at line 141 of file butler.py.

141  def repoData(self):
142  return self
143 

◆ role() [1/2]

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

Definition at line 199 of file butler.py.

199  def role(self):
200  return self._role
201 

◆ role() [2/2]

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

Definition at line 203 of file butler.py.

203  def role(self, val):
204  if val not in ('input', 'output', 'parent'):
205  raise RuntimeError("Invalid value for role: {}".format(val))
206  self._role = val
207 
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168

◆ 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 167 of file butler.py.

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

Member Data Documentation

◆ cfg

lsst.daf.persistence.butler.RepoData.cfg

Definition at line 125 of file butler.py.

◆ cfgOrigin

lsst.daf.persistence.butler.RepoData.cfgOrigin

Definition at line 196 of file butler.py.

◆ cfgRoot

lsst.daf.persistence.butler.RepoData.cfgRoot

Definition at line 127 of file butler.py.

◆ isV1Repository

lsst.daf.persistence.butler.RepoData.isV1Repository

Definition at line 130 of file butler.py.

◆ parentRegistry

lsst.daf.persistence.butler.RepoData.parentRegistry

Definition at line 133 of file butler.py.

◆ parentRepoDatas

lsst.daf.persistence.butler.RepoData.parentRepoDatas

Definition at line 129 of file butler.py.

◆ repo

lsst.daf.persistence.butler.RepoData.repo

Definition at line 128 of file butler.py.

◆ role

lsst.daf.persistence.butler.RepoData.role

Definition at line 132 of file butler.py.

◆ tags

lsst.daf.persistence.butler.RepoData.tags

Definition at line 131 of file butler.py.


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