Skip to content

Commit

Permalink
Fix tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ristè committed Apr 9, 2018
1 parent 5eae60d commit 0f80c7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions QGL/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ def pull_uniform_entries(entries, entry_iterators):
if all(iterDone):
raise StopIteration("Unable to find a uniform set of entries")

if all(x == lengths[0] for x in lengths):
if all(np.isclose(x, lengths[0], atol=1e-10) for x in lengths):
break

#Otherwise try to concatenate on entries to match lengths
while lengths[ct] < max(lengths):
while not np.isclose(lengths[ct], max(lengths), atol=1e-10):
# concatenate with following entry to make up the length difference
try:
next_entry = next(entry_iterators[ct])
Expand Down
2 changes: 1 addition & 1 deletion QGL/PulseSequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __neg__(self):

def __mul__(self, other):
""" Overload multiplication of Pulses as a "tensor" operator"""
if not np.isclose(self.length, other.length):
if not np.isclose(self.length, other.length, atol=1e-10):
return align_p('center', self, other)
ptype = promote_type(self, other)
return self.promote(ptype) * other.promote(ptype)
Expand Down

0 comments on commit 0f80c7a

Please sign in to comment.