iqm-station-control-client 3.3__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,
@@ -186,8 +191,8 @@ class StationControlClient:
186
191
  """Get a raw chip design record matching the given chip label."""
187
192
  try:
188
193
  response = self._send_request(requests.get, f"chip-design-records/{dut_label}")
189
- except RequestError as err:
190
- 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:
191
196
  return self._qcm_data_client.get_chip_design_record(dut_label)
192
197
  raise err
193
198
  return response.json()
@@ -230,7 +235,7 @@ class StationControlClient:
230
235
  in monolithic mode or successful submission to the task queue in remote mode.
231
236
 
232
237
  Raises:
233
- RequestError if submitting a sweep failed.
238
+ ExaError if submitting a sweep failed.
234
239
 
235
240
  """
236
241
  data = serialize_sweep_task_request(sweep_definition, queue_name="sweeps")
@@ -253,7 +258,7 @@ class StationControlClient:
253
258
 
254
259
  def delete_sweep(self, sweep_id: uuid.UUID) -> None:
255
260
  """Delete sweep in the database."""
256
- self._send_request(requests.delete, f"sweeps/{sweep_id}/delete")
261
+ self._send_request(requests.delete, f"sweeps/{sweep_id}")
257
262
 
258
263
  def get_sweep_results(self, sweep_id: uuid.UUID) -> SweepResults:
259
264
  """Get N-dimensional sweep results from the database."""
@@ -650,7 +655,7 @@ class StationControlClient:
650
655
  def _poll_task(self, task_id: str) -> dict:
651
656
  task = self._send_request(requests.get, f"tasks/{task_id}").json()
652
657
  if task["task_status"] == "FAILURE":
653
- raise RequestError(f"Server-side error. Details: {task}")
658
+ raise InternalServerError(task)
654
659
  return task
655
660
 
656
661
  def _send_request(
@@ -681,9 +686,9 @@ class StationControlClient:
681
686
  error_message = response_json["detail"]
682
687
  except json.JSONDecodeError:
683
688
  error_message = response.text
684
- raise RequestError(
685
- f"An error occurred on the server with the error code {response.status_code}: {error_message}"
686
- )
689
+
690
+ error_class = STATUS_CODE_TO_ERROR_MAPPING[response.status_code]
691
+ raise error_class(error_message)
687
692
  return response
688
693
 
689
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.3
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=ib8tifvJ6D-3xpFpcYhdgIq97osBTSe01WSrzxqD8nU,33833
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.3.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
26
- iqm_station_control_client-3.3.dist-info/METADATA,sha256=pgUVLim60iT50RXLdp48SU6K0TWOkNRRi8-pzDP69WI,13971
27
- iqm_station_control_client-3.3.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
28
- iqm_station_control_client-3.3.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
29
- iqm_station_control_client-3.3.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,,