STY: Flake8 and parameter rename.

This commit is contained in:
Scott Sanderson
2016-09-14 14:45:00 -04:00
parent a0e1b881aa
commit 7c58bf1e5b
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -382,7 +382,8 @@ class SimplePipelineEngine(object):
else:
assert workspace[term].shape == (mask.shape[0], 1)
# Decref dependencies of ``term``, and clear any terms whose refcounts hit 0.
# Decref dependencies of ``term``, and clear any terms whose
# refcounts hit 0.
for garbage_term in graph.decref_dependencies(term, refcounts):
del workspace[garbage_term]
+7 -2
View File
@@ -119,10 +119,15 @@ class TermGraph(DiGraph):
def _repr_png_(self):
return self.png.data
def initial_refcounts(self, initial_workspace):
def initial_refcounts(self, initial_terms):
"""
Calculate initial refcounts for execution of this graph.
Parameters
----------
initial_terms : iterable[Term]
An iterable of terms that were pre-computed before graph execution.
Each node starts with a refcount equal to its outdegree, and output
nodes get one extra reference to ensure that they're still in the graph
at the end of execution.
@@ -131,7 +136,7 @@ class TermGraph(DiGraph):
for t in self.outputs.values():
refcounts[t] += 1
for t in initial_workspace:
for t in initial_terms:
self.decref_dependencies(t, refcounts)
return refcounts