You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: clip is tricky, especially given the divergences between the standard and the NumPy implementation. We should be especially sure to that the test can catch possible issues with incorrect promotion behavior (clip should not promote but return the same dtype as x) so we can catch potential issues with integer overflow like described at numpy/numpy#24976
Notes for copysign special cases: One can construct a nan with a negative sign bit using -float('nan'). To test the sign bit of a nan you'd either have to use signbit or use math.copysign.
I noticed the searchsorted test is broken because it uses __array_namespace_info__, which isn't listed correctly in the array-api stubs (it's also broken because it uses float instead of int for the sorter array, but that's an easy fix). I tried fixing this in the submodule:
diff --git a/src/array_api_stubs/_2023_12/__init__.py b/src/array_api_stubs/_2023_12/__init__.py
index 8415f276..537ea8f8 100644
--- a/src/array_api_stubs/_2023_12/__init__.py+++ b/src/array_api_stubs/_2023_12/__init__.py@@ -16,7 +16,7 @@ from .statistical_functions import *
from .utility_functions import *
from . import linalg
from . import fft
-from . import info+from .info import __array_namespace_info__
__array_api_version__: str = "YYYY.MM"
Activity
asmeurer commentedon Apr 19, 2024
Note:
clipis tricky, especially given the divergences between the standard and the NumPy implementation. We should be especially sure to that the test can catch possible issues with incorrect promotion behavior (clipshould not promote but return the same dtype asx) so we can catch potential issues with integer overflow like described at numpy/numpy#24976asmeurer commentedon Apr 19, 2024
Notes for
copysignspecial cases: One can construct ananwith a negative sign bit using-float('nan'). To test the sign bit of a nan you'd either have to usesignbitor usemath.copysign.asmeurer commentedon Apr 29, 2024
I edited the above list to add a couple of things I missed.
asmeurer commentedon May 6, 2024
Should this have been closed?
honno commentedon May 7, 2024
Good catch!
asmeurer commentedon May 7, 2024
I noticed the searchsorted test is broken because it uses
__array_namespace_info__, which isn't listed correctly in the array-api stubs (it's also broken because it uses float instead of int for the sorter array, but that's an easy fix). I tried fixing this in the submodule:but the fix doesn't seem to work.
asmeurer commentedon Nov 14, 2024
I think we can close this actually. Some of the above functions are only partially tested, but that is tracked at #301