Skip to content

Suppress NumPy warnings for special case behaviour #1

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

Closed
honno opened this issue Sep 30, 2022 · 1 comment
Closed

Suppress NumPy warnings for special case behaviour #1

honno opened this issue Sep 30, 2022 · 1 comment

Comments

@honno
Copy link
Member

honno commented Sep 30, 2022

The initial numpy.array_api PR numpy/numpy#18585 had folks happy with keeping NumPy-proper's warnings when spec-compliant operations were being done (usually/always special case behaviour). Giving the flexibility of a separate package, could we instead suppress these warnings? Really my one use case here is array-api-tests, where right now our "daily driver" array module is numpy.array_api which deluges us with warnings that obfuscate other things... we could suppress them on our end tbf, just ugh.

@asmeurer
Copy link
Member

asmeurer commented Oct 7, 2022

Most of the functions in this module are just direct copies of the NumPy versions, i.e., we just do from numpy import * and export np.sin, np.exp, etc. I'm only wrapping the functions that have changed behavior. Doing this would require wrapping every single function.

Additionally, we don't wrap or subclass the array object, so even if we fix it for functions, it wouldn't be fixed for operators.

Instead, I would just disable the warnings when testing this module. I don't know if it can be done with an environment variable.

@honno honno closed this as completed Oct 12, 2022
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