-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 plot_error_map with BackendProperties set or BackendV2 #7880
Conversation
In Qiskit#7814 we updated the plot_error_map() error to be more general and also work with BackendV2 instead of assuming it's a BaseBackend or BackendV1 backend. However, as part of that refactor 2 errors were accidently introduced preventing the function from being used. First in the BackendV2 path we were incorrectly handling the backend name to use for the plot title. Secondly, in the BaseBackend/BackendV1 path the readout error array loop was incorrectly constructed resulting in the array being larger than expected causing an error. This commit fixes both conditions so that we can correctly plot the result. Fixes Qiskit#7879
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.
The changeset looks good to me - it looks pretty straightforward. Given that we broke simple functionality in an update here, is there some simple regression test we can add for the future?
Heh, yeah the complete lack of test coverage for this function is how this slipped in the first place. I'll add some tests |
Pull Request Test Coverage Report for Build 2091796475
💛 - Coveralls |
This commit adds test coverage for plot_error_map. The reason the issues around this function slipped in was a complete lack of test coverage. This adds some basic tests with both the BackendV1 and BackendV2 test paths to ensure we have some coverage for the function.
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.
The tests look fine, and it'll be good to get the increased coverage too. I think you'll want a bugfix release note before merge?
* Fix plot_error_map In #7814 we updated the plot_error_map() error to be more general and also work with BackendV2 instead of assuming it's a BaseBackend or BackendV1 backend. However, as part of that refactor 2 errors were accidently introduced preventing the function from being used. First in the BackendV2 path we were incorrectly handling the backend name to use for the plot title. Secondly, in the BaseBackend/BackendV1 path the readout error array loop was incorrectly constructed resulting in the array being larger than expected causing an error. This commit fixes both conditions so that we can correctly plot the result. Fixes #7879 * Add tests for plot_error_map This commit adds test coverage for plot_error_map. The reason the issues around this function slipped in was a complete lack of test coverage. This adds some basic tests with both the BackendV1 and BackendV2 test paths to ensure we have some coverage for the function. * Add release note (cherry picked from commit d430e4d)
…7887) * Fix plot_error_map In #7814 we updated the plot_error_map() error to be more general and also work with BackendV2 instead of assuming it's a BaseBackend or BackendV1 backend. However, as part of that refactor 2 errors were accidently introduced preventing the function from being used. First in the BackendV2 path we were incorrectly handling the backend name to use for the plot title. Secondly, in the BaseBackend/BackendV1 path the readout error array loop was incorrectly constructed resulting in the array being larger than expected causing an error. This commit fixes both conditions so that we can correctly plot the result. Fixes #7879 * Add tests for plot_error_map This commit adds test coverage for plot_error_map. The reason the issues around this function slipped in was a complete lack of test coverage. This adds some basic tests with both the BackendV1 and BackendV2 test paths to ensure we have some coverage for the function. * Add release note (cherry picked from commit d430e4d) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Summary
In #7814 we updated the plot_error_map() error to be more general and
also work with BackendV2 instead of assuming it's a BaseBackend or
BackendV1 backend. However, as part of that refactor 2 errors were
accidently introduced preventing the function from being used. First in
the BackendV2 path we were incorrectly handling the backend name to use
for the plot title. Secondly, in the BaseBackend/BackendV1 path the
readout error array loop was incorrectly constructed resulting in the
array being larger than expected causing an error. This commit fixes
both conditions so that we can correctly plot the result.
Details and comments
Fixes #7879