Skip to content

Commit

Permalink
refactor: PLATFORM_FOLDER -> PLATFORM_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Feb 13, 2024
1 parent 356e742 commit 4e6764b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/qibocal/auto/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"""A number bigger than whatever will be manually typed. But not so insanely big not to fit in a native integer."""
TaskId = tuple[Id, int]
"""Unique identifier for executed tasks."""
PLATFORM_FOLDER = "platform"
PLATFORM_DIR = "platform"
"""Folder where platform will be dumped."""


Expand Down Expand Up @@ -240,8 +240,8 @@ def update_platform(self, platform: Platform, update: bool):
if self.task.update and update:
for qubit in self.task.qubits:
self.task.operation.update(self.results, platform, qubit)
(self.datapath / PLATFORM_FOLDER).mkdir(parents=True, exist_ok=True)
dump_platform(platform, self.datapath / PLATFORM_FOLDER)
(self.datapath / PLATFORM_DIR).mkdir(parents=True, exist_ok=True)
dump_platform(platform, self.datapath / PLATFORM_DIR)

def validate(self) -> tuple[Optional[TaskId], Optional[dict]]:
"""Check status of completed and handle Failure using handler."""
Expand Down
6 changes: 3 additions & 3 deletions tests/test_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from click.testing import CliRunner
from qibolab import create_platform

from qibocal.auto.task import PLATFORM_FOLDER
from qibocal.auto.task import PLATFORM_DIR
from qibocal.cli import utils
from qibocal.cli._base import command
from qibocal.protocols.characterization.rabi.amplitude import RabiAmplitudeData
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_auto_command(runcard, update, platform, backend, tmp_path):
assert results.exit_code == 0
if update == "--update":
assert (tmp_path / utils.UPDATED_PLATFORM).is_dir()
assert (tmp_path / "data" / f"{protocol}_0" / PLATFORM_FOLDER).is_dir()
assert (tmp_path / "data" / f"{protocol}_0" / PLATFORM_DIR).is_dir()


@pytest.mark.parametrize("platform", ["dummy"])
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_fit_command(runcard, update, tmp_path):

if update == "--update":
assert (tmp_path / utils.UPDATED_PLATFORM).is_dir()
assert (tmp_path / "data" / f"{protocol}_0" / PLATFORM_FOLDER).is_dir()
assert (tmp_path / "data" / f"{protocol}_0" / PLATFORM_DIR).is_dir()

# generate report with fit and plot
results_plot = runner.invoke(command, ["report", str(tmp_path)])
Expand Down

0 comments on commit 4e6764b

Please sign in to comment.