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

Apply new deprecation decorators to circuit folder #9869

Merged
merged 13 commits into from
May 10, 2023

Conversation

Eric-Arellano
Copy link
Collaborator

Summary

See #9676 for the motivation.

Details and comments

@Eric-Arellano Eric-Arellano added the Changelog: None Do not include in changelog label Mar 29, 2023
@Eric-Arellano Eric-Arellano requested a review from a team as a code owner March 29, 2023 14:52
@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:

@1ucian0 1ucian0 added the type: qa Issues and PRs that relate to testing and code quality label Mar 30, 2023
@coveralls
Copy link

coveralls commented Mar 30, 2023

Pull Request Test Coverage Report for Build 4865768041

  • 14 of 14 (100.0%) changed or added relevant lines in 5 files are covered.
  • 13 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.008%) to 85.924%

Files with Coverage Reduction New Missed Lines %
qiskit/circuit/tools/pi_check.py 1 91.23%
crates/qasm2/src/lex.rs 3 91.14%
qiskit/pulse/library/waveform.py 3 93.75%
crates/qasm2/src/parse.rs 6 97.58%
Totals Coverage Status
Change from base Build 4865061231: 0.008%
Covered Lines: 71209
Relevant Lines: 82874

💛 - Coveralls

@Eric-Arellano
Copy link
Collaborator Author

Bump

@Eric-Arellano Eric-Arellano added this to the 0.24.0 milestone Apr 10, 2023
@1ucian0 1ucian0 self-assigned this Apr 13, 2023
qiskit/circuit/bit.py Outdated Show resolved Hide resolved
# Over-specific import to avoid cyclic imports.
from qiskit.utils.deprecation import deprecate_function
from qiskit.utils.deprecation import deprecate_func
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, the comment is still true lol. It's fine to get rid of it, though.

Comment on lines 103 to 105
"(The classical registers are insufficient to access all classical resources in a "
"circuit, as there may be loose classical bits as well. It can also cause integer "
"indices to be resolved incorrectly if any registers overlap.)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nitpicky, but the parenthetical sentences here end up being longer than the actual deprecation message, which feels pretty weird to me. It's either important information for the user, in which case it needn't be parenthesised, or it's not and it can be a code/docs-only comment instead. I don't particularly mind which.

r"'Bit\.(register|index)' is deprecated.*",
r"The property ``qiskit\.circuit\.bit\.Bit\.(register|index)`` is deprecated.*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only semi-related: the error message we've got here shows a potential place for improvement in the decorators to me; qiskit.circuit.bit.Bit.register feels way too long to put out. I think Bit.register would be less noisy - the user will always be able to inspect the object themselves if they need to know more about it.

test/python/circuit/test_instructions.py Outdated Show resolved Hide resolved
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Apr 20, 2023
@mtreinish mtreinish modified the milestones: 0.24.0, 0.24.1 May 4, 2023
@1ucian0 1ucian0 added this pull request to the merge queue May 10, 2023
Merged via the queue into Qiskit:main with commit 5323d8f May 10, 2023
mergify bot pushed a commit that referenced this pull request May 10, 2023
* Apply new deprecation decorators to circuit folder

* Fix what I can (blocked by production issues)

* Work around tests using bad production code

* Revert "Work around tests using bad production code"

This reverts commit 54f6ee8.

* Better fix for the deprecations

* Use QiskitTestCase ignore mechanism

* Review feedback

* Fix lint and test failure

(cherry picked from commit 5323d8f)
@Eric-Arellano Eric-Arellano deleted the apply-deprecations-circuit branch May 10, 2023 22:13
mtreinish pushed a commit that referenced this pull request May 10, 2023
* Apply new deprecation decorators to circuit folder

* Fix what I can (blocked by production issues)

* Work around tests using bad production code

* Revert "Work around tests using bad production code"

This reverts commit 54f6ee8.

* Better fix for the deprecations

* Use QiskitTestCase ignore mechanism

* Review feedback

* Fix lint and test failure

(cherry picked from commit 5323d8f)

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
* Apply new deprecation decorators to circuit folder

* Fix what I can (blocked by production issues)

* Work around tests using bad production code

* Revert "Work around tests using bad production code"

This reverts commit 54f6ee8.

* Better fix for the deprecations

* Use QiskitTestCase ignore mechanism

* Review feedback

* Fix lint and test failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants