Skip to content
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

test_linspace error with numpy #195

Open
asmeurer opened this issue Sep 12, 2023 · 1 comment
Open

test_linspace error with numpy #195

asmeurer opened this issue Sep 12, 2023 · 1 comment

Comments

@asmeurer
Copy link
Member

FAILED array_api_tests/test_creation_functions.py::test_linspace - AssertionError: out[0]=0.0, should be -0.0 [linspace()]
Falsifying example: test_linspace(
    num=1,
    dtype=numpy.float32,
    endpoint=False,
    data=data(...),
)
Draw 1 (start): -0.0
Draw 2 (stop): -1.0
Draw 3 (kw): {'dtype': numpy.float32, 'endpoint': False}

Not clear if this is actually required by the spec or not. See https://data-apis.org/array-api/latest/API_specification/generated/array_api.linspace.html

@rgommers
Copy link
Member

This doesn't look like a very useful failure, and I don't think the answer is required to be -0.0. I suggest avoiding the use of -0.0 or check with an assert function that has behavior like:

>>> -0.0 == 0.0
True

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

No branches or pull requests

2 participants