From f9d4cfa7dac0509024670946d8162d2098bd82df Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 12 Jan 2024 10:27:39 +0100 Subject: [PATCH] fix: made provider retrieval more resilient --- planqk/qiskit/client/backend_dtos.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/planqk/qiskit/client/backend_dtos.py b/planqk/qiskit/client/backend_dtos.py index 8f9a539..2549e85 100644 --- a/planqk/qiskit/client/backend_dtos.py +++ b/planqk/qiskit/client/backend_dtos.py @@ -18,6 +18,14 @@ class PROVIDER(Enum): IBM_CLOUD = "IBM_CLOUD" TSYSTEMS = "TSYSTEMS" QRYD = "QRYD" + UNKNOWN = "UNKNOWN" + + @classmethod + def from_str(cls, provider_str): + try: + return PROVIDER(provider_str) + except KeyError: + return cls.UNKNOWN class TYPE(Enum):