Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Thanks to [all contributors](contributors.md) so far!
- Import your function to `src/array_api_extra/__init__.py` and add it to
`__all__` there.
- Add a test class for your function in `tests/test_funcs.py`.
- Ensure that `lazy_xp_function` is called on the function if lazy backends
are supposed to be tested.
- Add your function to `docs/api-reference.md`.
- [Make a PR!](https://github.com/data-apis/array-api-extra/pulls)

Expand Down
9 changes: 9 additions & 0 deletions src/array_api_extra/_delegation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,15 @@ def union1d(a: Array, b: Array, /, *, xp: ModuleType | None = None) -> Array:
-------
Array
Unique, sorted union of the input arrays.
See Also
--------
jax.numpy.union1d : Corresponding function in JAX.
Notes
-----
This function is not compatible with `jax.jit`.
See the docstring of the corresponding JAX function for more information.
"""
if xp is None:
xp = array_namespace(a, b)
Expand Down
9 changes: 8 additions & 1 deletion tests/test_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,27 @@
from array_api_extra.testing import lazy_xp_function

lazy_xp_function(apply_where)
lazy_xp_function(argpartition)
lazy_xp_function(atleast_nd)
lazy_xp_function(broadcast_shapes)
lazy_xp_function(cov)
lazy_xp_function(create_diagonal)
lazy_xp_function(default_dtype)
lazy_xp_function(expand_dims)
lazy_xp_function(isclose)
lazy_xp_function(isin)
lazy_xp_function(kron)
lazy_xp_function(nan_to_num)
lazy_xp_function(nunique)
lazy_xp_function(one_hot)
lazy_xp_function(pad)
lazy_xp_function(partition)
# FIXME calls in1d which calls xp.unique_values without size
lazy_xp_function(setdiff1d, jax_jit=False)
lazy_xp_function(sinc)
lazy_xp_function(union1d, jax_jit=False)
lazy_xp_function(xpx_searchsorted)
lazy_xp_function(_funcs_searchsorted)
lazy_xp_function(sinc)


class TestApplyWhere:
Expand Down