'Decrement terms recursively.
Notes
This should only be used to build the initial workspace, after that we
should use:
:meth:`~zipline.pipeline.graph.TermGraph.decref_dependencies`'

def _decref_depencies_recursive(self, term, refcounts, garbage):

    for (parent, _) in self.graph.in_edges([term]):
        refcounts[parent] -= 1
        if (refcounts[parent] == 0):
            garbage.add(parent)
            self._decref_depencies_recursive(parent, refcounts, garbage)
