Skip to content

Commit

Permalink
Fix reproducibility tests being skipped due to iterating over filter …
Browse files Browse the repository at this point in the history
…object twice
  • Loading branch information
eltos committed Jan 21, 2025
1 parent a25a5be commit cde8527
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
54 changes: 48 additions & 6 deletions examples/line.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/twiss.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def keep(out):
return False
return True

reference_outputs = filter(keep, reference_cell.get("outputs", []))
# Make sure these are lists, since filter object can be iterated over only once!
reference_outputs = list(filter(keep, reference_cell.get("outputs", [])))
actual_outputs = list(filter(keep, actual_cell.get("outputs", [])))

print("reference_outputs:", [o.get("output_type") for o in reference_outputs])
Expand Down

0 comments on commit cde8527

Please sign in to comment.