File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,10 +124,12 @@ def build(ctx: click.Context, **kwargs: Any) -> None:
124124 """
125125 kwargs = _collectActions (ctx , ** kwargs )
126126 show = ShowInfo (kwargs .pop ("show" , []))
127- if kwargs .get ("butler_config" ) is not None and {"pipeline-graph" , "task-graph" }.isdisjoint (show .commands ):
127+ if kwargs .get ("butler_config" ) is not None and (
128+ {"pipeline-graph" , "task-graph" }.isdisjoint (show .commands ) and not kwargs .get ("pipeline_dot" )
129+ ):
128130 raise click .ClickException (
129131 "--butler-config was provided but nothing uses it "
130- "(only --show pipeline-graph and --show task-graph do)."
132+ "(only --show pipeline-graph, --show task-graph and --pipeline-dot do)."
131133 )
132134 script .build (** kwargs , show = show )
133135 _unhandledShow (show , "build" )
Original file line number Diff line number Diff line change 2828from types import SimpleNamespace
2929
3030from lsst .daf .butler import Butler
31+ from lsst .pipe .base .pipeline_graph import visualization
3132
3233from ... import CmdLineFwk
3334from ..utils import _PipelineAction
@@ -114,6 +115,15 @@ def build( # type: ignore
114115 else :
115116 butler = None
116117
118+ if pipeline_dot :
119+ with open (pipeline_dot , "w" ) as stream :
120+ visualization .show_dot (
121+ pipeline .to_graph (butler .registry if butler is not None else None ),
122+ stream ,
123+ dataset_types = True ,
124+ task_classes = "full" ,
125+ )
126+
117127 show .show_pipeline_info (pipeline , butler = butler )
118128
119129 return pipeline
Original file line number Diff line number Diff line change 7575from lsst .utils .logging import getLogger
7676from lsst .utils .threads import disable_implicit_threading
7777
78- from .dotTools import graph2dot , pipeline2dot
78+ from .dotTools import graph2dot
7979from .executionGraphFixup import ExecutionGraphFixup
8080from .mpGraphExecutor import MPGraphExecutor
8181from .preExecInit import PreExecInit , PreExecInitLimited
@@ -582,9 +582,6 @@ def makePipeline(self, args: SimpleNamespace) -> Pipeline:
582582 if args .save_pipeline :
583583 pipeline .write_to_uri (args .save_pipeline )
584584
585- if args .pipeline_dot :
586- pipeline2dot (pipeline , args .pipeline_dot )
587-
588585 return pipeline
589586
590587 def makeGraph (self , pipeline : Pipeline , args : SimpleNamespace ) -> QuantumGraph | None :
You can’t perform that action at this time.
0 commit comments