Skip to content

ENH: test nextafter #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged

ENH: test nextafter #366

merged 1 commit into from
Apr 15, 2025

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Apr 15, 2025

towards #299

@ev-br
Copy link
Member Author

ev-br commented Apr 15, 2025

Merging straight away so that data-apis/array-api-compat#306 can run it across backends.

@ev-br ev-br merged commit 2db6c7b into data-apis:master Apr 15, 2025
3 checks passed
Copy link
Contributor

@crusaderky crusaderky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test case for Python scalars (with ad-hoc behaviour when the python scalar is x1)

@ev-br
Copy link
Member Author

ev-br commented Apr 15, 2025

Missing test case for Python scalars (with ad-hoc behaviour when the python scalar is x1)

Not really:

$ git diff
diff --git a/array_api_tests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py
index 6b4e555..2f9d9b7 100644
--- a/array_api_tests/test_operators_and_elementwise_functions.py
+++ b/array_api_tests/test_operators_and_elementwise_functions.py
@@ -1850,6 +1850,8 @@ def _filter_zero(x):
 )
 @given(x1x2=hh.array_and_py_scalar(dh.real_float_dtypes))
 def test_binary_with_scalars_real(func_data, x1x2):
+    if isinstance(x1x2[0], float):
+        breakpoint()
     _check_binary_with_scalars(func_data, x1x2)

stops with

-> _check_binary_with_scalars(func_data, x1x2)
(Pdb) p x1x2
(63.0, tensor([[ 0.6733,  0.3333, 26.0324,  1.9000]]))

int scalars, are missing yes. This is on par with testing other binary functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants