Skip to content

Test explicitly that constants are Python scalars #14

Closed
@pmeier

Description

@pmeier

data-apis/array-api#169 clarified that the constants e, inf, nan, and pi should be Python scalars and not just behave like one. Our current tests

def test_e():
# Check that e acts as a scalar
E = full((1,), e, dtype=float64)
# We don't require any accuracy. This is just a smoke test to check that
# 'e' is actually the constant e.
assert all(less(abs(E - 2.71), one((1,), dtype=float64))), "e is not the constant e"

don't account for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions