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

Suppress more numpy warnings from uncertainties #1350

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

wshanks
Copy link
Collaborator

@wshanks wshanks commented Dec 20, 2023

This PR is a follow up to
#1070. It suppresses numpy warnings during uncertainties array creation in more places in the code. Something changed recently in the numpy code so that it generates warnings when it used to suppress them, in particular when using numpy.vectorize which wraps user-level Python code inside of numpy C code and seems to lose context about warning state. See numpy/numpy#21416 for more information.

This PR is a follow up to
qiskit-community#1070. It
suppresses numpy warnings during uncertainties array creation in more
places in the code. Something changed recently in the numpy code so that
it generates warnings when it used to suppress them, in particular when
using `numpy.vectorize` which wraps user-level Python code inside of
numpy C code and seems to lose context about warning state. See
numpy/numpy#21416 for more information.
@wshanks
Copy link
Collaborator Author

wshanks commented Dec 20, 2023

I hope that this change might help avoid some occasional CI failures due to the docs erroring due to a warning from the jupyter-sphinx code execution due to uncertainties, but I am not sure.

@wshanks wshanks added this to the Release 0.6 milestone Dec 20, 2023
Copy link
Collaborator

@coruscating coruscating left a comment

Choose a reason for hiding this comment

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

This looks good, thanks. I ran it locally on a Mac and didn't see a failure in 30+ runs.

@wshanks wshanks added this pull request to the merge queue Dec 27, 2023
Merged via the queue into qiskit-community:main with commit d7c17fb Dec 27, 2023
11 checks passed
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 17, 2024
This PR is a follow up to
qiskit-community#1070. It
suppresses numpy warnings during uncertainties array creation in more
places in the code. Something changed recently in the numpy code so that
it generates warnings when it used to suppress them, in particular when
using `numpy.vectorize` which wraps user-level Python code inside of
numpy C code and seems to lose context about warning state. See
numpy/numpy#21416 for more information.
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.

2 participants