iqm-station-control-client 3.2__py3-none-any.whl → 3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,12 @@ from packaging.version import Version, parse
29
29
  import requests
30
30
 
31
31
  from exa.common.data.setting_node import SettingNode
32
- from exa.common.errors.exa_error import RequestError
32
+ from exa.common.errors.server_errors import (
33
+ STATUS_CODE_TO_ERROR_MAPPING,
34
+ InternalServerError,
35
+ NotFoundError,
36
+ StationControlError,
37
+ )
33
38
  from exa.common.qcm_data.qcm_data_client import QCMDataClient
34
39
  from iqm.station_control.client.list_models import (
35
40
  DutFieldDataList,
@@ -159,6 +164,12 @@ class StationControlClient:
159
164
  response = self._send_request(requests.get, "configuration")
160
165
  return response.json()
161
166
 
167
+ @cache
168
+ def get_exa_configuration(self) -> str:
169
+ """Return the recommended EXA configuration from the server."""
170
+ response = self._send_request(requests.get, "exa/configuration")
171
+ return response.content.decode("utf-8")
172
+
162
173
  def get_or_create_software_version_set(self, software_version_set: SoftwareVersionSet) -> int:
163
174
  """Get software version set ID from the database, or create if it doesn't exist."""
164
175
  # FIXME: We don't have information if the object was created or fetched. Thus, server always responds 200 (OK).
@@ -180,8 +191,8 @@ class StationControlClient:
180
191
  """Get a raw chip design record matching the given chip label."""
181
192
  try:
182
193
  response = self._send_request(requests.get, f"chip-design-records/{dut_label}")
183
- except RequestError as err:
184
- if str(err).find("An error occurred on the server with the error code 404") >= 0 and self._qcm_data_client:
194
+ except StationControlError as err:
195
+ if isinstance(err, NotFoundError) and self._qcm_data_client:
185
196
  return self._qcm_data_client.get_chip_design_record(dut_label)
186
197
  raise err
187
198
  return response.json()
@@ -224,7 +235,7 @@ class StationControlClient:
224
235
  in monolithic mode or successful submission to the task queue in remote mode.
225
236
 
226
237
  Raises:
227
- RequestError if submitting a sweep failed.
238
+ ExaError if submitting a sweep failed.
228
239
 
229
240
  """
230
241
  data = serialize_sweep_task_request(sweep_definition, queue_name="sweeps")
@@ -247,7 +258,7 @@ class StationControlClient:
247
258
 
248
259
  def delete_sweep(self, sweep_id: uuid.UUID) -> None:
249
260
  """Delete sweep in the database."""
250
- self._send_request(requests.delete, f"sweeps/{sweep_id}/delete")
261
+ self._send_request(requests.delete, f"sweeps/{sweep_id}")
251
262
 
252
263
  def get_sweep_results(self, sweep_id: uuid.UUID) -> SweepResults:
253
264
  """Get N-dimensional sweep results from the database."""
@@ -644,7 +655,7 @@ class StationControlClient:
644
655
  def _poll_task(self, task_id: str) -> dict:
645
656
  task = self._send_request(requests.get, f"tasks/{task_id}").json()
646
657
  if task["task_status"] == "FAILURE":
647
- raise RequestError(f"Server-side error. Details: {task}")
658
+ raise InternalServerError(task)
648
659
  return task
649
660
 
650
661
  def _send_request(
@@ -675,9 +686,9 @@ class StationControlClient:
675
686
  error_message = response_json["detail"]
676
687
  except json.JSONDecodeError:
677
688
  error_message = response.text
678
- raise RequestError(
679
- f"An error occurred on the server with the error code {response.status_code}: {error_message}"
680
- )
689
+
690
+ error_class = STATUS_CODE_TO_ERROR_MAPPING[response.status_code]
691
+ raise error_class(error_message)
681
692
  return response
682
693
 
683
694
  def _check_api_versions(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-station-control-client
3
- Version: 3.2
3
+ Version: 3.4
4
4
  Summary: Python client for communicating with Station Control Service
5
5
  Author-email: IQM Finland Oy <info@meetiqm.com>
6
6
  License: Apache License
@@ -1,6 +1,6 @@
1
1
  iqm/station_control/client/__init__.py,sha256=BmBIBdZa10r-IWCFzZ1-0DG6GQKPIXqGXltfXop4ZeQ,942
2
2
  iqm/station_control/client/list_models.py,sha256=SjD0DbCrM9z1SSuGoQS83lyJmDLuMOatpJUoW8itW9s,2335
3
- iqm/station_control/client/station_control.py,sha256=pvSGWObxTs61Iyiv7pcl9SDLvKijkaZZYzJC8VoGIgo,33584
3
+ iqm/station_control/client/station_control.py,sha256=IvxsQUiSS_jov5UkvHlBcak3184ZBpx-KKNFFMpuwj8,33820
4
4
  iqm/station_control/client/utils.py,sha256=3VVLCXt6rcKNQc4HerlMxpxkRfTFMYCwOQHF2DS1OG8,1143
5
5
  iqm/station_control/client/serializers/__init__.py,sha256=8os3EGOtNTRFaviZdGwDyMt9GUpM3ZP7icPKAxOg1qg,1438
6
6
  iqm/station_control/client/serializers/channel_property_serializer.py,sha256=ChlX8B-blM5hjv3pUExHOd-vE3O_myPwILu36KZYYNU,7121
@@ -22,8 +22,8 @@ iqm/station_control/interface/models/run.py,sha256=m-iE3QMPQUOF7bsw8JCAM1Bd6bDVh
22
22
  iqm/station_control/interface/models/sequence.py,sha256=uOqMwF1x-vW6UHs2WnPD3PsuSgV3a8OTAsgn_4UENLw,2723
23
23
  iqm/station_control/interface/models/sweep.py,sha256=6SQ4Ty4_Rm1KTeR7YfrLmwyD-AnNE495LMxYu8dM4Ko,2947
24
24
  iqm/station_control/interface/models/type_aliases.py,sha256=3LB9viZVi8osavY5kKF8TH1crayG7-MLjgBqXDCqL2s,1018
25
- iqm_station_control_client-3.2.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
26
- iqm_station_control_client-3.2.dist-info/METADATA,sha256=TuwaCjnFL20R5QlwAgqpvBwwjoOPn8Jep4plUQZnsBo,13971
27
- iqm_station_control_client-3.2.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
28
- iqm_station_control_client-3.2.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
29
- iqm_station_control_client-3.2.dist-info/RECORD,,
25
+ iqm_station_control_client-3.4.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
26
+ iqm_station_control_client-3.4.dist-info/METADATA,sha256=fypBAAypV7BKCp55g-WflzENsu_FzuuRaw1-RpJfCCg,13971
27
+ iqm_station_control_client-3.4.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
28
+ iqm_station_control_client-3.4.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
29
+ iqm_station_control_client-3.4.dist-info/RECORD,,