-
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 fake backend v2 dtm unit #8019
Conversation
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:
|
@data(*FAKE_PROVIDER_FOR_BACKEND_V2.backends()) | ||
def test_backend_v2_dtm(self, backend): | ||
if backend.dtm: | ||
self.assertLess(backend.dtm, 1e-6) | ||
|
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 test for dtm
cannot be combined with dt
(like test_to_dict_configuration
) because dtm
is not part of the target. But I am not sure creating a specific test just for dtm
is a good practice or not.
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.
@mtreinish What do you think about the test? Is the function name too specific? Does this test belong to this file or should it be in the test_fake_backend_v2.py?
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.
This is fine here and is a reasonable test to make sure we've got the unit conversion right.
Pull Request Test Coverage Report for Build 2271900780
💛 - Coveralls |
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, just one tiny inline suggestion
Co-authored-by: Matthew Treinish <[email protected]>
* convert dtm from nanoseconds to seconds * Handle dtm not defined in configuration * Add test for checking backend v2 dtm less than 1e-6 * add release note * new line in release note * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit cffbb84)
* convert dtm from nanoseconds to seconds * Handle dtm not defined in configuration * Add test for checking backend v2 dtm less than 1e-6 * add release note * new line in release note * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit cffbb84) Co-authored-by: Junye Huang <[email protected]>
* convert dtm from nanoseconds to seconds * Handle dtm not defined in configuration * Add test for checking backend v2 dtm less than 1e-6 * add release note * new line in release note * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
Fixed an issue where
FakeBackendV2.dtm
is reading from configuration file, expecting it to be in seconds, when it's actually in nanoseconds.Related to a similar issue for
dt
: #8000Details and comments
Fixes #8018