|
20 | 20 | from ...types.parameter import Parameter |
21 | 21 | from ...types.optimize_netlist_response import OptimizeNetlistResponse |
22 | 22 | from ...types.verify_circuit_code_response import VerifyCircuitCodeResponse |
| 23 | +from ...types.optimize_placement_body_response import OptimizePlacementBodyResponse |
23 | 24 | from ...core.client_wrapper import AsyncClientWrapper |
24 | 25 |
|
25 | 26 | # this is used as the default value for optional parameters |
@@ -602,6 +603,79 @@ def verify( |
602 | 603 | raise ApiError(status_code=_response.status_code, body=_response.text) |
603 | 604 | raise ApiError(status_code=_response.status_code, body=_response_json) |
604 | 605 |
|
| 606 | + def placementoptimize( |
| 607 | + self, |
| 608 | + *, |
| 609 | + netlist: typing.Dict[str, typing.Optional[typing.Any]], |
| 610 | + method: str, |
| 611 | + request_options: typing.Optional[RequestOptions] = None, |
| 612 | + ) -> OptimizePlacementBodyResponse: |
| 613 | + """ |
| 614 | + Optimizes the placement of a circuit |
| 615 | +
|
| 616 | + Parameters |
| 617 | + ---------- |
| 618 | + netlist : typing.Dict[str, typing.Optional[typing.Any]] |
| 619 | +
|
| 620 | + method : str |
| 621 | +
|
| 622 | + request_options : typing.Optional[RequestOptions] |
| 623 | + Request-specific configuration. |
| 624 | +
|
| 625 | + Returns |
| 626 | + ------- |
| 627 | + OptimizePlacementBodyResponse |
| 628 | + Successful Response |
| 629 | +
|
| 630 | + Examples |
| 631 | + -------- |
| 632 | + from axiomatic import Axiomatic |
| 633 | +
|
| 634 | + client = Axiomatic( |
| 635 | + api_key="YOUR_API_KEY", |
| 636 | + ) |
| 637 | + client.pic.circuit.placementoptimize( |
| 638 | + netlist={"key": "value"}, |
| 639 | + method="method", |
| 640 | + ) |
| 641 | + """ |
| 642 | + _response = self._client_wrapper.httpx_client.request( |
| 643 | + "pic/circuit/optimize/placement", |
| 644 | + method="POST", |
| 645 | + json={ |
| 646 | + "netlist": netlist, |
| 647 | + "method": method, |
| 648 | + }, |
| 649 | + headers={ |
| 650 | + "content-type": "application/json", |
| 651 | + }, |
| 652 | + request_options=request_options, |
| 653 | + omit=OMIT, |
| 654 | + ) |
| 655 | + try: |
| 656 | + if 200 <= _response.status_code < 300: |
| 657 | + return typing.cast( |
| 658 | + OptimizePlacementBodyResponse, |
| 659 | + parse_obj_as( |
| 660 | + type_=OptimizePlacementBodyResponse, # type: ignore |
| 661 | + object_=_response.json(), |
| 662 | + ), |
| 663 | + ) |
| 664 | + if _response.status_code == 422: |
| 665 | + raise UnprocessableEntityError( |
| 666 | + typing.cast( |
| 667 | + HttpValidationError, |
| 668 | + parse_obj_as( |
| 669 | + type_=HttpValidationError, # type: ignore |
| 670 | + object_=_response.json(), |
| 671 | + ), |
| 672 | + ) |
| 673 | + ) |
| 674 | + _response_json = _response.json() |
| 675 | + except JSONDecodeError: |
| 676 | + raise ApiError(status_code=_response.status_code, body=_response.text) |
| 677 | + raise ApiError(status_code=_response.status_code, body=_response_json) |
| 678 | + |
605 | 679 |
|
606 | 680 | class AsyncCircuitClient: |
607 | 681 | def __init__(self, *, client_wrapper: AsyncClientWrapper): |
@@ -1236,3 +1310,84 @@ async def main() -> None: |
1236 | 1310 | except JSONDecodeError: |
1237 | 1311 | raise ApiError(status_code=_response.status_code, body=_response.text) |
1238 | 1312 | raise ApiError(status_code=_response.status_code, body=_response_json) |
| 1313 | + |
| 1314 | + async def placementoptimize( |
| 1315 | + self, |
| 1316 | + *, |
| 1317 | + netlist: typing.Dict[str, typing.Optional[typing.Any]], |
| 1318 | + method: str, |
| 1319 | + request_options: typing.Optional[RequestOptions] = None, |
| 1320 | + ) -> OptimizePlacementBodyResponse: |
| 1321 | + """ |
| 1322 | + Optimizes the placement of a circuit |
| 1323 | +
|
| 1324 | + Parameters |
| 1325 | + ---------- |
| 1326 | + netlist : typing.Dict[str, typing.Optional[typing.Any]] |
| 1327 | +
|
| 1328 | + method : str |
| 1329 | +
|
| 1330 | + request_options : typing.Optional[RequestOptions] |
| 1331 | + Request-specific configuration. |
| 1332 | +
|
| 1333 | + Returns |
| 1334 | + ------- |
| 1335 | + OptimizePlacementBodyResponse |
| 1336 | + Successful Response |
| 1337 | +
|
| 1338 | + Examples |
| 1339 | + -------- |
| 1340 | + import asyncio |
| 1341 | +
|
| 1342 | + from axiomatic import AsyncAxiomatic |
| 1343 | +
|
| 1344 | + client = AsyncAxiomatic( |
| 1345 | + api_key="YOUR_API_KEY", |
| 1346 | + ) |
| 1347 | +
|
| 1348 | +
|
| 1349 | + async def main() -> None: |
| 1350 | + await client.pic.circuit.placementoptimize( |
| 1351 | + netlist={"key": "value"}, |
| 1352 | + method="method", |
| 1353 | + ) |
| 1354 | +
|
| 1355 | +
|
| 1356 | + asyncio.run(main()) |
| 1357 | + """ |
| 1358 | + _response = await self._client_wrapper.httpx_client.request( |
| 1359 | + "pic/circuit/optimize/placement", |
| 1360 | + method="POST", |
| 1361 | + json={ |
| 1362 | + "netlist": netlist, |
| 1363 | + "method": method, |
| 1364 | + }, |
| 1365 | + headers={ |
| 1366 | + "content-type": "application/json", |
| 1367 | + }, |
| 1368 | + request_options=request_options, |
| 1369 | + omit=OMIT, |
| 1370 | + ) |
| 1371 | + try: |
| 1372 | + if 200 <= _response.status_code < 300: |
| 1373 | + return typing.cast( |
| 1374 | + OptimizePlacementBodyResponse, |
| 1375 | + parse_obj_as( |
| 1376 | + type_=OptimizePlacementBodyResponse, # type: ignore |
| 1377 | + object_=_response.json(), |
| 1378 | + ), |
| 1379 | + ) |
| 1380 | + if _response.status_code == 422: |
| 1381 | + raise UnprocessableEntityError( |
| 1382 | + typing.cast( |
| 1383 | + HttpValidationError, |
| 1384 | + parse_obj_as( |
| 1385 | + type_=HttpValidationError, # type: ignore |
| 1386 | + object_=_response.json(), |
| 1387 | + ), |
| 1388 | + ) |
| 1389 | + ) |
| 1390 | + _response_json = _response.json() |
| 1391 | + except JSONDecodeError: |
| 1392 | + raise ApiError(status_code=_response.status_code, body=_response.text) |
| 1393 | + raise ApiError(status_code=_response.status_code, body=_response_json) |
0 commit comments