Skip to content

Commit

Permalink
Replaced many maps withs with for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmkenney committed Aug 23, 2024
1 parent fe4b87b commit 59a14b5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions alchemiscale/storage/statestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -2461,9 +2461,15 @@ def add_protocol_dag_result_ref_traceback(
except IndexError:
raise KeyError("Could not find ProtocolDAGResultRef in database.")

tracebacks = list(map(lambda puf: puf.traceback, protocol_unit_failures))
source_keys = list(map(lambda puf: puf.source_key, protocol_unit_failures))
failure_keys = list(map(lambda puf: puf.key, protocol_unit_failures))
failure_keys = []
source_keys = []
tracebacks = []

for puf in protocol_unit_failures:
failure_keys.append(puf.key)
source_keys.append(puf.source_key)
tracebacks.append(puf.traceback)

traceback = Traceback(tracebacks, source_keys, failure_keys)

_, traceback_node, _ = self._gufe_to_subgraph(
Expand Down

0 comments on commit 59a14b5

Please sign in to comment.