@@ -42,7 +42,6 @@ def __init__(
42
42
instance : Optional [str ] = None ,
43
43
proxies : Optional [ProxyConfiguration ] = None ,
44
44
verify : Optional [bool ] = True ,
45
- channel_strategy : Optional [str ] = None ,
46
45
):
47
46
"""Account constructor.
48
47
@@ -53,15 +52,13 @@ def __init__(
53
52
instance: Service instance to use.
54
53
proxies: Proxy configuration.
55
54
verify: Whether to verify server's TLS certificate.
56
- channel_strategy: Error mitigation strategy.
57
55
"""
58
56
self .channel : str = None
59
57
self .url : str = None
60
58
self .token = token
61
59
self .instance = instance
62
60
self .proxies = proxies
63
61
self .verify = verify
64
- self .channel_strategy = channel_strategy
65
62
self .private_endpoint : bool = False
66
63
67
64
def to_saved_format (self ) -> dict :
@@ -81,7 +78,6 @@ def from_saved_format(cls, data: dict) -> "Account":
81
78
token = data .get ("token" )
82
79
instance = data .get ("instance" )
83
80
verify = data .get ("verify" , True )
84
- channel_strategy = data .get ("channel_strategy" )
85
81
private_endpoint = data .get ("private_endpoint" , False )
86
82
return cls .create_account (
87
83
channel = channel ,
@@ -90,7 +86,6 @@ def from_saved_format(cls, data: dict) -> "Account":
90
86
instance = instance ,
91
87
proxies = proxies ,
92
88
verify = verify ,
93
- channel_strategy = channel_strategy ,
94
89
private_endpoint = private_endpoint ,
95
90
)
96
91
@@ -103,7 +98,6 @@ def create_account(
103
98
instance : Optional [str ] = None ,
104
99
proxies : Optional [ProxyConfiguration ] = None ,
105
100
verify : Optional [bool ] = True ,
106
- channel_strategy : Optional [str ] = None ,
107
101
private_endpoint : Optional [bool ] = False ,
108
102
) -> "Account" :
109
103
"""Creates an account for a specific channel."""
@@ -114,7 +108,6 @@ def create_account(
114
108
instance = instance ,
115
109
proxies = proxies ,
116
110
verify = verify ,
117
- channel_strategy = channel_strategy ,
118
111
)
119
112
elif channel == "ibm_cloud" :
120
113
return CloudAccount (
@@ -123,7 +116,6 @@ def create_account(
123
116
instance = instance ,
124
117
proxies = proxies ,
125
118
verify = verify ,
126
- channel_strategy = channel_strategy ,
127
119
private_endpoint = private_endpoint ,
128
120
)
129
121
else :
@@ -167,20 +159,8 @@ def validate(self) -> "Account":
167
159
self ._assert_valid_url (self .url )
168
160
self ._assert_valid_instance (self .instance )
169
161
self ._assert_valid_proxies (self .proxies )
170
- self ._assert_valid_channel_strategy (self .channel_strategy )
171
162
return self
172
163
173
- @staticmethod
174
- def _assert_valid_channel_strategy (channel_strategy : str ) -> None :
175
- """Assert that the channel strategy is valid."""
176
- # add more strategies as they are implemented
177
- strategies = ["q-ctrl" , "default" ]
178
- if channel_strategy and channel_strategy not in strategies :
179
- raise InvalidAccountError (
180
- f"Invalid `channel_strategy` value. Expected one of "
181
- f"{ strategies } , got '{ channel_strategy } '."
182
- )
183
-
184
164
@staticmethod
185
165
def _assert_valid_channel (channel : ChannelType ) -> None :
186
166
"""Assert that the channel parameter is valid."""
@@ -229,7 +209,6 @@ def __init__(
229
209
instance : Optional [str ] = None ,
230
210
proxies : Optional [ProxyConfiguration ] = None ,
231
211
verify : Optional [bool ] = True ,
232
- channel_strategy : Optional [str ] = None ,
233
212
):
234
213
"""Account constructor.
235
214
@@ -239,9 +218,8 @@ def __init__(
239
218
instance: Service instance to use.
240
219
proxies: Proxy configuration.
241
220
verify: Whether to verify server's TLS certificate.
242
- channel_strategy: Error mitigation strategy.
243
221
"""
244
- super ().__init__ (token , instance , proxies , verify , channel_strategy )
222
+ super ().__init__ (token , instance , proxies , verify )
245
223
resolved_url = url or IBM_QUANTUM_API_URL
246
224
self .channel = "ibm_quantum"
247
225
self .url = resolved_url
@@ -272,7 +250,6 @@ def __init__(
272
250
instance : Optional [str ] = None ,
273
251
proxies : Optional [ProxyConfiguration ] = None ,
274
252
verify : Optional [bool ] = True ,
275
- channel_strategy : Optional [str ] = None ,
276
253
private_endpoint : Optional [bool ] = False ,
277
254
):
278
255
"""Account constructor.
@@ -283,10 +260,9 @@ def __init__(
283
260
instance: Service instance to use.
284
261
proxies: Proxy configuration.
285
262
verify: Whether to verify server's TLS certificate.
286
- channel_strategy: Error mitigation strategy.
287
263
private_endpoint: Connect to private API URL.
288
264
"""
289
- super ().__init__ (token , instance , proxies , verify , channel_strategy )
265
+ super ().__init__ (token , instance , proxies , verify )
290
266
resolved_url = url or IBM_CLOUD_API_URL
291
267
self .channel = "ibm_cloud"
292
268
self .url = resolved_url
0 commit comments