LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.argumentParser.DataIdArgument Class Reference

Glorified struct for data about id arguments, used by ArgumentParser.add_id_argument. More...

Inheritance diagram for lsst.pipe.base.argumentParser.DataIdArgument:

Public Member Functions

def __init__
 Constructor. More...
 
def isDynamicDatasetType
 Is the dataset type dynamic (specified on the command line)? More...
 
def getDatasetType
 Get the dataset type. More...
 

Public Attributes

 name
 
 datasetType
 
 level
 
 doMakeDataRefList
 
 ContainerClass
 
 argName
 
 datasetTypeName
 

Detailed Description

Glorified struct for data about id arguments, used by ArgumentParser.add_id_argument.

Definition at line 130 of file argumentParser.py.

Constructor & Destructor Documentation

def lsst.pipe.base.argumentParser.DataIdArgument.__init__ (   self,
  name,
  datasetType,
  level,
  doMakeDataRefList = True,
  ContainerClass = DataIdContainer 
)

Constructor.

Parameters
[in]namename of identifier (argument name without dashes)
[in]datasetTypetype of dataset; specify a string for a fixed dataset type or a DatasetArgument for a dynamic dataset type (one specified on the command line), in which case an argument is added by name –<name>_dstype
[in]levellevel of dataset, for butler
[in]doMakeDataRefListconstruct data references?
[in]ContainerClassclass to contain data IDs and data references; the default class will work for many kinds of data, but you may have to override to compute some kinds of data references.

Definition at line 132 of file argumentParser.py.

133  def __init__(self, name, datasetType, level, doMakeDataRefList=True, ContainerClass=DataIdContainer):
134  """!Constructor
135 
136  @param[in] name name of identifier (argument name without dashes)
137  @param[in] datasetType type of dataset; specify a string for a fixed dataset type
138  or a DatasetArgument for a dynamic dataset type (one specified on the command line),
139  in which case an argument is added by name --<name>_dstype
140  @param[in] level level of dataset, for butler
141  @param[in] doMakeDataRefList construct data references?
142  @param[in] ContainerClass class to contain data IDs and data references;
143  the default class will work for many kinds of data, but you may have to override
144  to compute some kinds of data references.
145  """
146  if name.startswith("-"):
147  raise RuntimeError("Name %s must not start with -" % (name,))
148  self.name = name
149  self.datasetType = datasetType
150  self.level = level
151  self.doMakeDataRefList = bool(doMakeDataRefList)
152  self.ContainerClass = ContainerClass
153  self.argName = name.lstrip("-")
155  self.datasetTypeName = datasetType.name if datasetType.name else self.name + "_dstype"
156  else:
157  self.datasetTypeName = None
def isDynamicDatasetType
Is the dataset type dynamic (specified on the command line)?

Member Function Documentation

def lsst.pipe.base.argumentParser.DataIdArgument.getDatasetType (   self,
  namespace 
)

Get the dataset type.

Parameters
[in]namespaceparsed command created by argparse parse_args; if the dataset type is dynamic then it is read from namespace.<name>_dstype else namespace is ignored

Definition at line 162 of file argumentParser.py.

163  def getDatasetType(self, namespace):
164  """!Get the dataset type
165 
166  @param[in] namespace parsed command created by argparse parse_args;
167  if the dataset type is dynamic then it is read from namespace.<name>_dstype
168  else namespace is ignored
169  """
170  return getattr(namespace, self.datasetTypeName) if self.isDynamicDatasetType() else self.datasetType
def isDynamicDatasetType
Is the dataset type dynamic (specified on the command line)?
def lsst.pipe.base.argumentParser.DataIdArgument.isDynamicDatasetType (   self)

Is the dataset type dynamic (specified on the command line)?

Definition at line 158 of file argumentParser.py.

159  def isDynamicDatasetType(self):
160  """!Is the dataset type dynamic (specified on the command line)?"""
161  return isinstance(self.datasetType, DatasetArgument)
def isDynamicDatasetType
Is the dataset type dynamic (specified on the command line)?

Member Data Documentation

lsst.pipe.base.argumentParser.DataIdArgument.argName

Definition at line 152 of file argumentParser.py.

lsst.pipe.base.argumentParser.DataIdArgument.ContainerClass

Definition at line 151 of file argumentParser.py.

lsst.pipe.base.argumentParser.DataIdArgument.datasetType

Definition at line 148 of file argumentParser.py.

lsst.pipe.base.argumentParser.DataIdArgument.datasetTypeName

Definition at line 154 of file argumentParser.py.

lsst.pipe.base.argumentParser.DataIdArgument.doMakeDataRefList

Definition at line 150 of file argumentParser.py.

lsst.pipe.base.argumentParser.DataIdArgument.level

Definition at line 149 of file argumentParser.py.

lsst.pipe.base.argumentParser.DataIdArgument.name

Definition at line 147 of file argumentParser.py.


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