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

Change scope of test_constants.py #52

Merged
merged 3 commits into from
Dec 21, 2021
Merged

Conversation

honno
Copy link
Member

@honno honno commented Dec 17, 2021

This PR:

Clarifying we don't need constants to be specifically float should close #14 and #15.

@honno honno requested a review from asmeurer December 17, 2021 19:24
), f"xp.asarray(xp.{name})={x!r}, but should have float dtype"


@pytest.mark.parametrize("name, n", [("e", math.e), ("pi", math.pi)])
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be xp.e and xp.pi? Although why not just parameterize name and lookup getattr(xp, name) in the test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah no, coz I'm using Python's math just to get the rough approximations (i.e. to test the xp constants are at least in-between the floor and ceil of the respective math constants).

@asmeurer
Copy link
Member

asmeurer commented Dec 17, 2021

Just a few comments. Looks good otherwise.

@honno honno merged commit 2260ae0 into data-apis:master Dec 21, 2021
@honno honno deleted the constants branch February 28, 2024 13:18
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.

Test explicitly that constants are Python scalars
2 participants