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

Handling ZeroDivisionError #842

Merged
merged 2 commits into from
May 15, 2024
Merged

Handling ZeroDivisionError #842

merged 2 commits into from
May 15, 2024

Conversation

andrea-pasquale
Copy link
Contributor

Closes #733

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.
  • Compatibility with Qibo modules (Please edit this section if the current pull request is not compatible with the following branches).
    • Qibo: master
    • Qibolab: main
    • Qibolab_platforms_qrc: main

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 97.22%. Comparing base (aad9f40) to head (4336866).
Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #842      +/-   ##
==========================================
- Coverage   97.26%   97.22%   -0.04%     
==========================================
  Files         106      106              
  Lines        7855     7860       +5     
==========================================
+ Hits         7640     7642       +2     
- Misses        215      218       +3     
Flag Coverage Δ
unittests 97.22% <50.00%> (-0.04%) ⬇️

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

Files Coverage Δ
...aracterization/two_qubit_interaction/chsh/utils.py 82.35% <50.00%> (-17.65%) ⬇️

return chsh / nshots
try:
return chsh / nshots
except ZeroDivisionError:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we log a message displaying that there was some kind of error in the division?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I don't expect this to ever happen on hardware. Only with the dummy it happens.

@andrea-pasquale andrea-pasquale added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit f869f28 May 15, 2024
20 of 21 checks passed
@andrea-pasquale andrea-pasquale deleted the chsh_fail branch May 15, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent tests from failing randomly
3 participants