qiboteam / qibocal

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

Move output folder management #909

Open alecandido opened 1 week ago

alecandido commented 1 week ago

The original goal was to make History the manager of the whole output folder.

It is almost already happening, but there are a few main exceptions:

To avoid overcomplicating the History object, I will create a new Output one, and make such that everything could be retrieved just with a handle on an instance of this object.

The main motivation is to expose in a more structured way some operations that are now done internally by the CLI functions, e.g. https://github.com/qiboteam/qibocal/blob/4b8d407b11ebce72544821b361ea22df2f61c73a/src/qibocal/cli/fit.py#L58-L61 in such a way that it will be simpler to expose them for scripts, as those in #869

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 97.64398% with 9 lines in your changes missing coverage. Please review.

Project coverage is 97.18%. Comparing base (4b8d407) to head (d2e8885). Report is 2 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/qiboteam/qibocal/pull/909/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/909?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) ```diff @@ Coverage Diff @@ ## main #909 +/- ## ========================================== - Coverage 97.47% 97.18% -0.30% ========================================== Files 116 117 +1 Lines 8882 8953 +71 ========================================== + Hits 8658 8701 +43 - Misses 224 252 +28 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibocal/pull/909/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/909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `97.18% <97.64%> (-0.30%)` | :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/909?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/\_\_init\_\_.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [src/qibocal/auto/execute.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?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/mode.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2Fauto%2Fmode.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvYXV0by9tb2RlLnB5) | `100.00% <100.00%> (ø)` | | | [src/qibocal/auto/output.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2Fauto%2Foutput.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvYXV0by9vdXRwdXQucHk=) | `100.00% <100.00%> (ø)` | | | [src/qibocal/cli/\_base.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2Fcli%2F_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvY2xpL19iYXNlLnB5) | `91.22% <ø> (ø)` | | | [src/qibocal/cli/fit.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?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/909?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/cli/upload.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2Fcli%2Fupload.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvY2xpL3VwbG9hZC5weQ==) | `34.09% <100.00%> (ø)` | | | [...l/protocols/randomized\_benchmarking/standard\_rb.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frandomized_benchmarking%2Fstandard_rb.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhbmRvbWl6ZWRfYmVuY2htYXJraW5nL3N0YW5kYXJkX3JiLnB5) | `98.59% <100.00%> (+0.04%)` | :arrow_up: | | [...protocols/two\_qubit\_interaction/chevron/chevron.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Ftwo_qubit_interaction%2Fchevron%2Fchevron.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3R3b19xdWJpdF9pbnRlcmFjdGlvbi9jaGV2cm9uL2NoZXZyb24ucHk=) | `96.96% <100.00%> (-2.25%)` | :arrow_down: | | ... and [10 more](https://app.codecov.io/gh/qiboteam/qibocal/pull/909?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/qiboteam/qibocal/pull/909/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)
alecandido commented 1 week ago

@andre-pasquale I should have made enough mess, now I will try to put the pieces back together.

However, I (more or less) reached the goal I had in mind, i.e. simplify the autocalibration command implementation, by delegating most of the operations to the new Output and friends. https://github.com/qiboteam/qibocal/blob/c7b3da326c6a86c49947c4a43ac3ba2acb90b46f/src/qibocal/cli/autocalibration.py#L13-L52

The main reason is that for #869 most of the operations will be done by the executor. We can avoid dumping the runcard, since there won't be a runcard, and some operations might be left to the user. But I wanted to avoid leaving too many operations to the user, because it would just become boilerplate, to copy-paste in each and every script...

alecandido commented 1 week ago

By now, few operations are left:

Eventually, the script should be simply something like:

from qibocal.routines import ..., close  # <- here the default executor creation happens

# execute routines
...

close() # <- disconnect the platform and so on

It should be the minimal boilerplate I can leave to the user.

alecandido commented 1 week ago

The former means that the Executor will be in charge of everything, including dumping.

I wanted to isolate the disk operations from the execution, with two separate domains. But the trade-off is to handle two different objects, the Executor and the Output, with an explicit information flow from one to the other.

I'm not a huge fun of having everything happening under a single object, i.e. the Executor, so later on I might put some more effort to make it more modular. However, for the time being that's a simple enough solution, and it will simplify the UX.

alecandido commented 3 days ago

I agree with all the minor changes, regarding some of the breaking changes that you highlighted I replied directly in the comments. Let me know when this is ready to review and I will have another look.

Unfortunately, I would have liked to postpone some changes, to immediately review & merge a smaller unit. That's why I split this before #869, despite that being the goal. I opened some issues for that purpose, but I'm not sure how many things I will be able to keep separate (e.g. I ended up implementing #911 here, at least preliminarily).

alecandido commented 2 days ago

@andrea-pasquale @Edoardo-Pedicillo I still need to finish providing tests, to improve coverage and test the new structures in isolation.

However, tests are already passing, and since this review might take a while I already switched to "ready for review". This is in order to accelerate the process, since this could be useful, and maybe enough to complete #869 as well.

Nevertheless, since I changed a few things, even in high-level behavior, I would ask you to run something to test that Qibocal is not broken in any major and fully undesirable way (not detected by tests). Since I'm mostly playing with the output, and I almost didn't touch the routines (other than minimal support for lists), this should not require actual execution, but "dummy" should be more than enough.

alecandido commented 2 days ago

While testing qiboteam/qibolab_platforms_qrc#148 I got the following error which is not present in main. Most likely it is due to the fact that this particular platform is using strings (which I know you don't like as QubitId :) ). I don't know if we can force them to use int, in any case if you could make the refactor works also with strings that would be perfect.

You're right I don't like, but I didn't anything specific to break it.

Can you tell me how to reproduce the error?

andrea-pasquale commented 2 days ago

While testing qiboteam/qibolab_platforms_qrc#148 I got the following error which is not present in main. Most likely it is due to the fact that this particular platform is using strings (which I know you don't like as QubitId :) ). I don't know if we can force them to use int, in any case if you could make the refactor works also with strings that would be perfect.

You're right I don't like, but I didn't anything specific to break it.

Can you tell me how to reproduce the error?

Sure, sorry for not specifying it before. I am running with this runcard

actions:
- id: qubit flux dependence
  operation: qubit_flux
  parameters:
    bias_step: 0.004
    bias_width: 0.2
    drive_amplitude: 0.007
    drive_duration: 1000
    freq_step: 250000
    freq_width: 20000000
    nshots: 1000
    relaxation_time: 10000
  targets: null
  update: true
backend: qibolab
platform: qw11q
targets:
- D1
- D2
- D3
- D4
- D5
update: true

On the branch which I pointed out before in qibolab_platforms_qrc

alecandido commented 1 day ago

With QM I've not been able to reproduce the issue, because of the following error:

Traceback (most recent call last):
  File "/home/users/alessandro.candido/.cache/pypoetry/virtualenvs/qrcli-S0iYXEb--py3.10/lib/python3.10/site-packages/qm/octave/calibration_db.py", line 98, in __del__
    self._db.close()
AttributeError: 'CalibrationDB' object has no attribute '_db'

(maybe I should fiddle a bit with the versions)

However, I already get an error using dummy, and there is a different error I obtained by not specifying the output folder (despite a default is available)

The errors ```py Traceback (most recent call last): File "/home/alessandro/Projects/quantum/qrc/.venv/bin/qq", line 8, in sys.exit(command()) ^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/cli/_base.py", line 72, in auto autocalibrate(runcard, folder, force, update) File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/cli/autocalibration.py", line 51, in autocalibrate history = run(output=path, runcard=runcard, mode=AUTOCALIBRATION) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/auto/execute.py", line 106, in run instance.run_protocol( File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/auto/execute.py", line 77, in run_protocol completed = task.run( ^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/auto/task.py", line 97, in run completed.data, completed.data_time = operation.acquisition( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/auto/operation.py", line 42, in wrapper out = func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/protocols/flux_dependence/qubit_flux_dependence.py", line 94, in _acquisition qd_pulses[qubit] = platform.create_qubit_drive_pulse( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibolab/src/qibolab/platform/platform.py", line 379, in create_qubit_drive_pulse qubit = self.get_qubit(qubit) ^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibolab/src/qibolab/platform/platform.py", line 321, in get_qubit return list(self.qubits.keys())[qubit] ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^ TypeError: list indices must be integers or slices, not str ``` ```py Traceback (most recent call last): File "/home/alessandro/Projects/quantum/qrc/.venv/bin/qq", line 8, in sys.exit(command()) ^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/cli/_base.py", line 72, in auto autocalibrate(runcard, folder, force, update) File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/cli/autocalibration.py", line 42, in autocalibrate runcard.dump(folder) File "/home/alessandro/Projects/quantum/qrc/qibocal/src/qibocal/auto/runcard.py", line 91, in dump (path / RUNCARD).write_text(yaml.safe_dump(asdict(self))) ~~~~~^~~~~~~~~ TypeError: unsupported operand type(s) for /: 'NoneType' and 'str' ```

I will now focus on those. Then, I will ask you again for the environment. Mine is the following: https://github.com/alecandido/qrc/blob/ffc94221b866f6c5be538deac688a335c479b396/pyproject.toml#L17-L18 https://github.com/alecandido/qrc/blob/qibocal-909/.gitmodules

andrea-pasquale commented 1 day ago

With QM I've not been able to reproduce the issue, because of the following error:

Traceback (most recent call last):
  File "/home/users/alessandro.candido/.cache/pypoetry/virtualenvs/qrcli-S0iYXEb--py3.10/lib/python3.10/site-packages/qm/octave/calibration_db.py", line 98, in __del__
    self._db.close()
AttributeError: 'CalibrationDB' object has no attribute '_db'

(maybe I should fiddle a bit with the versions)

However, I already get an error using dummy, and there is a different error I obtained by not specifying the output folder (despite a default is available) The errors

I will now focus on those. Then, I will ask you again for the environment. Mine is the following: https://github.com/alecandido/qrc/blob/ffc94221b866f6c5be538deac688a335c479b396/pyproject.toml#L17-L18 https://github.com/alecandido/qrc/blob/qibocal-909/.gitmodules

Uhm, that is weird... Hopefully I didn't break anything when I pushed my changes in https://github.com/qiboteam/qibolab_platforms_qrc/pull/148 I'll try again

alecandido commented 1 day ago

Ah, apparently the two issues I described above are there even with main... (switching to dummy)

And my bad: the error above was caused by me not exporting the environment variable QIBOLAB_PLATFORMS (on my machine I have it set by Nix, but there is no Nix on the QRC cluster, and I didn't study yet how to properly use it without admin privileges, so I'm definitely not proposing to use it there... yet...).

Now I've been able to run with https://github.com/qiboteam/qibocal/tree/main and qw11q.

alecandido commented 1 day ago

Ok, I tested again, and now I'm not getting any error at all...

I'm now using https://github.com/alecandido/qrc/commit/bda9c728a26d995d9d7cada38d50c6deac7ab267

Here is the command and the printed output:

alessandro.candido@saadiyat:~/qrc$ srun -p qw5q_platinum poetry run qq auto runcards/string-targets.yml -o var/ciao -f
2024-07-03 14:19:43,502 - qm - INFO     - Starting session: 62b8d03d-b91d-4e14-bdb9-c2ee14973ce6
2024-07-03 14:19:46,470 - qm - INFO     - Octave "octave4" Health check passed, current temperature 56
2024-07-03 14:19:47,389 - qm - INFO     - Octave "octave5" Health check passed, current temperature 59
2024-07-03 14:19:48,405 - qm - INFO     - Octave "octave6" Health check passed, current temperature 57
2024-07-03 14:19:48,405 - qm - INFO     - Performing health check
2024-07-03 14:19:48,424 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con1. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,424 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con2. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,424 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con3. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,424 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con4. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,425 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con5. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,425 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con6. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,425 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con7. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,425 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con8. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,425 - qm - WARNING  - Health check warning: Inter-OPX connectivity issues in OPX: con9. Missing ports are: 12, 11, 10, 9. See QM-App for more info.
2024-07-03 14:19:48,425 - qm - INFO     - Health check passed
2024-07-03 14:19:50,190 - qm - INFO     - Sending program to QOP for compilation
2024-07-03 14:19:50,681 - qm - WARNING  - pulse 'drive(1000, 0.007, Gaussian(5))' used in play is not part of element 'driveD2' operations
2024-07-03 14:19:50,681 - qm - WARNING  - pulse 'drive(1000, 0.007, Gaussian(5))' used in play is not part of element 'driveD3' operations
2024-07-03 14:19:50,682 - qm - WARNING  - pulse 'drive(1000, 0.007, Gaussian(5))' used in play is not part of element 'driveD4' operations
2024-07-03 14:19:50,682 - qm - WARNING  - pulse 'drive(1000, 0.007, Gaussian(5))' used in play is not part of element 'driveD5' operations
2024-07-03 14:19:50,682 - qm - WARNING  - pulse 'readout(2000, 0.002, Rectangular())' used in measure is not part of element 'readoutD5' operations
2024-07-03 14:19:50,917 - qm - INFO     - Executing program

and here is a zip with all the output, including the report. test-qibocal-909.zip

Ok, the fits are weird, and I should check that's also the case with main, but I got no error...

alecandido commented 1 day ago

Ok, the fits are weird, and I should check that's also the case with main, but I got no error...

Ok, apparently they're weird in the same way also with main. But it would be nice if you could reproduce it (either the behavior I'm observing or the error).

andrea-pasquale commented 18 hours ago

test-qibocal-909.zip

I think that zip is empty @alecandido

alecandido commented 17 hours ago

I think that zip is empty @alecandido

Correct, it was empty, my bad. I replaced it in the same comment.

alecandido commented 17 hours ago

Steps to reproduce:

git clone git@github.com:alecandido/qrc
cd qrc/
git switch qibocal-909
git submodule init
git submodule update
poetry install --with dev
export QIBOLAB_PLATFORMS=$(realpath ./qibolab_platforms_qrc)
srun -p qw5q_platinum poetry run qq auto runcards/string-targets.yml -o var/test-qibocal-909

But this time I also failed with:

  File "/nfs/users/alessandro.candido/qrc/qibocal/src/qibocal/auto/operation.py", line 136, in __getitem__
    return self.data[qubit]
KeyError: ('D', '1')

I can now investigate!

alecandido commented 16 hours ago

The problem is happening during the fit. And I know what is causing it: https://github.com/qiboteam/qibocal/blob/7e57ee60575226a5a8b8049a9a72feb60e6ec23f/src/qibocal/auto/operation.py#L134-L135 i.e. while tuple and list are iterable, and int is not, a str is iterable as well.

In the process, I found out that, while the problem is occurring during the fit, and data have already been acquired, there are no data in the output folder, since the dump only happens at the end of Task.run().

This is very suboptimal, because in case of exceptions in the fit data are lost. I won't fix this immediately, to focus on closing this and #869. But I will try to refactor the Task right after, tackling #908 and this is issue as well (which I'm about to open).

alecandido commented 23 minutes ago

@andrea-pasquale now it seems to work, though the fits are still failing...

test-qibocal-909.zip https://github.com/alecandido/qrc/commit/06a734b2498f6c678efad0f9ac583bd8875e0e13