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 the possibly-used-before-assignment in pylint #12542

Merged
merged 9 commits into from
Jun 13, 2024

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Jun 11, 2024

In #12520 @jakelishman mentioned that would be great to enable possibly-used-before-assignment introduced in pylint 3.2

Here it is.

@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @enavarro51
  • @Qiskit/terra-core
  • @ajavadia
  • @levbishop
  • @mtreinish
  • @nkanazawa1989
  • @t-imamichi

@1ucian0 1ucian0 added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in changelog labels Jun 11, 2024
@coveralls
Copy link

coveralls commented Jun 11, 2024

Pull Request Test Coverage Report for Build 9467737904

Details

  • 19 of 25 (76.0%) changed or added relevant lines in 7 files are covered.
  • 17 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 89.579%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/qpy/binary_io/circuits.py 0 1 0.0%
qiskit/transpiler/passes/optimization/commutative_cancellation.py 0 1 0.0%
qiskit/visualization/circuit/matplotlib.py 0 1 0.0%
qiskit/quantum_info/operators/operator.py 6 9 66.67%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/parse.rs 6 97.61%
crates/qasm2/src/lex.rs 11 91.86%
Totals Coverage Status
Change from base Build 9455662900: -0.03%
Covered Lines: 62508
Relevant Lines: 69780

💛 - Coveralls

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for looking at this!

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 9495986714

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 21 of 24 (87.5%) changed or added relevant lines in 7 files are covered.
  • 74 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.02%) to 89.586%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/qpy/binary_io/circuits.py 0 1 0.0%
qiskit/transpiler/passes/optimization/commutative_cancellation.py 0 1 0.0%
qiskit/visualization/circuit/matplotlib.py 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit/circuit/parameterexpression.py 2 96.54%
qiskit/quantum_info/operators/operator.py 3 94.14%
crates/qasm2/src/parse.rs 6 97.61%
qiskit/user_config.py 8 88.54%
crates/qasm2/src/lex.rs 9 92.62%
qiskit/visualization/circuit/circuit_visualization.py 23 73.43%
qiskit/circuit/quantumcircuit.py 23 95.84%
Totals Coverage Status
Change from base Build 9455662900: -0.02%
Covered Lines: 62523
Relevant Lines: 69791

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 9496759963

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 21 of 27 (77.78%) changed or added relevant lines in 8 files are covered.
  • 65 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.01%) to 89.596%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/primitives/backend_estimator.py 0 1 0.0%
qiskit/qpy/binary_io/circuits.py 0 1 0.0%
qiskit/visualization/circuit/matplotlib.py 0 1 0.0%
qiskit/transpiler/passes/optimization/commutative_cancellation.py 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit/circuit/parameterexpression.py 2 96.54%
qiskit/quantum_info/operators/operator.py 3 94.14%
crates/qasm2/src/lex.rs 6 92.88%
qiskit/user_config.py 8 88.54%
qiskit/visualization/circuit/circuit_visualization.py 23 73.43%
qiskit/circuit/quantumcircuit.py 23 95.84%
Totals Coverage Status
Change from base Build 9455662900: -0.01%
Covered Lines: 62531
Relevant Lines: 69792

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Jun 13, 2024
Merged via the queue into Qiskit:main with commit 439de04 Jun 13, 2024
15 checks passed
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
* fix the possibly-used-before-assignment in pylint

* qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py

* test.python.quantum_info.operators.test_utils

* Apply suggestions from code review

Co-authored-by: Jake Lishman <[email protected]>

* https://github.com/Qiskit/qiskit/pull/12542/files#r1636214044

* RuntimeError

* RuntimeError

---------

Co-authored-by: Jake Lishman <[email protected]>
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 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.

None yet

4 participants