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

Fix FakeProviderForBackendV2.get_backend bug #8592

Closed
wants to merge 9 commits into from
Closed

Fix FakeProviderForBackendV2.get_backend bug #8592

wants to merge 9 commits into from

Conversation

HuangJunye
Copy link
Collaborator

@HuangJunye HuangJunye commented Aug 22, 2022

Summary

Previously, FakeProviderForBackendV2.get_backend("fake_backend_name") raises an error due to API change in BackendV2. This PR fixes this bug.

Fix #8531

Details and comments

  • Fixed get_backend issue
  • Updated fake provider module API code example to use provider.get_backend syntax
  • Added test_fake_provider.py

@qiskit-bot
Copy link
Collaborator

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:

  • @Qiskit/terra-core

@HuangJunye HuangJunye added the mod: fake_provider Related to the fake_provider module and fake backends label Aug 22, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 2902618988

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 84.054%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/providers/fake_provider/fake_provider.py 0 1 0.0%
Totals Coverage Status
Change from base Build 2890590743: 0.003%
Covered Lines: 56324
Relevant Lines: 67009

💛 - Coveralls

@acastanedam
Copy link

Hi @HuangJunye, I am also interested in this fix. I think the test is not passing because in the assertion (line 37) the target for insinstance should be FakeManilaV2. Probably, to be more general such assertion could be written in terms of the version: assert backend.version == 2.

@acastanedam
Copy link

Hi, in regard to this PR, is it still feasible to include it or should one move towards the use of BackendV2Converter ?.
Thansk in advance.

@HuangJunye
Copy link
Collaborator Author

Hi, in regard to this PR, is it still feasible to include it or should one move towards the use of BackendV2Converter ?.

Thansk in advance.

Sorry for keeping the this PR staled for so long. I think we can include it. I just need to add tests. I'll get to it next week

@acastanedam
Copy link

acastanedam commented Jun 23, 2023

Hi, could I cooperate to include this PR?

@ajavadia
Copy link
Member

@HuangJunye can you please update this branch so this bug can be fixed?

@1ucian0 1ucian0 added this to the 0.25.2 milestone Aug 17, 2023
@1ucian0 1ucian0 self-assigned this Aug 17, 2023
@1ucian0 1ucian0 modified the milestones: 0.25.2, 0.45.0 Sep 21, 2023
@HuangJunye HuangJunye closed this by deleting the head repository Sep 29, 2023
@acastanedam
Copy link

Hi, one question, will be this PR included in the current dev branch?. The problem is still there, I can volunteer to help in there as I really need the fix.
Thanks in advance

@HuangJunye
Copy link
Collaborator Author

@acastanedam I accidentally deleted the branch. I have been wanted to finish this for a year but I get distracted with other things. I apologize for the delay. Can ask for your help to finish this? You can open a new PR and copy over the changes I have made so far and add tests. That should be enough to finish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: fake_provider Related to the fake_provider module and fake backends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FakeProviderForBackendV2.get_backend raises an error when filtering by name
6 participants