From d1889301327fb9a7421ac28ade26f96177ff8719 Mon Sep 17 00:00:00 2001 From: Oliver <56551074+oliver-gordon@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:53:26 +0100 Subject: [PATCH] [FEATURE] emu fresnel access in SDK (#136) * emu fresnel access in SDK * changelog, version number --------- Co-authored-by: oliver.gordon --- CHANGELOG.md | 4 ++++ pasqal_cloud/_version.py | 2 +- pasqal_cloud/batch.py | 8 +++++++- pasqal_cloud/device/configuration/__init__.py | 2 ++ pasqal_cloud/device/configuration/emu_fresnel.py | 8 ++++++++ pasqal_cloud/device/emulator_types.py | 1 + tests/test_batch.py | 1 + 7 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 pasqal_cloud/device/configuration/emu_fresnel.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 20763a05..19d6990c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [0.12.1] - 2024-09-11 + +- Introduce EMU_FRESNEL device type + ## [0.12.0] - 2024-09-03 ### Breaking change diff --git a/pasqal_cloud/_version.py b/pasqal_cloud/_version.py index 3ec56342..1447bfdb 100644 --- a/pasqal_cloud/_version.py +++ b/pasqal_cloud/_version.py @@ -13,4 +13,4 @@ # limitations under the License. -__version__ = "0.12.0" +__version__ = "0.12.1" diff --git a/pasqal_cloud/batch.py b/pasqal_cloud/batch.py index b05111a2..1e4b164c 100644 --- a/pasqal_cloud/batch.py +++ b/pasqal_cloud/batch.py @@ -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, @@ -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( diff --git a/pasqal_cloud/device/configuration/__init__.py b/pasqal_cloud/device/configuration/__init__.py index 4d6c2415..8e0dffe3 100644 --- a/pasqal_cloud/device/configuration/__init__.py +++ b/pasqal_cloud/device/configuration/__init__.py @@ -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", ] diff --git a/pasqal_cloud/device/configuration/emu_fresnel.py b/pasqal_cloud/device/configuration/emu_fresnel.py new file mode 100644 index 00000000..9ee89d29 --- /dev/null +++ b/pasqal_cloud/device/configuration/emu_fresnel.py @@ -0,0 +1,8 @@ +from __future__ import annotations + +from dataclasses import dataclass + + +@dataclass +class EmuFresnelConfig: + """Configuration for the EMU_FRESNEL device type.""" diff --git a/pasqal_cloud/device/emulator_types.py b/pasqal_cloud/device/emulator_types.py index 13971f48..c67c10f0 100644 --- a/pasqal_cloud/device/emulator_types.py +++ b/pasqal_cloud/device/emulator_types.py @@ -4,3 +4,4 @@ class EmulatorType(StrEnum): EMU_FREE = "EMU_FREE" EMU_TN = "EMU_TN" + EMU_FRESNEL = "EMU_FRESNEL" diff --git a/tests/test_batch.py b/tests/test_batch.py index 348f2b00..93b33f82 100644 --- a/tests/test_batch.py +++ b/tests/test_batch.py @@ -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(),