qiboteam / qibocal

Quantum calibration, characterization and validation module for Qibo.
https://qibo.science
Apache License 2.0
30 stars 7 forks source link

Add possibility to dump and load `History` #870

Closed andrea-pasquale closed 3 months ago

andrea-pasquale commented 4 months ago

In this PR I address some of the comments raised in #865, given that the changes were substantial I decided to open a separate PR.

There might be a better way to (de)serialize History, the current implementation should be acceptable. The only annoying object left to deal with seems to be meta.json, we could think about a way of moving its content somewhere else.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 97.61905% with 2 lines in your changes missing coverage. Please review.

Project coverage is 97.24%. Comparing base (41439c7) to head (d2cae97). Report is 92 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/qiboteam/qibocal/pull/870/graphs/tree.svg?width=650&height=150&src=pr&token=3EA9ZUNKUY&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) ```diff @@ Coverage Diff @@ ## main #870 +/- ## ========================================== - Coverage 97.27% 97.24% -0.03% ========================================== Files 109 109 Lines 7999 8023 +24 ========================================== + Hits 7781 7802 +21 - Misses 218 221 +3 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibocal/pull/870/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/qibocal/pull/870/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `97.24% <97.61%> (-0.03%)` | :arrow_down: | 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. | [Files](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [src/qibocal/auto/execute.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fauto%2Fexecute.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvYXV0by9leGVjdXRlLnB5) | `100.00% <100.00%> (ø)` | | | [src/qibocal/auto/task.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fauto%2Ftask.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvYXV0by90YXNrLnB5) | `99.19% <100.00%> (+0.09%)` | :arrow_up: | | [src/qibocal/cli/acquisition.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fcli%2Facquisition.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvY2xpL2FjcXVpc2l0aW9uLnB5) | `100.00% <100.00%> (ø)` | | | [src/qibocal/cli/autocalibration.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fcli%2Fautocalibration.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvY2xpL2F1dG9jYWxpYnJhdGlvbi5weQ==) | `100.00% <100.00%> (ø)` | | | [src/qibocal/cli/fit.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fcli%2Ffit.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvY2xpL2ZpdC5weQ==) | `100.00% <100.00%> (ø)` | | | [src/qibocal/cli/report.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fcli%2Freport.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvY2xpL3JlcG9ydC5weQ==) | `100.00% <100.00%> (ø)` | | | [src/qibocal/auto/history.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fauto%2Fhistory.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvYXV0by9oaXN0b3J5LnB5) | `96.66% <91.66%> (-3.34%)` | :arrow_down: | | [src/qibocal/auto/runcard.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/870?src=pr&el=tree&filepath=src%2Fqibocal%2Fauto%2Fruncard.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvYXV0by9ydW5jYXJkLnB5) | `98.27% <94.44%> (+2.44%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/qiboteam/qibocal/pull/870/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)