code: def initialize_dag(self,
                         targets: Optional[List[str]] = [],
                         nested: bool = False) -> SoS_DAG:
          '''Create a DAG by analyzing sections statically.'''
          self.reset_dict()
  
          dag = SoS_DAG(name=self.md5)
          targets = sos_targets(targets)
  
          self.add_forward_workflow(dag, self.workflow.sections)
          #
          if self.resolve_dangling_targets(dag, targets) == 0:
              if targets:
                  raise UnknownTarget(f'No step to generate target {targets}.')
          # now, there should be no dangling targets, let us connect nodes
          dag.build()
  
          # dag.show_nodes()
          # trim the DAG if targets are specified
          if targets:
              dag = dag.subgraph_from(targets)
          # check error
          cycle = dag.circular_dependencies()
          if cycle:
              raise RuntimeError(
                  f'Circular dependency detected {cycle}. It is likely a later step produces input of a previous step.'
              )
          dag.save(env.config['output_dag'])
          return daf initialize_dag(self,
                         targets: Optional[List[str]] = [],
                         nested: bool = False) -> SoS_DAG:
          '''Create a DAG by analyzing sections statically.'''
          self.reset_dict()
  
          dag = SoS_DAG(name=self.md5)
          targets = sos_targets(targets)
  
          self.add_forward_workflow(dag, self.workflow.sections)
          #
          if self.resolve_dangling_targets(dag, targets) == 0:
              if targets:
                  raise UnknownTarget(f'No step to generate target {targets}.')
          # now, there should be no dangling targets, let us connect nodes
          dag.build()
  
          # dag.show_nodes()
          # trim the DAG if targets are specified
          if targets:
              dag = dag.subgraph_from(targets)
          # check error
          cycle = dag.circular_dependencies()
          if cycle:
              raise RuntimeError(
                  f'Circular dependency detected {cycle}. It is likely a later step produces input of a previous step.'
              )
          dag.save(env.config['output_dag'])
          return dag
docs: Create a DAG by analyzing sections statically.