-
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
Migrate qiskit.util module to qiskit.utils #5420
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit moves the qiskit.util module to live in the qiskit.utils namespace. There will soon be an import of code that previously lived in qiskit-aqua that will live in qiskit.utils. To avoid confusing naming between qiskit.util and qiskit.utils this commit preemptively makes a utils directory and moves the code from the util module into it. For backwards compatibility the qiskit.util module will reexport the API from qiskit.utils which is now deprecated. A release note is added but no warning is emitted since we can't have module level __getattr__ until the minimum supported python version is 3.7. One function in qiskit.util, _has_connection(), was moved to qiskit.test.decorators. This was done because it's private and not used anywhere else. The interactive visualizations previously relied on this to ensure they could connect to the server hosting the javascript, but that server has since been shutdown and those functions were deprecated in Qiskit#4438 and switched to just call the matplotlib equivalent functions instead.
mtreinish
requested review from
maddy-tod,
nonhermitian and
a team
as code owners
November 20, 2020 20:50
ajavadia
previously approved these changes
Nov 20, 2020
mtreinish
commented
Nov 23, 2020
ajavadia
approved these changes
Nov 25, 2020
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this pull request
Dec 11, 2020
In Qiskit#5420 the qiskit.util module was migrated to qiskit/utils to be consistent with imported code from qiskit-aqua in Qiskit#5422. However, the backwards compat shim added in that PR has a couple of issues, mainly around re-exporting the entirety of qiskit.utils which occasionally causes import cycles and is larger than what functions used to exist in qiskit.util and should be deprecated. This commit fixes this by changing the deprecation shim in qiskit.util to only re-export the functions that previously existed in qiskit.util for backwards compatibility during the deprecation period.
kdk
pushed a commit
that referenced
this pull request
Dec 11, 2020
In #5420 the qiskit.util module was migrated to qiskit/utils to be consistent with imported code from qiskit-aqua in #5422. However, the backwards compat shim added in that PR has a couple of issues, mainly around re-exporting the entirety of qiskit.utils which occasionally causes import cycles and is larger than what functions used to exist in qiskit.util and should be deprecated. This commit fixes this by changing the deprecation shim in qiskit.util to only re-export the functions that previously existed in qiskit.util for backwards compatibility during the deprecation period.
kdk
added
the
Changelog: Deprecation
Include in "Deprecated" section of changelog
label
Mar 31, 2021
ElePT
pushed a commit
to ElePT/qiskit-algorithms
that referenced
this pull request
Jul 27, 2023
* Migrate qiskit.util module to qiskit.utils This commit moves the qiskit.util module to live in the qiskit.utils namespace. There will soon be an import of code that previously lived in qiskit-aqua that will live in qiskit.utils. To avoid confusing naming between qiskit.util and qiskit.utils this commit preemptively makes a utils directory and moves the code from the util module into it. For backwards compatibility the qiskit.util module will reexport the API from qiskit.utils which is now deprecated. A release note is added but no warning is emitted since we can't have module level __getattr__ until the minimum supported python version is 3.7. One function in qiskit.util, _has_connection(), was moved to qiskit.test.decorators. This was done because it's private and not used anywhere else. The interactive visualizations previously relied on this to ensure they could connect to the server hosting the javascript, but that server has since been shutdown and those functions were deprecated in Qiskit/qiskit#4438 and switched to just call the matplotlib equivalent functions instead. * Update qiskit/utils/__init__.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This commit moves the qiskit.util module to live in the qiskit.utils
namespace. There will soon be an import of code that previously lived in
qiskit-aqua that will live in qiskit.utils. To avoid confusing naming
between qiskit.util and qiskit.utils this commit preemptively makes a
utils directory and moves the code from the util module into it. For
backwards compatibility the qiskit.util module will reexport the API
from qiskit.utils which is now deprecated. A release note is added but
no warning is emitted since we can't have module level getattr until
the minimum supported python version is 3.7.
One function in qiskit.util, _has_connection(), was moved to
qiskit.test.decorators. This was done because it's private and not used
anywhere else. The interactive visualizations previously relied on this
to ensure they could connect to the server hosting the javascript, but
that server has since been shutdown and those functions were deprecated
in #4438 and switched to just call the matplotlib equivalent functions
instead.
Details and comments