Skip to content

Commit

Permalink
Revert np.isclose(..., atol=...) which requires very recent Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Sep 5, 2023
1 parent c074303 commit d961f79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions euphonic/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ def assert_regular_bins(self, message: str = '',
"""
bin_widths = self.get_bin_widths()
atol_quantity = atol * bin_widths.units
if not np.all(np.isclose(bin_widths, bin_widths[0],
rtol=rtol, atol=atol_quantity)):
# Need to cast to magnitude to use isclose() with atol before Pint 0.21
if not np.all(np.isclose(bin_widths.magnitude, bin_widths.magnitude[0],
rtol=rtol, atol=atol)):
raise AssertionError("Not all x-axis bins are the same width. "
+ message)

Expand Down

0 comments on commit d961f79

Please sign in to comment.