Skip to content

Commit

Permalink
Need to use atol for isclose here (#4655)
Browse files Browse the repository at this point in the history
  • Loading branch information
spxiwh authored Feb 27, 2024
1 parent a3f5e92 commit fd26817
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pycbc/types/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ def time_slice(self, start, end, mode='floor'):
start_idx = float(start - self.start_time) * self.sample_rate
end_idx = float(end - self.start_time) * self.sample_rate

if _numpy.isclose(start_idx, round(start_idx)):
if _numpy.isclose(start_idx, round(start_idx), rtol=0, atol=1E-3):
start_idx = round(start_idx)

if _numpy.isclose(end_idx, round(end_idx)):
if _numpy.isclose(end_idx, round(end_idx), rtol=0, atol=1E-3):
end_idx = round(end_idx)

if mode == 'floor':
Expand Down

0 comments on commit fd26817

Please sign in to comment.