qiboteam / qibolab

Quantum hardware module and drivers for Qibo.
https://qibo.science
Apache License 2.0
40 stars 10 forks source link

Minor adjustments in result objects #896

Closed andrea-pasquale closed 1 month ago

andrea-pasquale commented 1 month ago

Required by https://github.com/qiboteam/qibocal/pull/832 This PR "corrects" the average property of AveragedIntegratedResults by returning the object itself without performing the average again. I've also added the property phase_std which is useful for qibocal (if you think that it is not necessary I can always drop it and do it directly in qibocal). I'm keeping it as draft to account for any possible changes in https://github.com/qiboteam/qibocal/pull/832

EDIT: I've also implemented #897 here. Checklist:

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 66.62%. Comparing base (41fcafd) to head (e1a7f84). Report is 28 commits behind head on main.

Files Patch % Lines
src/qibolab/result.py 78.57% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #896 +/- ## ========================================== + Coverage 66.61% 66.62% +0.01% ========================================== Files 55 55 Lines 5942 5954 +12 ========================================== + Hits 3958 3967 +9 - Misses 1984 1987 +3 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibolab/pull/896/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qiboteam/qibolab/pull/896/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `66.62% <78.57%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alecandido commented 1 month ago

In long term I agree that these result classes should be revisited and simplified.

Since it's only listed in the events, but not linked in any comment, let me note explicitly that it has already been scheduled for 0.2 https://github.com/qiboteam/qibolab/issues/899

I could provide a PR with the *Results removal, and basic replacement in the common layer. However, replacing with just arrays means that most of the work will have to be done in the drivers (just returning arrays instead of *Result) and Qibocal (handling it properly).