-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix handling of numpy arrays for indices in marginal_distribution #8288
Conversation
This commit fixes an issue with the marginal_distribution() function where it would previously error if a numpy arrray of ints was passed in for the indices parameter. This was caused by the input validation looking for empty input by checking `not indices` which isn't valid for numpy arrays. This commit fixes this by adjusting the check for empty lists to work with any sequence input. Fixes Qiskit#8283
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 2598717170
💛 - Coveralls |
releasenotes/notes/fix-numpy-indices-marginal-dist-45889e49ba337d84.yaml
Outdated
Show resolved
Hide resolved
…37d84.yaml Co-authored-by: Jim Garrison <jim@garrison.cc>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
) * Fix handling of numpy arrays for indices in marginal_distribution This commit fixes an issue with the marginal_distribution() function where it would previously error if a numpy arrray of ints was passed in for the indices parameter. This was caused by the input validation looking for empty input by checking `not indices` which isn't valid for numpy arrays. This commit fixes this by adjusting the check for empty lists to work with any sequence input. Fixes #8283 * Update releasenotes/notes/fix-numpy-indices-marginal-dist-45889e49ba337d84.yaml Co-authored-by: Jim Garrison <jim@garrison.cc> Co-authored-by: Jim Garrison <jim@garrison.cc> (cherry picked from commit f868129)
) (#8396) * Fix handling of numpy arrays for indices in marginal_distribution This commit fixes an issue with the marginal_distribution() function where it would previously error if a numpy arrray of ints was passed in for the indices parameter. This was caused by the input validation looking for empty input by checking `not indices` which isn't valid for numpy arrays. This commit fixes this by adjusting the check for empty lists to work with any sequence input. Fixes #8283 * Update releasenotes/notes/fix-numpy-indices-marginal-dist-45889e49ba337d84.yaml Co-authored-by: Jim Garrison <jim@garrison.cc> Co-authored-by: Jim Garrison <jim@garrison.cc> (cherry picked from commit f868129) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Summary
This commit fixes an issue with the marginal_distribution() function
where it would previously error if a numpy arrray of ints was passed in
for the indices parameter. This was caused by the input validation
looking for empty input by checking
not indices
which isn't valid fornumpy arrays. This commit fixes this by adjusting the check for
empty lists to work with any sequence input.
Details and comments
Fixes #8283