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.ConfigDatasetType Class Reference
Inheritance diagram for lsst.pipe.base.argumentParser.ConfigDatasetType:
lsst.pipe.base.argumentParser.DynamicDatasetType

Public Member Functions

def __init__ (self, name)
 
def getDatasetType (self, namespace)
 
def addArgument (self, parser, idName)
 

Public Attributes

 name
 

Detailed Description

Dataset type specified by a config parameter.

Parameters
----------
name : `str`
    Name of config option whose value is the dataset type.

Definition at line 374 of file argumentParser.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.argumentParser.ConfigDatasetType.__init__ (   self,
  name 
)

Definition at line 383 of file argumentParser.py.

383  def __init__(self, name):
384  DynamicDatasetType.__init__(self)
385  self.name = name
386 

Member Function Documentation

◆ addArgument()

def lsst.pipe.base.argumentParser.DynamicDatasetType.addArgument (   self,
  parser,
  idName 
)
inherited
Add a command-line argument to specify dataset type name,
if wanted.

Parameters
----------
parser : `ArgumentParser`
    Argument parser to add the argument to.
idName : `str`
    Name of data ID argument, without the leading ``"--"``,
    e.g. ``"id"``.

Notes
-----
The default implementation does nothing

Reimplemented in lsst.pipe.base.argumentParser.DatasetArgument.

Definition at line 270 of file argumentParser.py.

270  def addArgument(self, parser, idName):
271  """Add a command-line argument to specify dataset type name,
272  if wanted.
273 
274  Parameters
275  ----------
276  parser : `ArgumentParser`
277  Argument parser to add the argument to.
278  idName : `str`
279  Name of data ID argument, without the leading ``"--"``,
280  e.g. ``"id"``.
281 
282  Notes
283  -----
284  The default implementation does nothing
285  """
286  pass
287 

◆ getDatasetType()

def lsst.pipe.base.argumentParser.ConfigDatasetType.getDatasetType (   self,
  namespace 
)
Return the dataset type as a string, from the appropriate
config field.

Parameters
----------
namespace : `argparse.Namespace`
    Parsed command.

Reimplemented from lsst.pipe.base.argumentParser.DynamicDatasetType.

Definition at line 387 of file argumentParser.py.

387  def getDatasetType(self, namespace):
388  """Return the dataset type as a string, from the appropriate
389  config field.
390 
391  Parameters
392  ----------
393  namespace : `argparse.Namespace`
394  Parsed command.
395  """
396  # getattr does not work reliably if the config field name is
397  # dotted, so step through one level at a time
398  keyList = self.name.split(".")
399  value = namespace.config
400  for key in keyList:
401  try:
402  value = getattr(value, key)
403  except KeyError:
404  raise RuntimeError(f"Cannot find config parameter {self.name!r}")
405  return value
406 
407 

Member Data Documentation

◆ name

lsst.pipe.base.argumentParser.ConfigDatasetType.name

Definition at line 385 of file argumentParser.py.


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