qubitclient 0.0.0.1__py3-none-any.whl → 0.0.3.0__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.
Potentially problematic release.
This version of qubitclient might be problematic. Click here for more details.
- qubitclient/__init__.py +6 -1
- qubitclient/nnscope/nnscope.py +51 -0
- qubitclient/{QubitSeg.py → nnscope/nnscope_api/QubitSeg.py} +7 -7
- qubitclient/nnscope/nnscope_api/curve/__init__.py +0 -0
- qubitclient/nnscope/nnscope_api/curve/curve_type.py +15 -0
- qubitclient/nnscope/task.py +130 -0
- qubitclient/nnscope/utils/data_convert.py +114 -0
- qubitclient/nnscope/utils/data_parser.py +41 -0
- qubitclient/nnscope/utils/request_tool.py +41 -0
- qubitclient/nnscope/utils/result_parser.py +55 -0
- qubitclient/scope/scope.py +51 -0
- qubitclient/scope/scope_api/__init__.py +8 -0
- qubitclient/scope/scope_api/api/__init__.py +1 -0
- qubitclient/scope/scope_api/api/defined_tasks/__init__.py +1 -0
- qubitclient/scope/scope_api/api/defined_tasks/get_task_result_api_v1_tasks_demo_pk_get.py +155 -0
- qubitclient/scope/scope_api/api/defined_tasks/get_task_result_api_v1_tasks_scope_pk_get.py +155 -0
- qubitclient/scope/scope_api/api/defined_tasks/optpipulse_api_v1_tasks_scope_optpipulse_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/rabi_api_v1_tasks_scope_rabi_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/rabicos_api_v1_tasks_scope_rabicospeak_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/s21peak_api_v1_tasks_scope_s21peak_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/s21vflux_api_v1_tasks_scope_s21vflux_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/singleshot_api_v1_tasks_scope_singleshot_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/spectrum2d_api_v1_tasks_scope_spectrum2d_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/spectrum_api_v1_tasks_scope_spectrum_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/t1fit_api_v1_tasks_scope_t1fit_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/t1fit_api_v1_tasks_scope_t2fit_post.py +218 -0
- qubitclient/scope/scope_api/client.py +268 -0
- qubitclient/scope/scope_api/errors.py +16 -0
- qubitclient/scope/scope_api/models/__init__.py +29 -0
- qubitclient/scope/scope_api/models/body_optpipulse_api_v1_tasks_scope_optpipulse_post.py +83 -0
- qubitclient/scope/scope_api/models/body_rabi_api_v1_tasks_scope_rabi_post.py +83 -0
- qubitclient/scope/scope_api/models/body_rabicos_api_v1_tasks_scope_rabicospeak_post.py +83 -0
- qubitclient/scope/scope_api/models/body_s21_peak_api_v1_tasks_scope_s21_peak_post.py +83 -0
- qubitclient/scope/scope_api/models/body_s21_vflux_api_v1_tasks_scope_s21_vflux_post.py +83 -0
- qubitclient/scope/scope_api/models/body_singleshot_api_v1_tasks_scope_singleshot_post.py +83 -0
- qubitclient/scope/scope_api/models/body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post.py +83 -0
- qubitclient/scope/scope_api/models/body_spectrum_api_v1_tasks_scope_spectrum_post.py +83 -0
- qubitclient/scope/scope_api/models/body_t1_fit_api_v1_tasks_scope_t1_fit_post.py +83 -0
- qubitclient/scope/scope_api/models/body_t1_fit_api_v1_tasks_scope_t2_fit_post.py +83 -0
- qubitclient/scope/scope_api/models/http_validation_error.py +75 -0
- qubitclient/scope/scope_api/models/validation_error.py +88 -0
- qubitclient/scope/scope_api/types.py +54 -0
- qubitclient/scope/task.py +147 -0
- qubitclient/scope/utils/__init__.py +0 -0
- qubitclient/scope/utils/data_parser.py +20 -0
- qubitclient-0.0.3.0.dist-info/METADATA +112 -0
- qubitclient-0.0.3.0.dist-info/RECORD +51 -0
- qubitclient-0.0.0.1.dist-info/METADATA +0 -35
- qubitclient-0.0.0.1.dist-info/RECORD +0 -8
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/WHEEL +0 -0
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/licenses/LICENSE +0 -0
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/top_level.txt +0 -0
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.body_s21_vflux_api_v1_tasks_scope_s21_vflux_post import BodyS21VfluxApiV1TasksScopeS21VfluxPost
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: BodyS21VfluxApiV1TasksScopeS21VfluxPost,
|
|
16
|
+
type_: Union[Unset, str] = "s21vflux",
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
params["type"] = type_
|
|
23
|
+
|
|
24
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
25
|
+
|
|
26
|
+
_kwargs: dict[str, Any] = {
|
|
27
|
+
"method": "post",
|
|
28
|
+
"url": "/api/v1/tasks/scope/s21vflux",
|
|
29
|
+
"params": params,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_kwargs["files"] = body.to_multipart()
|
|
33
|
+
|
|
34
|
+
_kwargs["headers"] = headers
|
|
35
|
+
return _kwargs
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _parse_response(
|
|
39
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
40
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
41
|
+
if response.status_code == 200:
|
|
42
|
+
response_200 = response.json()
|
|
43
|
+
return response_200
|
|
44
|
+
|
|
45
|
+
if response.status_code == 422:
|
|
46
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_422
|
|
49
|
+
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
58
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
*,
|
|
69
|
+
client: Union[AuthenticatedClient, Client],
|
|
70
|
+
body: BodyS21VfluxApiV1TasksScopeS21VfluxPost,
|
|
71
|
+
type_: Union[Unset, str] = "s21vflux",
|
|
72
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
73
|
+
r"""S21Vflux
|
|
74
|
+
|
|
75
|
+
s21与flux二维曲线监测接口
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
files: 上传的.npy文件列表
|
|
79
|
+
type: 任务类型,默认为\"s21vflux\"
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
dict: 包含检测结果的字典
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
type_ (Union[Unset, str]): 任务类型 Default: 's21vflux'.
|
|
86
|
+
body (BodyS21VfluxApiV1TasksScopeS21VfluxPost):
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Response[Union[Any, HTTPValidationError]]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
kwargs = _get_kwargs(
|
|
97
|
+
body=body,
|
|
98
|
+
type_=type_,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def sync(
|
|
109
|
+
*,
|
|
110
|
+
client: Union[AuthenticatedClient, Client],
|
|
111
|
+
body: BodyS21VfluxApiV1TasksScopeS21VfluxPost,
|
|
112
|
+
type_: Union[Unset, str] = "s21vflux",
|
|
113
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
114
|
+
r"""S21Vflux
|
|
115
|
+
|
|
116
|
+
s21与flux二维曲线监测接口
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
files: 上传的.npy文件列表
|
|
120
|
+
type: 任务类型,默认为\"s21vflux\"
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
dict: 包含检测结果的字典
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
type_ (Union[Unset, str]): 任务类型 Default: 's21vflux'.
|
|
127
|
+
body (BodyS21VfluxApiV1TasksScopeS21VfluxPost):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Union[Any, HTTPValidationError]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
return sync_detailed(
|
|
138
|
+
client=client,
|
|
139
|
+
body=body,
|
|
140
|
+
type_=type_,
|
|
141
|
+
).parsed
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
async def asyncio_detailed(
|
|
145
|
+
*,
|
|
146
|
+
client: Union[AuthenticatedClient, Client],
|
|
147
|
+
body: BodyS21VfluxApiV1TasksScopeS21VfluxPost,
|
|
148
|
+
type_: Union[Unset, str] = "s21vflux",
|
|
149
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
150
|
+
r"""S21Vflux
|
|
151
|
+
|
|
152
|
+
s21与flux二维曲线监测接口
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
files: 上传的.npy文件列表
|
|
156
|
+
type: 任务类型,默认为\"s21vflux\"
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
dict: 包含检测结果的字典
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
type_ (Union[Unset, str]): 任务类型 Default: 's21vflux'.
|
|
163
|
+
body (BodyS21VfluxApiV1TasksScopeS21VfluxPost):
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
167
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Response[Union[Any, HTTPValidationError]]
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
kwargs = _get_kwargs(
|
|
174
|
+
body=body,
|
|
175
|
+
type_=type_,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
179
|
+
|
|
180
|
+
return _build_response(client=client, response=response)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
async def asyncio(
|
|
184
|
+
*,
|
|
185
|
+
client: Union[AuthenticatedClient, Client],
|
|
186
|
+
body: BodyS21VfluxApiV1TasksScopeS21VfluxPost,
|
|
187
|
+
type_: Union[Unset, str] = "s21vflux",
|
|
188
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
189
|
+
r"""S21Vflux
|
|
190
|
+
|
|
191
|
+
s21与flux二维曲线监测接口
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
files: 上传的.npy文件列表
|
|
195
|
+
type: 任务类型,默认为\"s21vflux\"
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
dict: 包含检测结果的字典
|
|
199
|
+
|
|
200
|
+
Args:
|
|
201
|
+
type_ (Union[Unset, str]): 任务类型 Default: 's21vflux'.
|
|
202
|
+
body (BodyS21VfluxApiV1TasksScopeS21VfluxPost):
|
|
203
|
+
|
|
204
|
+
Raises:
|
|
205
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
206
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
207
|
+
|
|
208
|
+
Returns:
|
|
209
|
+
Union[Any, HTTPValidationError]
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
await asyncio_detailed(
|
|
214
|
+
client=client,
|
|
215
|
+
body=body,
|
|
216
|
+
type_=type_,
|
|
217
|
+
)
|
|
218
|
+
).parsed
|
qubitclient/scope/scope_api/api/defined_tasks/singleshot_api_v1_tasks_scope_singleshot_post.py
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.body_singleshot_api_v1_tasks_scope_singleshot_post import BodySingleshotApiV1TasksScopeSingleshotPost
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: BodySingleshotApiV1TasksScopeSingleshotPost,
|
|
16
|
+
type_: Union[Unset, str] = "singleshot",
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
params["type"] = type_
|
|
23
|
+
|
|
24
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
25
|
+
|
|
26
|
+
_kwargs: dict[str, Any] = {
|
|
27
|
+
"method": "post",
|
|
28
|
+
"url": "/api/v1/tasks/scope/singleshot",
|
|
29
|
+
"params": params,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_kwargs["files"] = body.to_multipart()
|
|
33
|
+
|
|
34
|
+
_kwargs["headers"] = headers
|
|
35
|
+
return _kwargs
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _parse_response(
|
|
39
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
40
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
41
|
+
if response.status_code == 200:
|
|
42
|
+
response_200 = response.json()
|
|
43
|
+
return response_200
|
|
44
|
+
|
|
45
|
+
if response.status_code == 422:
|
|
46
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_422
|
|
49
|
+
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
58
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
*,
|
|
69
|
+
client: Union[AuthenticatedClient, Client],
|
|
70
|
+
body: BodySingleshotApiV1TasksScopeSingleshotPost,
|
|
71
|
+
type_: Union[Unset, str] = "singleshot",
|
|
72
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
73
|
+
r"""Singleshot
|
|
74
|
+
|
|
75
|
+
信号分类接口
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
files: 上传的.npy文件列表
|
|
79
|
+
type: 任务类型,默认为\"s21peak\"
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
dict: 包含检测结果的字典
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'singleshot'.
|
|
86
|
+
body (BodySingleshotApiV1TasksScopeSingleshotPost):
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Response[Union[Any, HTTPValidationError]]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
kwargs = _get_kwargs(
|
|
97
|
+
body=body,
|
|
98
|
+
type_=type_,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def sync(
|
|
109
|
+
*,
|
|
110
|
+
client: Union[AuthenticatedClient, Client],
|
|
111
|
+
body: BodySingleshotApiV1TasksScopeSingleshotPost,
|
|
112
|
+
type_: Union[Unset, str] = "singleshot",
|
|
113
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
114
|
+
r"""Singleshot
|
|
115
|
+
|
|
116
|
+
信号分类接口
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
files: 上传的.npy文件列表
|
|
120
|
+
type: 任务类型,默认为\"s21peak\"
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
dict: 包含检测结果的字典
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'singleshot'.
|
|
127
|
+
body (BodySingleshotApiV1TasksScopeSingleshotPost):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Union[Any, HTTPValidationError]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
return sync_detailed(
|
|
138
|
+
client=client,
|
|
139
|
+
body=body,
|
|
140
|
+
type_=type_,
|
|
141
|
+
).parsed
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
async def asyncio_detailed(
|
|
145
|
+
*,
|
|
146
|
+
client: Union[AuthenticatedClient, Client],
|
|
147
|
+
body: BodySingleshotApiV1TasksScopeSingleshotPost,
|
|
148
|
+
type_: Union[Unset, str] = "singleshot",
|
|
149
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
150
|
+
r"""Singleshot
|
|
151
|
+
|
|
152
|
+
信号分类接口
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
files: 上传的.npy文件列表
|
|
156
|
+
type: 任务类型,默认为\"s21peak\"
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
dict: 包含检测结果的字典
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'singleshot'.
|
|
163
|
+
body (BodySingleshotApiV1TasksScopeSingleshotPost):
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
167
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Response[Union[Any, HTTPValidationError]]
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
kwargs = _get_kwargs(
|
|
174
|
+
body=body,
|
|
175
|
+
type_=type_,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
179
|
+
|
|
180
|
+
return _build_response(client=client, response=response)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
async def asyncio(
|
|
184
|
+
*,
|
|
185
|
+
client: Union[AuthenticatedClient, Client],
|
|
186
|
+
body: BodySingleshotApiV1TasksScopeSingleshotPost,
|
|
187
|
+
type_: Union[Unset, str] = "singleshot",
|
|
188
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
189
|
+
r"""Singleshot
|
|
190
|
+
|
|
191
|
+
信号分类接口
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
files: 上传的.npy文件列表
|
|
195
|
+
type: 任务类型,默认为\"s21peak\"
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
dict: 包含检测结果的字典
|
|
199
|
+
|
|
200
|
+
Args:
|
|
201
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'singleshot'.
|
|
202
|
+
body (BodySingleshotApiV1TasksScopeSingleshotPost):
|
|
203
|
+
|
|
204
|
+
Raises:
|
|
205
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
206
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
207
|
+
|
|
208
|
+
Returns:
|
|
209
|
+
Union[Any, HTTPValidationError]
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
await asyncio_detailed(
|
|
214
|
+
client=client,
|
|
215
|
+
body=body,
|
|
216
|
+
type_=type_,
|
|
217
|
+
)
|
|
218
|
+
).parsed
|
qubitclient/scope/scope_api/api/defined_tasks/spectrum2d_api_v1_tasks_scope_spectrum2d_post.py
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post import BodySpectrum2DApiV1TasksScopeSpectrum2DPost
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: BodySpectrum2DApiV1TasksScopeSpectrum2DPost,
|
|
16
|
+
type_: Union[Unset, str] = "spectrum2d",
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
params["type"] = type_
|
|
23
|
+
|
|
24
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
25
|
+
|
|
26
|
+
_kwargs: dict[str, Any] = {
|
|
27
|
+
"method": "post",
|
|
28
|
+
"url": "/api/v1/tasks/scope/spectrum2d",
|
|
29
|
+
"params": params,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_kwargs["files"] = body.to_multipart()
|
|
33
|
+
|
|
34
|
+
_kwargs["headers"] = headers
|
|
35
|
+
return _kwargs
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _parse_response(
|
|
39
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
40
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
41
|
+
if response.status_code == 200:
|
|
42
|
+
response_200 = response.json()
|
|
43
|
+
return response_200
|
|
44
|
+
|
|
45
|
+
if response.status_code == 422:
|
|
46
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_422
|
|
49
|
+
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
58
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
*,
|
|
69
|
+
client: Union[AuthenticatedClient, Client],
|
|
70
|
+
body: BodySpectrum2DApiV1TasksScopeSpectrum2DPost,
|
|
71
|
+
type_: Union[Unset, str] = "spectrum2d",
|
|
72
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
73
|
+
r"""Spectrum2D
|
|
74
|
+
|
|
75
|
+
spectrum2d
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
files: 上传的.npy文件列表
|
|
79
|
+
type: 任务类型,默认为\"spectrum2d\"
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
dict: 包含检测结果的字典
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'spectrum2d'.
|
|
86
|
+
body (BodySpectrum2DApiV1TasksScopeSpectrum2DPost):
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Response[Union[Any, HTTPValidationError]]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
kwargs = _get_kwargs(
|
|
97
|
+
body=body,
|
|
98
|
+
type_=type_,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def sync(
|
|
109
|
+
*,
|
|
110
|
+
client: Union[AuthenticatedClient, Client],
|
|
111
|
+
body: BodySpectrum2DApiV1TasksScopeSpectrum2DPost,
|
|
112
|
+
type_: Union[Unset, str] = "spectrum2d",
|
|
113
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
114
|
+
r"""Spectrum2D
|
|
115
|
+
|
|
116
|
+
spectrum2d
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
files: 上传的.npy文件列表
|
|
120
|
+
type: 任务类型,默认为\"spectrum2d\"
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
dict: 包含检测结果的字典
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'spectrum2d'.
|
|
127
|
+
body (BodySpectrum2DApiV1TasksScopeSpectrum2DPost):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Union[Any, HTTPValidationError]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
return sync_detailed(
|
|
138
|
+
client=client,
|
|
139
|
+
body=body,
|
|
140
|
+
type_=type_,
|
|
141
|
+
).parsed
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
async def asyncio_detailed(
|
|
145
|
+
*,
|
|
146
|
+
client: Union[AuthenticatedClient, Client],
|
|
147
|
+
body: BodySpectrum2DApiV1TasksScopeSpectrum2DPost,
|
|
148
|
+
type_: Union[Unset, str] = "spectrum2d",
|
|
149
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
150
|
+
r"""Spectrum2D
|
|
151
|
+
|
|
152
|
+
spectrum2d
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
files: 上传的.npy文件列表
|
|
156
|
+
type: 任务类型,默认为\"spectrum2d\"
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
dict: 包含检测结果的字典
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'spectrum2d'.
|
|
163
|
+
body (BodySpectrum2DApiV1TasksScopeSpectrum2DPost):
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
167
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Response[Union[Any, HTTPValidationError]]
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
kwargs = _get_kwargs(
|
|
174
|
+
body=body,
|
|
175
|
+
type_=type_,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
179
|
+
|
|
180
|
+
return _build_response(client=client, response=response)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
async def asyncio(
|
|
184
|
+
*,
|
|
185
|
+
client: Union[AuthenticatedClient, Client],
|
|
186
|
+
body: BodySpectrum2DApiV1TasksScopeSpectrum2DPost,
|
|
187
|
+
type_: Union[Unset, str] = "spectrum2d",
|
|
188
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
189
|
+
r"""Spectrum2D
|
|
190
|
+
|
|
191
|
+
spectrum2d
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
files: 上传的.npy文件列表
|
|
195
|
+
type: 任务类型,默认为\"spectrum2d\"
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
dict: 包含检测结果的字典
|
|
199
|
+
|
|
200
|
+
Args:
|
|
201
|
+
type_ (Union[Unset, str]): 任务类型 Default: 'spectrum2d'.
|
|
202
|
+
body (BodySpectrum2DApiV1TasksScopeSpectrum2DPost):
|
|
203
|
+
|
|
204
|
+
Raises:
|
|
205
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
206
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
207
|
+
|
|
208
|
+
Returns:
|
|
209
|
+
Union[Any, HTTPValidationError]
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
await asyncio_detailed(
|
|
214
|
+
client=client,
|
|
215
|
+
body=body,
|
|
216
|
+
type_=type_,
|
|
217
|
+
)
|
|
218
|
+
).parsed
|