2424from ...types .optimize_placement_body_response import OptimizePlacementBodyResponse
2525from .types .settings import Settings
2626from ...types .get_spectrum_response import GetSpectrumResponse
27+ from ...types .get_optimizable_parameters_response import GetOptimizableParametersResponse
2728from ...core .client_wrapper import AsyncClientWrapper
2829
2930# this is used as the default value for optional parameters
@@ -470,13 +471,7 @@ def optimize(
470471
471472 Examples
472473 --------
473- from axiomatic import (
474- Axiomatic,
475- Computation,
476- Netlist,
477- Parameter,
478- StatementDictionary,
479- )
474+ from axiomatic import Axiomatic, Computation, Netlist, StatementDictionary
480475
481476 client = Axiomatic(
482477 api_key="YOUR_API_KEY",
@@ -490,11 +485,7 @@ def optimize(
490485 arguments={"key": 1.1},
491486 )
492487 },
493- parameters=[
494- Parameter(
495- path="path",
496- )
497- ],
488+ parameters=[{"path": "path"}],
498489 )
499490 """
500491 _response = self ._client_wrapper .httpx_client .request (
@@ -510,9 +501,7 @@ def optimize(
510501 "mapping" : convert_and_respect_annotation_metadata (
511502 object_ = mapping , annotation = typing .Dict [str , Computation ], direction = "write"
512503 ),
513- "parameters" : convert_and_respect_annotation_metadata (
514- object_ = parameters , annotation = typing .Sequence [Parameter ], direction = "write"
515- ),
504+ "parameters" : parameters ,
516505 "config" : convert_and_respect_annotation_metadata (
517506 object_ = config , annotation = OptimizeConfig , direction = "write"
518507 ),
@@ -776,6 +765,60 @@ def get_sax_spectrum(
776765 raise ApiError (status_code = _response .status_code , body = _response .text )
777766 raise ApiError (status_code = _response .status_code , body = _response_json )
778767
768+ def get_optimizable_parameters (
769+ self , * , request_options : typing .Optional [RequestOptions ] = None
770+ ) -> GetOptimizableParametersResponse :
771+ """
772+ Gets the optimizable parameters of a circuit.
773+
774+ Parameters
775+ ----------
776+ request_options : typing.Optional[RequestOptions]
777+ Request-specific configuration.
778+
779+ Returns
780+ -------
781+ GetOptimizableParametersResponse
782+ Successful Response
783+
784+ Examples
785+ --------
786+ from axiomatic import Axiomatic
787+
788+ client = Axiomatic(
789+ api_key="YOUR_API_KEY",
790+ )
791+ client.pic.circuit.get_optimizable_parameters()
792+ """
793+ _response = self ._client_wrapper .httpx_client .request (
794+ "pic/circuit/optimizable-parameters/get" ,
795+ method = "GET" ,
796+ request_options = request_options ,
797+ )
798+ try :
799+ if 200 <= _response .status_code < 300 :
800+ return typing .cast (
801+ GetOptimizableParametersResponse ,
802+ parse_obj_as (
803+ type_ = GetOptimizableParametersResponse , # type: ignore
804+ object_ = _response .json (),
805+ ),
806+ )
807+ if _response .status_code == 422 :
808+ raise UnprocessableEntityError (
809+ typing .cast (
810+ HttpValidationError ,
811+ parse_obj_as (
812+ type_ = HttpValidationError , # type: ignore
813+ object_ = _response .json (),
814+ ),
815+ )
816+ )
817+ _response_json = _response .json ()
818+ except JSONDecodeError :
819+ raise ApiError (status_code = _response .status_code , body = _response .text )
820+ raise ApiError (status_code = _response .status_code , body = _response_json )
821+
779822
780823class AsyncCircuitClient :
781824 def __init__ (self , * , client_wrapper : AsyncClientWrapper ):
@@ -1259,13 +1302,7 @@ async def optimize(
12591302 --------
12601303 import asyncio
12611304
1262- from axiomatic import (
1263- AsyncAxiomatic,
1264- Computation,
1265- Netlist,
1266- Parameter,
1267- StatementDictionary,
1268- )
1305+ from axiomatic import AsyncAxiomatic, Computation, Netlist, StatementDictionary
12691306
12701307 client = AsyncAxiomatic(
12711308 api_key="YOUR_API_KEY",
@@ -1282,11 +1319,7 @@ async def main() -> None:
12821319 arguments={"key": 1.1},
12831320 )
12841321 },
1285- parameters=[
1286- Parameter(
1287- path="path",
1288- )
1289- ],
1322+ parameters=[{"path": "path"}],
12901323 )
12911324
12921325
@@ -1305,9 +1338,7 @@ async def main() -> None:
13051338 "mapping" : convert_and_respect_annotation_metadata (
13061339 object_ = mapping , annotation = typing .Dict [str , Computation ], direction = "write"
13071340 ),
1308- "parameters" : convert_and_respect_annotation_metadata (
1309- object_ = parameters , annotation = typing .Sequence [Parameter ], direction = "write"
1310- ),
1341+ "parameters" : parameters ,
13111342 "config" : convert_and_respect_annotation_metadata (
13121343 object_ = config , annotation = OptimizeConfig , direction = "write"
13131344 ),
@@ -1594,3 +1625,65 @@ async def main() -> None:
15941625 except JSONDecodeError :
15951626 raise ApiError (status_code = _response .status_code , body = _response .text )
15961627 raise ApiError (status_code = _response .status_code , body = _response_json )
1628+
1629+ async def get_optimizable_parameters (
1630+ self , * , request_options : typing .Optional [RequestOptions ] = None
1631+ ) -> GetOptimizableParametersResponse :
1632+ """
1633+ Gets the optimizable parameters of a circuit.
1634+
1635+ Parameters
1636+ ----------
1637+ request_options : typing.Optional[RequestOptions]
1638+ Request-specific configuration.
1639+
1640+ Returns
1641+ -------
1642+ GetOptimizableParametersResponse
1643+ Successful Response
1644+
1645+ Examples
1646+ --------
1647+ import asyncio
1648+
1649+ from axiomatic import AsyncAxiomatic
1650+
1651+ client = AsyncAxiomatic(
1652+ api_key="YOUR_API_KEY",
1653+ )
1654+
1655+
1656+ async def main() -> None:
1657+ await client.pic.circuit.get_optimizable_parameters()
1658+
1659+
1660+ asyncio.run(main())
1661+ """
1662+ _response = await self ._client_wrapper .httpx_client .request (
1663+ "pic/circuit/optimizable-parameters/get" ,
1664+ method = "GET" ,
1665+ request_options = request_options ,
1666+ )
1667+ try :
1668+ if 200 <= _response .status_code < 300 :
1669+ return typing .cast (
1670+ GetOptimizableParametersResponse ,
1671+ parse_obj_as (
1672+ type_ = GetOptimizableParametersResponse , # type: ignore
1673+ object_ = _response .json (),
1674+ ),
1675+ )
1676+ if _response .status_code == 422 :
1677+ raise UnprocessableEntityError (
1678+ typing .cast (
1679+ HttpValidationError ,
1680+ parse_obj_as (
1681+ type_ = HttpValidationError , # type: ignore
1682+ object_ = _response .json (),
1683+ ),
1684+ )
1685+ )
1686+ _response_json = _response .json ()
1687+ except JSONDecodeError :
1688+ raise ApiError (status_code = _response .status_code , body = _response .text )
1689+ raise ApiError (status_code = _response .status_code , body = _response_json )
0 commit comments