class_docstr: An abstract representation of Pipeline Term dependencies.
  
  This class does not keep any additional metadata about any term relations
  other than dependency ordering.  As such it is only useful in contexts
  where you care exclusively about order properties (for example, when
  drawing visualizations of execution order).
  
  Parameters
  ----------
  terms : dict
      A dict mapping names to final output terms.
  
  Attributes
  ----------
  outputs
  
  Methods
  -------
  ordered()
      Return a topologically-sorted iterator over the terms in self.
  execution_order(workspace, refcounts)
      Return a topologically-sorted iterator over the terms in self, skipping
      entries in ``workspace`` and entries with refcounts of zero.
  
  See Also
  --------
  ExecutionPlan
class_docstr_tok: ["An","abstract","representation","of","Pipeline","Term","dependencies",".","This","class","does","not","keep","any","additional","metadata","about","any","term","relations","other","than","dependency","ordering",".","As","such","it","is","only","useful","in","contexts","where","you","care","exclusively","about","order","properties","(","for","example",",","when","drawing","visualizations","of","execution","order",")",".","Parameters","--","--","--","--","--","terms",":","dict","A","dict","mapping","names","to","final","output","terms",".","Attributes","--","--","--","--","--","outputs","Methods","--","--","--","-","ordered","(",")","Return","a","topologically-sorted","iterator","over","the","terms","in","self",".","execution_order","(","workspace",",","refcounts",")","Return","a","topologically-sorted","iterator","over","the","terms","in","self",",","skipping","entries","in","``","workspace","``","and","entries","with","refcounts","of","zero",".","See","Also","--","--","--","--","ExecutionPlan"]
docstr: Return a topologically-sorted list of the terms in ``self`` which
  need to be computed.
  
  Filters out any terms that are already present in ``workspace``, as
  well as any terms with refcounts of 0.
  
  Parameters
  ----------
  workspace : dict[Term, np.ndarray]
      Initial state of workspace for a pipeline execution. May contain
      pre-computed values provided by ``populate_initial_workspace``.
  refcounts : dict[Term, int]
      Reference counts for terms to be computed. Terms with reference
      counts of 0 do not need to be computed.
docstr_tok: ["Return","a","topologically-sorted","list","of","the","terms","in","``","self","``","which","need","to","be","computed",".","Filters","out","any","terms","that","are","already","present","in","``","workspace","``",",","as","well","as","any","terms","with","refcounts","of","0",".","Parameters","--","--","--","--","--","workspace",":","dict","[","Term",",","np.ndarray","]","Initial","state","of","workspace","for","a","pipeline","execution",".","May","contain","pre-computed","values","provided","by","``","populate_initial_workspace","``",".","refcounts",":","dict","[","Term",",","int","]","Reference","counts","for","terms","to","be","computed",".","Terms","with","reference","counts","of","0","do","not","need","to","be","computed","."]
code: def execution_order(self, workspace, refcounts):
      """
      Return a topologically-sorted list of the terms in ``self`` which
      need to be computed.
  
      Filters out any terms that are already present in ``workspace``, as
      well as any terms with refcounts of 0.
  
      Parameters
      ----------
      workspace : dict[Term, np.ndarray]
          Initial state of workspace for a pipeline execution. May contain
          pre-computed values provided by ``populate_initial_workspace``.
      refcounts : dict[Term, int]
          Reference counts for terms to be computed. Terms with reference
          counts of 0 do not need to be computed.
      """
      return list(
          nx.topological_sort(
              self.graph.subgraph(
                  {
                      term
                      for term, refcount in refcounts.items()
                      if refcount > 0 and term not in workspace
                  },
              ),
          )
      )
  
imports: import uuid
  import networkx
  from six import iteritems, itervalues
  from zipline.utils.memoize import lazyval
  from zipline.pipeline.visualize import display_graph
  from .term import LoadableTerm
label_desc: Use image node_id 6 for calling the TermGraph obj's underlying member method code with example usage: obj.execution_order(workspace, refcounts) and returns: list