-
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
Move qiskit.test.mock
to qiskit.providers.fake_provider
and deprecate
#8121
Conversation
Anything that can be imported from fake_provider root are imported from there instead of sub files.
…ers.fake_provider
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 2546139012
💛 - Coveralls |
@jakelishman I think I fixed all the coupling maps issues. At least I couldn't find any issues when building locally. Let's hope the docs build passes. Please review the PR when you have time! |
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 looks really good, thanks a lot for all the work this entailed. To be completely consistent, we should make sure that import paths like from qiskit.test.mock.backends.hanoi import FakeHanoi
work as well. It's nuisance busy-work, but let's just be safe.
I'll push a commit that does that, though - no need to worry.
...asenotes/notes/move-qiskit.test.mock-to-qiskit.providers.fake_provider-7f36ff80a05f9a9a.yaml
Outdated
Show resolved
Hide resolved
The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side.
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.
Thanks for this - it was super fiddly, and you were super thorough in taking care of all of it!
Thanks for your guidance along the way and adding the depreciation warnings to all submodules! |
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.
Fixed merge conflicts.
…cate (Qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit#7437 to test the new imports which are not needed any more: Qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 4560748. * Revert "linting" This reverts commit eddfa65. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…cate (Qiskit/qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit/qiskit#7437 to test the new imports which are not needed any more: Qiskit/qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 45607489303fde0e65e550f117735ec4f468ff3d. * Revert "linting" This reverts commit eddfa65bf6f65f076c7eff4d1a20bb251c56658b. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8b57e8ea248ede0bec9db67e02dcb08eed. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…cate (Qiskit/qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit/qiskit#7437 to test the new imports which are not needed any more: Qiskit/qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 45607489303fde0e65e550f117735ec4f468ff3d. * Revert "linting" This reverts commit eddfa65bf6f65f076c7eff4d1a20bb251c56658b. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8b57e8ea248ede0bec9db67e02dcb08eed. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…cate (Qiskit/qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit/qiskit#7437 to test the new imports which are not needed any more: Qiskit/qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 45607489303fde0e65e550f117735ec4f468ff3d. * Revert "linting" This reverts commit eddfa65bf6f65f076c7eff4d1a20bb251c56658b. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8b57e8ea248ede0bec9db67e02dcb08eed. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…cate (Qiskit/qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit/qiskit#7437 to test the new imports which are not needed any more: Qiskit/qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 45607489303fde0e65e550f117735ec4f468ff3d. * Revert "linting" This reverts commit eddfa65bf6f65f076c7eff4d1a20bb251c56658b. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8b57e8ea248ede0bec9db67e02dcb08eed. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…cate (Qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit#7437 to test the new imports which are not needed any more: Qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 4560748. * Revert "linting" This reverts commit eddfa65. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…cate (Qiskit/qiskit#8121) * redirect imports from qiskit.test.mock to qiskit.providers.fake_provider * import the rest of classes in fake_backend_v2 to fake_provider * redirect imports to fake_provider Anything that can be imported from fake_provider root are imported from there instead of sub files. * change jupyter-execute to code-block * redirect import * Combine multiple imports into one * Add missing ) * move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider * redirect imports in fake_provider.__init__.py * redirect imports in mock.__init__.py * Use relative imports in fake_provider.__init__.py * redirect .utlis imports * Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names * Match imports from the old and new __init__ * Organize imports * black linting * Fix FakePulseBackend import order dependency * fix cyclic import * move relative import after absolute import * fix cyclic import * Update MANIFEST.ini with new path * add deprecation warning * add deprecation test * add release note * move test files from test.python.mock to test.python.providers.fake_provider * linting * linting * change deprecation warning location * update path for tools/update_fake_backends.py * rename docstrings * Update ibmq_mock.py * import back FakeBackendV2 and FakeBackend5QV2 in __init__ * Modify release note * reformat release note * remove unnecessary tests These two tests were introduced in PR Qiskit/qiskit#7437 to test the new imports which are not needed any more: Qiskit/qiskit#7437 (comment) * Use relative imports * redirect import in test_schedular.py * first draft of module level doc * Update docstring of fake provider v1 and v2 * Update wording of module level doc * add fake V1 and V2 backends * Correct fake v1 and v2 backends in the list * comment on backends that do not have V2 versions * list special fake backends * Add descriptions for sections * add code example using jupyter execute * Update code example and improve descriptions of the module * not using fake provider before fake provider get backend name is fixed * modify comment * formating fix * Remove fake backend coupling map from docstrings * linting * remove coupling map of Pooughkeepsie * add qiskit-aer to tox.ini as deps for docs build * Revert "remove coupling map of Pooughkeepsie" This reverts commit 45607489303fde0e65e550f117735ec4f468ff3d. * Revert "linting" This reverts commit eddfa65bf6f65f076c7eff4d1a20bb251c56658b. * Revert "Remove fake backend coupling map from docstrings" This reverts commit 3aee7a8b57e8ea248ede0bec9db67e02dcb08eed. * fix coupling maps * Fix minor typos * Issue deprecation warnings from all levels of package The previous commits in this PR did not maintain the old import paths for submodules of `qisit.test.mock`. This re-instatates them, with suitable deprecation warnings. Hopefully nobody is using these anyway, but it's better to be on the safe side. * Import from the correct location Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
In #7437 we began the process of moving the features in
qiskit.test.mock
toqiskit.providers.fake_provider
, by making them accessible at the new name. The PR official move the files inside the folders to the new location and adds deprecation warnings.Fixes #7738
Related to #6862
Details and comments
To do
Questions
Future issues
qiskit.test.mock
toqiskit.providers.fake_provider
and deprecate #8121 (comment))__init__.py
import classes in 0.22.0. (see Moveqiskit.test.mock
toqiskit.providers.fake_provider
and deprecate #8121 (comment))FakeProviderForBackendV2.get_backend
bug. Need to remove()
aftername
Future documentation issues
Documentation screenshot