Skip to content

Commit

Permalink
refactor: Update qibocal to new platform layout
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Jan 26, 2024
1 parent 4cac2e4 commit 1faf3ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/qibocal/cli/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dataclasses import asdict

import yaml
from qibolab.serialize import dump_runcard
from qibolab.serialize import dump_platform

from ..auto.execute import Executor
from ..auto.history import add_timings_to_meta
Expand Down Expand Up @@ -39,7 +39,8 @@ def acquire(runcard, folder, force):
meta = generate_meta(backend, platform, path)
# dump platform
if backend.name == "qibolab":
dump_runcard(platform, path / PLATFORM)
(path / PLATFORM).mkdir(parents=True, exist_ok=True)
dump_platform(platform, path / PLATFORM)

# dump action runcard
(path / RUNCARD).write_text(yaml.safe_dump(asdict(runcard)))
Expand Down
8 changes: 5 additions & 3 deletions src/qibocal/cli/autocalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dataclasses import asdict

import yaml
from qibolab.serialize import dump_runcard
from qibolab.serialize import dump_platform

from ..auto.execute import Executor
from ..auto.history import add_timings_to_meta
Expand Down Expand Up @@ -41,7 +41,8 @@ def autocalibrate(runcard, folder, force, update):
meta = generate_meta(backend, platform, path)
# dump platform
if backend.name == "qibolab":
dump_runcard(platform, path / PLATFORM)
(path / PLATFORM).mkdir(parents=True, exist_ok=True)
dump_platform(platform, path / PLATFORM)

# dump action runcard
(path / RUNCARD).write_text(yaml.safe_dump(asdict(runcard)))
Expand Down Expand Up @@ -72,4 +73,5 @@ def autocalibrate(runcard, folder, force, update):

# dump updated runcard
if platform is not None:
dump_runcard(platform, path / UPDATED_PLATFORM)
(path / UPDATED_PLATFORM).mkdir(parents=True, exist_ok=True)
dump_platform(platform, path / UPDATED_PLATFORM)
4 changes: 2 additions & 2 deletions src/qibocal/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from qibocal.utils import allocate_qubits_pairs, allocate_single_qubits

RUNCARD = "runcard.yml"
UPDATED_PLATFORM = "new_platform.yml"
PLATFORM = "platform.yml"
UPDATED_PLATFORM = "new_platform"
PLATFORM = "platform"
META = "meta.json"


Expand Down

0 comments on commit 1faf3ce

Please sign in to comment.