qiboteam / qibocal

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

Drop `Task` #908

Open alecandido opened 3 months ago

alecandido commented 3 months ago

While it makes sense to keep the distinction between a Task to be executed, and a Completed one, there is essentially no motivation to keep the Task specification separate.

So, I will follow up on https://github.com/qiboteam/qibocal/pull/801, and merge Action into the Task object, that already contains only that and the resolved Routine.

alecandido commented 3 months ago

The original idea was correct, but the object that is not useful is the Task not Action, since we need to keep recording and validating the input parameters.

The only thing we need from Task is Task.run, which could be just:

def run(
    routine: Routine,
    parameters: Parameters,
    platform: Platform,
    targets: Targets,
    mode: ExecutionMode,
):
    ...

We could even move this function to qibocal.auto.operation (which would make sense, since it defines how the pieces above are used), and Completed to qibocal.auto.history, getting rid of qibocal.auto.task (to reduce the amount of intertwined pieces).