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

Coverage fix #1288

Merged
merged 19 commits into from
Jul 12, 2024
Merged

Coverage fix #1288

merged 19 commits into from
Jul 12, 2024

Conversation

BrunoLiegiBastonLiegi
Copy link
Contributor

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi commented Mar 28, 2024

This restores the 100% coverage.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e3d8008) to head (6be8f28).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #1288      +/-   ##
===========================================
+ Coverage   99.84%   100.00%   +0.15%     
===========================================
  Files          76        76              
  Lines       10844     10834      -10     
===========================================
+ Hits        10827     10834       +7     
+ Misses         17         0      -17     
Flag Coverage Δ
unittests 100.00% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renatomello renatomello linked an issue Mar 31, 2024 that may be closed by this pull request
@MatteoRobbiati MatteoRobbiati requested review from MatteoRobbiati and removed request for MatteoRobbiati May 29, 2024 07:50
@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi marked this pull request as ready for review July 4, 2024 08:28
@BrunoLiegiBastonLiegi
Copy link
Contributor Author

BrunoLiegiBastonLiegi commented Jul 4, 2024

@stavros11 Can I ask for your help to double check whether some lines that I commented out are still useful?
Namely, here
https://github.com/qiboteam/qibo/blob/21c766e12290c2a2818132c4ef092119dab67e19/src/qibo/models/circuit.py#L704C2-L707C63
I don't think we allow for different measurements to be in the same register, right?
And here
https://github.com/qiboteam/qibo/blob/21c766e12290c2a2818132c4ef092119dab67e19/src/qibo/gates/abstract.py#L87C1-L90C1
I think this was needed because either the qubits, target_qubits or control_qubits attribute of Gate was originally initialized as a set, however, I believe I recently changed this in #1259, and thus it is no longer needed. Can you confirm that?

@stavros11
Copy link
Member

Namely, here https://github.com/qiboteam/qibo/blob/21c766e12290c2a2818132c4ef092119dab67e19/src/qibo/models/circuit.py#L704C2-L707C63 I don't think we allow for different measurements to be in the same register, right?

That is correct, based on the error here:

for mgate in self.measurements:
if name == mgate.register_name:
raise_error(
KeyError, f"Register {name} already exists in circuit."
)

so it should be fine to drop the commented lines.
Not entirely related but
return {name: qubits for name, qubits in registers.items()}

doesn't seem to be doing much other than copying the registers dictionary, right? It shouldn't be different than simply

return registers

And here https://github.com/qiboteam/qibo/blob/21c766e12290c2a2818132c4ef092119dab67e19/src/qibo/gates/abstract.py#L87C1-L90C1 I think this was needed because either the qubits, target_qubits or control_qubits attribute of Gate was originally initialized as a set, however, I believe I recently changed this in #1259, and thus it is no longer needed. Can you confirm that?

I think I was not the author of raw and these particular lines, but I believe you are right, this should only be there to accommodate for _control_qubits being a set. Since this is no longer the case, it should be safe to drop.

@scarrazza
Copy link
Member

@BrunoLiegiBastonLiegi I believe this is almost ready to go, could you please merge master / fix the lock file?

tests/test_hamiltonians_from_symbols.py Outdated Show resolved Hide resolved
@renatomello
Copy link
Contributor

@BrunoLiegiBastonLiegi I believe this is almost ready to go, could you please merge master / fix the lock file?

Generating the updated lock file is taking upwards of 5min. Is that normal?

Co-authored-by: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com>
@renatomello renatomello added this pull request to the merge queue Jul 12, 2024
Merged via the queue into master with commit c3031c6 Jul 12, 2024
27 checks passed
@renatomello renatomello deleted the cov_fix branch July 12, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coverage decrease
4 participants