lsst.pipe.base  13.0-14-g8b3bf66+26
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.base.argumentParser.InputOnlyArgumentParser Class Reference
Inheritance diagram for lsst.pipe.base.argumentParser.InputOnlyArgumentParser:
lsst.pipe.base.argumentParser.ArgumentParser

Public Member Functions

def add_id_argument (self, name, datasetType, help, level=None, doMakeDataRefList=True, ContainerClass=DataIdContainer)
 
def parse_args (self, config, args=None, log=None, override=None)
 
def handleCamera (self, namespace)
 
def convert_arg_line_to_args (self, arg_line)
 

Static Public Attributes

bool requireOutput = False
 

Detailed Description

`ArgumentParser` for command-line tasks that don't write any output.

Definition at line 797 of file argumentParser.py.

Member Function Documentation

◆ add_id_argument()

def lsst.pipe.base.argumentParser.ArgumentParser.add_id_argument (   self,
  name,
  datasetType,
  help,
  level = None,
  doMakeDataRefList = True,
  ContainerClass = DataIdContainer 
)
inherited
Add a data ID argument.


Parameters
----------
name : `str`
    Data ID argument (including leading dashes, if wanted).
datasetType : `str` or `DynamicDatasetType`-type
    Type of dataset. Supply a string for a fixed dataset type. For a dynamically determined dataset
    type, supply a `DynamicDatasetType`, such a `DatasetArgument`.
help : `str`
    Help string for the argument.
level : object, optional
    Level of dataset, for the `~lsst.daf.persistence.Butler`.
doMakeDataRefList : bool, optional
    If `True` (default), construct data references.
ContainerClass : class, optional
    Data ID container class to use to contain results; override the default if you need a special
    means of computing data references from data IDs

Notes
-----
If ``datasetType`` is an instance of `DatasetArgument`, then add a second argument to specify the
dataset type.

The associated data is put into ``namespace.<dataIdArgument.name>`` as an instance of ContainerClass;
the container includes fields:

- ``idList``: a list of data ID dicts.
- ``refList``: a list of `~lsst.daf.persistence.Butler` data references (empty if
  ``doMakeDataRefList`` is  `False`).

Definition at line 457 of file argumentParser.py.

◆ convert_arg_line_to_args()

def lsst.pipe.base.argumentParser.ArgumentParser.convert_arg_line_to_args (   self,
  arg_line 
)
inherited
Allow files of arguments referenced by ``@<path>`` to contain multiple values on each line.

Parameters
----------
arg_line : `str`
    Line of text read from an argument file.

Definition at line 780 of file argumentParser.py.

◆ handleCamera()

def lsst.pipe.base.argumentParser.ArgumentParser.handleCamera (   self,
  namespace 
)
inherited
Perform camera-specific operations before parsing the command-line.

Parameters
----------
namespace : `argparse.Namespace`
    Namespace (an ) with the following fields:

    - ``camera``: the camera name.
    - ``config``: the config passed to parse_args, with no overrides applied.
    - ``obsPkg``: the ``obs_`` package for this camera.
    - ``log``: a `lsst.log` Log.

Notes
-----
The default implementation does nothing.

Definition at line 761 of file argumentParser.py.

◆ parse_args()

def lsst.pipe.base.argumentParser.ArgumentParser.parse_args (   self,
  config,
  args = None,
  log = None,
  override = None 
)
inherited
Parse arguments for a command-line task.

Parameters
----------
config : `lsst.pex.config.Config`
    Config for the task being run.
args : `list`, optional
    Argument list; if `None` then ``sys.argv[1:]`` is used.
log : `lsst.log.Log`, optional
    `~lsst.log.Log` instance; if `None` use the default log.
override : callable, optional
    A config override function. It must take the root config object as its only argument and must
    modify the config in place. This function is called after camera-specific overrides files are
    applied, and before command-line config overrides are applied (thus allowing the user the final
    word).

Returns
-------
namespace : `argparse.Namespace`
    A `~argparse.Namespace` instance containing fields:

    - ``camera``: camera name.
    - ``config``: the supplied config with all overrides applied, validated and frozen.
    - ``butler``: a `lsst.daf.persistence.Butler` for the data.
    - An entry for each of the data ID arguments registered by `add_id_argument`,
      the value of which is a `~lsst.pipe.base.DataIdArgument` that includes public elements
      ``idList`` and ``refList``.
    - ``log``: a `lsst.log` Log.
    - An entry for each command-line argument, with the following exceptions:
      - config is the supplied config, suitably updated.
      - configfile, id and loglevel are all missing.
    - ``obsPkg``: name of the ``obs_`` package for this camera.

Definition at line 513 of file argumentParser.py.

Member Data Documentation

◆ requireOutput

bool lsst.pipe.base.argumentParser.InputOnlyArgumentParser.requireOutput = False
static

Definition at line 801 of file argumentParser.py.


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