Skip to content

Commit d410b89

Browse files
committed
refact: py3 dict syntax instead if filer()
1 parent ae05e92 commit d410b89

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graphtik/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def _execute_thread_pool_barrier_method(self, solution, overwrites, executed):
299299
)
300300

301301
# stop if no nodes left to schedule, exit out of the loop
302-
if len(upnext) == 0:
302+
if not upnext:
303303
break
304304

305305
done_iterator = pool.imap_unordered(

graphtik/nodes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def compute(self, named_inputs, outputs=None):
6565
results = zip(provides, results)
6666
if outputs:
6767
outputs = set(n for n in outputs if not isinstance(n, sideffect))
68-
results = filter(lambda x: x[0] in outputs, results)
68+
results = {key: val for key, val in results if key in outputs}
69+
else:
70+
results = dict(results)
6971

70-
return dict(results)
72+
return results
7173
except Exception as ex:
7274
jetsam(
7375
ex,

0 commit comments

Comments
 (0)