LSST Applications  22.0.1,22.0.1+01bcf6a671,22.0.1+046ee49490,22.0.1+05c7de27da,22.0.1+0c6914dbf6,22.0.1+1220d50b50,22.0.1+12fd109e95,22.0.1+1a1dd69893,22.0.1+1c910dc348,22.0.1+1ef34551f5,22.0.1+30170c3d08,22.0.1+39153823fd,22.0.1+611137eacc,22.0.1+771eb1e3e8,22.0.1+94e66cc9ed,22.0.1+9a075d06e2,22.0.1+a5ff6e246e,22.0.1+a7db719c1a,22.0.1+ba0d97e778,22.0.1+bfe1ee9056,22.0.1+c4e1e0358a,22.0.1+cc34b8281e,22.0.1+d640e2c0fa,22.0.1+d72a2e677a,22.0.1+d9a6b571bd,22.0.1+e485e9761b,22.0.1+ebe8d3385e
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.argumentParser.DataIdArgument Class Reference

Public Member Functions

def __init__ (self, name, datasetType, level, doMakeDataRefList=True, ContainerClass=DataIdContainer)
 
def isDynamicDatasetType (self)
 
def getDatasetType (self, namespace)
 

Public Attributes

 name
 
 datasetType
 
 level
 
 doMakeDataRefList
 
 ContainerClass
 
 argName
 

Detailed Description

data ID argument, used by `ArgumentParser.add_id_argument`.

Parameters
----------
name : `str`
    Name of identifier (argument name without dashes).
datasetType : `str`
    Type of dataset; specify a string for a fixed dataset type
    or a `DatasetArgument` for a dynamic dataset type (e.g.
    one specified by a command-line argument).
level : `str`
    The lowest hierarchy level to descend to for this dataset type,
    for example `"amp"` for `"raw"` or `"ccd"` for `"calexp"`.
    Use `""` to use the mapper's default for the dataset type.
    Some container classes may also support `None`, which means
    the level should not be restricted; however the default class,
    `DataIdContainer`, does not support `None`.
doMakeDataRefList : `bool`, optional
    If `True` (default), construct data references.
ContainerClass : `class`, optional
    Class to contain data IDs and data references; the default class
    `DataIdContainer` will work for many, but not all, cases.
    For example if the dataset type is specified on the command line
    then use `DynamicDatasetType`.

Definition at line 202 of file argumentParser.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 229 of file argumentParser.py.

229  def __init__(self, name, datasetType, level, doMakeDataRefList=True, ContainerClass=DataIdContainer):
230  if name.startswith("-"):
231  raise RuntimeError(f"Name {name} must not start with -")
232  self.name = name
233  self.datasetType = datasetType
234  self.level = level
235  self.doMakeDataRefList = bool(doMakeDataRefList)
236  self.ContainerClass = ContainerClass
237  self.argName = name.lstrip("-")
238 

Member Function Documentation

◆ getDatasetType()

def lsst.pipe.base.argumentParser.DataIdArgument.getDatasetType (   self,
  namespace 
)
Get the dataset type as a string.

Parameters
----------
namespace
    Parsed command.

Returns
-------
datasetType : `str`
    Dataset type.

Definition at line 246 of file argumentParser.py.

246  def getDatasetType(self, namespace):
247  """Get the dataset type as a string.
248 
249  Parameters
250  ----------
251  namespace
252  Parsed command.
253 
254  Returns
255  -------
256  datasetType : `str`
257  Dataset type.
258  """
259  if self.isDynamicDatasetType:
260  return self.datasetType.getDatasetType(namespace)
261  else:
262  return self.datasetType
263 
264 

◆ isDynamicDatasetType()

def lsst.pipe.base.argumentParser.DataIdArgument.isDynamicDatasetType (   self)
`True` if the dataset type is dynamic (that is, specified
on the command line).

Definition at line 240 of file argumentParser.py.

240  def isDynamicDatasetType(self):
241  """`True` if the dataset type is dynamic (that is, specified
242  on the command line).
243  """
244  return isinstance(self.datasetType, DynamicDatasetType)
245 

Member Data Documentation

◆ argName

lsst.pipe.base.argumentParser.DataIdArgument.argName

Definition at line 237 of file argumentParser.py.

◆ ContainerClass

lsst.pipe.base.argumentParser.DataIdArgument.ContainerClass

Definition at line 236 of file argumentParser.py.

◆ datasetType

lsst.pipe.base.argumentParser.DataIdArgument.datasetType

Definition at line 233 of file argumentParser.py.

◆ doMakeDataRefList

lsst.pipe.base.argumentParser.DataIdArgument.doMakeDataRefList

Definition at line 235 of file argumentParser.py.

◆ level

lsst.pipe.base.argumentParser.DataIdArgument.level

Definition at line 234 of file argumentParser.py.

◆ name

lsst.pipe.base.argumentParser.DataIdArgument.name

Definition at line 232 of file argumentParser.py.


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