Skip to content

Commit

Permalink
Merge pull request #115 from Jax922/bugfix/assert-array-equal
Browse files Browse the repository at this point in the history
Bugfix/assert array equal
  • Loading branch information
erleben authored Oct 7, 2023
2 parents a8494e6 + 400817c commit 48fc3d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/rainbow/util/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

def is_array_equal(arr1, arr2, dec=8):
"""
2022-04-06 Kenny TODO: Write proper documentation.
Checks if two arrays are almost equal by comparing each element up to a specified decimal place.
:param arr1:
:param arr2:
:param dec:
:return:
:param arr1: First input array to compare.
:param arr2: Second input array to compare against the first array.
:param dec: The desired precision in decimal places. Default is 8.
:return: True if the arrays are almost equal, False otherwise.
"""
return None == np.testing.assert_array_almost_equal(arr1, arr2, dec)
return None == np.testing.assert_allclose(arr1, arr2, rtol=10**-dec, atol=10**-dec)


def is_array_not_equal(arr1, arr2):
Expand Down

0 comments on commit 48fc3d1

Please sign in to comment.