-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -931,11 +931,11 @@ def interp_filter(ary, out=None): | |
return out | ||
|
||
|
||
def allclose_mod(a, b, modulo=2*numpy.pi, rtol=1.e-5, atol=1.e-8, equal_nan=False): | ||
def allclose_mod(a, b, modulo=2*numpy.pi, **kwargs): | ||
"""Returns True if the two arrays a & b are equal within the given | ||
tolerance modulo `modulo`; False otherwise. | ||
Thanks to "Serguei Sokol" <[email protected]> | ||
""" | ||
di = numpy.minimum((a-b)%modulo, (b-a)%modulo) | ||
return numpy.allclose(modulo*0.5, (di+modulo*0.5), rtol=rtol, atol=atol, equal_nan=equal_nan) | ||
return numpy.allclose(modulo*0.5, (di+modulo*0.5), **kwargs) |