Skip to content

Commit

Permalink
emu fresnel access in SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver.gordon committed Sep 11, 2024
1 parent 1ee3c87 commit ed3c3a2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pasqal_cloud/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

from pasqal_cloud.client import Client
from pasqal_cloud.device import EmulatorType
from pasqal_cloud.device.configuration import BaseConfig, EmuFreeConfig, EmuTNConfig
from pasqal_cloud.device.configuration import (
BaseConfig,
EmuFreeConfig,
EmuTNConfig,
)
from pasqal_cloud.errors import (
BatchCancellingError,
BatchClosingError,
Expand Down Expand Up @@ -133,6 +137,8 @@ def _load_configuration(
conf_class = EmuTNConfig
elif info.data["device_type"] == EmulatorType.EMU_FREE.value:
conf_class = EmuFreeConfig
elif info.data["device_type"] == EmulatorType.EMU_FRESNEL.value:
return None
return conf_class.from_dict(configuration)

def add_jobs(
Expand Down
2 changes: 2 additions & 0 deletions pasqal_cloud/device/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
InvalidConfiguration,
)
from pasqal_cloud.device.configuration.emu_free import EmuFreeConfig
from pasqal_cloud.device.configuration.emu_fresnel import EmuFresnelConfig
from pasqal_cloud.device.configuration.emu_tn import EmuTNConfig

__all__ = [
"BaseConfig",
"EmuFreeConfig",
"EmuFresnelConfig",
"EmuTNConfig",
"InvalidConfiguration",
]
8 changes: 8 additions & 0 deletions pasqal_cloud/device/configuration/emu_fresnel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

from dataclasses import dataclass


@dataclass
class EmuFresnelConfig:
"""Configuration for the EMU_FRESNEL device type."""
1 change: 1 addition & 0 deletions pasqal_cloud/device/emulator_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
class EmulatorType(StrEnum):
EMU_FREE = "EMU_FREE"
EMU_TN = "EMU_TN"
EMU_FRESNEL = "EMU_FRESNEL"
1 change: 1 addition & 0 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ def test_cancel_batch_sdk_error(
EmuFreeConfig(),
EmuFreeConfig(extra_config={"dt": 10.0, "precision": "normal"}),
),
(EmulatorType.EMU_FRESNEL, None, None),
(
"SomethingElse",
BaseConfig(),
Expand Down

0 comments on commit ed3c3a2

Please sign in to comment.