Coverage for python/lsst/ctrl/mpexec/cli/opt/optionGroups.py: 84%
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of ctrl_mpexec.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
23__all__ = ("butler_options", "execution_options", "meta_info_options", "pipeline_build_options",
24 "qgraph_options", "run_options")
27import click
29from lsst.daf.butler.cli.utils import option_section, unwrap
30import lsst.obs.base.cli.opt as obsBaseOpts
31import lsst.daf.butler.cli.opt as dafButlerOpts
32from lsst.daf.butler.cli.utils import OptionGroup
33from . import options as ctrlMpExecOpts
35instrumentOptionHelp = ("Add an instrument which will be used to load config overrides when defining a "
36 "pipeline. This must be the fully qualified class name.")
39class pipeline_build_options(OptionGroup): # noqa: N801
40 """Decorator to add options to a command function for building a pipeline.
41 """
43 def __init__(self):
44 self.decorators = [
45 option_section(sectionText="Pipeline build options:"),
46 ctrlMpExecOpts.pipeline_option(),
47 ctrlMpExecOpts.task_option(),
48 ctrlMpExecOpts.delete_option(metavar="LABEL"),
49 dafButlerOpts.config_option(metavar="LABEL:NAME=VALUE", multiple=True),
50 dafButlerOpts.config_file_option(help=unwrap("""Configuration override file(s), applies to a task
51 with a given label."""),
52 metavar="LABEL:FILE",
53 multiple=True),
54 ctrlMpExecOpts.order_pipeline_option(),
55 ctrlMpExecOpts.save_pipeline_option(),
56 ctrlMpExecOpts.pipeline_dot_option(),
57 obsBaseOpts.instrument_option(help=instrumentOptionHelp, metavar="instrument", multiple=True)]
60class qgraph_options(OptionGroup): # noqa: N801
61 """Decorator to add options to a command function for creating a quantum
62 graph."""
64 def __init__(self):
65 self.decorators = [
66 option_section(sectionText="Quantum graph building options:"),
67 ctrlMpExecOpts.qgraph_option(),
68 ctrlMpExecOpts.qgraph_id_option(),
69 ctrlMpExecOpts.qgraph_node_id_option(),
70 ctrlMpExecOpts.skip_existing_in_option(),
71 ctrlMpExecOpts.skip_existing_option(),
72 ctrlMpExecOpts.clobber_outputs_option(),
73 ctrlMpExecOpts.save_qgraph_option(),
74 ctrlMpExecOpts.save_single_quanta_option(),
75 ctrlMpExecOpts.qgraph_dot_option(),
76 ctrlMpExecOpts.save_execution_butler_option(),
77 ctrlMpExecOpts.clobber_execution_butler_option(),
78 ctrlMpExecOpts.dataset_query_constraint(),
79 ctrlMpExecOpts.qgraph_header_data_option()]
82class butler_options(OptionGroup): # noqa: N801
83 """Decorator to add options to a command function for configuring a butler.
84 """
86 def __init__(self):
87 self.decorators = [
88 option_section(sectionText="Data repository and selection options:"),
89 ctrlMpExecOpts.butler_config_option(required=True),
90 ctrlMpExecOpts.input_option(),
91 ctrlMpExecOpts.output_option(),
92 ctrlMpExecOpts.output_run_option(),
93 ctrlMpExecOpts.extend_run_option(),
94 ctrlMpExecOpts.replace_run_option(),
95 ctrlMpExecOpts.prune_replaced_option(),
96 ctrlMpExecOpts.data_query_option()]
99class execution_options(OptionGroup): # noqa: N801
100 """Decorator to add options to a command function for executing a pipeline.
101 """
103 def __init__(self):
104 self.decorators = [
105 option_section(sectionText="Execution options:"),
106 ctrlMpExecOpts.clobber_outputs_option(),
107 ctrlMpExecOpts.do_raise_option(),
108 ctrlMpExecOpts.profile_option(),
109 dafButlerOpts.processes_option(),
110 ctrlMpExecOpts.start_method_option(),
111 ctrlMpExecOpts.timeout_option(),
112 ctrlMpExecOpts.fail_fast_option(),
113 ctrlMpExecOpts.graph_fixup_option()]
116class meta_info_options(OptionGroup): # noqa: N801
117 """Decorator to add options to a command function for managing pipeline
118 meta information."""
120 def __init__(self):
121 self.decorators = [
122 option_section(sectionText="Meta-information output options:"),
123 ctrlMpExecOpts.skip_init_writes_option(),
124 ctrlMpExecOpts.init_only_option(),
125 dafButlerOpts.register_dataset_types_option(),
126 ctrlMpExecOpts.no_versions_option()]
129class run_options(OptionGroup): # noqa: N801
130 """Decorator to add the run options to the run command."""
132 def __init__(self):
133 self.decorators = [
134 click.pass_context,
135 ctrlMpExecOpts.debug_option(),
136 ctrlMpExecOpts.show_option(),
137 pipeline_build_options(),
138 qgraph_options(),
139 butler_options(),
140 execution_options(),
141 meta_info_options(),
142 option_section(sectionText=""),
143 dafButlerOpts.options_file_option(),
144 ]