class_docstr: Graph represention of Pipeline Term dependencies that includes metadata
  about extra rows required to perform computations.
  
  Each node in the graph has an `extra_rows` attribute, indicating how many,
  if any, extra rows we should compute for the node.  Extra rows are most
  often needed when a term is an input to a rolling window computation.  For
  example, if we compute a 30 day moving average of price from day X to day
  Y, we need to load price data for the range from day (X - 29) to day Y.
  
  Parameters
  ----------
  terms : dict
      A dict mapping names to final output terms.
  all_dates : pd.DatetimeIndex
      An index of all known trading days for which ``terms`` will be
      computed.
  start_date : pd.Timestamp
      The first date for which output is requested for ``terms``.
  end_date : pd.Timestamp
      The last date for which output is requested for ``terms``.
  
  Attributes
  ----------
  outputs
  offset
  extra_rows
  
  Methods
  -------
  ordered()
      Return a topologically-sorted iterator over the terms in self.
class_docstr_tok: ["Graph","represention","of","Pipeline","Term","dependencies","that","includes","metadata","about","extra","rows","required","to","perform","computations",".","Each","node","in","the","graph","has","an","`","extra_rows","`","attribute",",","indicating","how","many",",","if","any",",","extra","rows","we","should","compute","for","the","node",".","Extra","rows","are","most","often","needed","when","a","term","is","an","input","to","a","rolling","window","computation",".","For","example",",","if","we","compute","a","30","day","moving","average","of","price","from","day","X","to","day","Y",",","we","need","to","load","price","data","for","the","range","from","day","(","X","-","29",")","to","day","Y.","Parameters","--","--","--","--","--","terms",":","dict","A","dict","mapping","names","to","final","output","terms",".","all_dates",":","pd.DatetimeIndex","An","index","of","all","known","trading","days","for","which","``","terms","``","will","be","computed",".","start_date",":","pd.Timestamp","The","first","date","for","which","output","is","requested","for","``","terms","``",".","end_date",":","pd.Timestamp","The","last","date","for","which","output","is","requested","for","``","terms","``",".","Attributes","--","--","--","--","--","outputs","offset","extra_rows","Methods","--","--","--","-","ordered","(",")","Return","a","topologically-sorted","iterator","over","the","terms","in","self","."]
docstr: Compute ``extra_rows`` for transitive dependencies of ``root_terms``
docstr_tok: ["Compute","``","extra_rows","``","for","transitive","dependencies","of","``","root_terms","``"]
code: def set_extra_rows(
      self, term, all_dates, start_date, end_date, min_extra_rows
  ):
      """
      Compute ``extra_rows`` for transitive dependencies of ``root_terms``
      """
      # A term can require that additional extra rows beyond the minimum be
      # computed.  This is most often used with downsampled terms, which need
      # to ensure that the first date is a computation date.
      extra_rows_for_term = term.compute_extra_rows(
          all_dates,
          start_date,
          end_date,
          min_extra_rows,
      )
      if extra_rows_for_term < min_extra_rows:
          raise ValueError(
              "term %s requested fewer rows than the minimum of %d"
              % (
                  term,
                  min_extra_rows,
              )
          )
  
      self._ensure_extra_rows(term, extra_rows_for_term)
  
      for (
          dependency,
          additional_extra_rows,
      ) in term.dependencies.items():
          self.set_extra_rows(
              dependency,
              all_dates,
              start_date,
              end_date,
              min_extra_rows=extra_rows_for_term
              + additional_extra_rows,
          )
  
imports: from networkx import DiGraph, topological_sort
  from six import iteritems, itervalues
  from catalyst.utils.memoize import lazyval
  from catalyst.pipeline.visualize import display_graph
  from .term import LoadableTerm
label_desc: Use image node_id 2 for calling the ExecutionPlan obj's underlying member method code with example usage: obj.set_extra_rows(term, all_dates, start_date, end_date, min_extra_rows) without return types