Skip to content

Commit

Permalink
Fixing missed changes with ak.array_equal
Browse files Browse the repository at this point in the history
* Now overrides numpy.array_equal
* Adding link to toctree
* Unit test checks numpy override
  • Loading branch information
tcawlfield committed Aug 23, 2024
1 parent 769ee40 commit f9304c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/reference/toctree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,12 @@
generated/ak.backend

.. toctree::
:caption: Approximation
:caption: Approximation and comparison

generated/ak.round
generated/ak.isclose
generated/ak.almost_equal
generated/ak.array_equal

.. toctree::
:caption: NumPy compatibility
Expand Down
1 change: 1 addition & 0 deletions src/awkward/operations/ak_array_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
__all__ = ("array_equal",)


@ak._connect.numpy.implements("array_equal")
@high_level_function()
def array_equal(
a1,
Expand Down
7 changes: 7 additions & 0 deletions tests/test_1105_ak_aray_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ def test_array_equal_with_params():
)
assert not ak.array_equal(a1, a2)
assert ak.array_equal(a1, a2, check_parameters=False)


def test_array_equal_numpy_override():
assert np.array_equal(
ak.Array([[1, 2], [], [3, 4, 5]]),
ak.Array([[1, 2], [], [3, 4, 5]]),
)

0 comments on commit f9304c9

Please sign in to comment.