Skip to content

Commit f50c9cd

Browse files
committed
Release 0.0.84
1 parent fc21ca6 commit f50c9cd

File tree

9 files changed

+236
-72
lines changed

9 files changed

+236
-72
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "axiomatic"
33

44
[tool.poetry]
55
name = "axiomatic"
6-
version = "0.0.83"
6+
version = "0.0.84"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,13 +2115,7 @@ Optimize a PIC circuit with given cost and constraints
21152115
<dd>
21162116

21172117
```python
2118-
from axiomatic import (
2119-
Axiomatic,
2120-
Computation,
2121-
Netlist,
2122-
Parameter,
2123-
StatementDictionary,
2124-
)
2118+
from axiomatic import Axiomatic, Computation, Netlist, StatementDictionary
21252119

21262120
client = Axiomatic(
21272121
api_key="YOUR_API_KEY",
@@ -2135,11 +2129,7 @@ client.pic.circuit.optimize(
21352129
arguments={"key": 1.1},
21362130
)
21372131
},
2138-
parameters=[
2139-
Parameter(
2140-
path="path",
2141-
)
2142-
],
2132+
parameters=[{"path": "path"}],
21432133
)
21442134

21452135
```
@@ -2458,6 +2448,66 @@ client.pic.circuit.get_sax_spectrum(
24582448
</dl>
24592449

24602450

2451+
</dd>
2452+
</dl>
2453+
</details>
2454+
2455+
<details><summary><code>client.pic.circuit.<a href="src/axiomatic/pic/circuit/client.py">get_optimizable_parameters</a>()</code></summary>
2456+
<dl>
2457+
<dd>
2458+
2459+
#### 📝 Description
2460+
2461+
<dl>
2462+
<dd>
2463+
2464+
<dl>
2465+
<dd>
2466+
2467+
Gets the optimizable parameters of a circuit.
2468+
</dd>
2469+
</dl>
2470+
</dd>
2471+
</dl>
2472+
2473+
#### 🔌 Usage
2474+
2475+
<dl>
2476+
<dd>
2477+
2478+
<dl>
2479+
<dd>
2480+
2481+
```python
2482+
from axiomatic import Axiomatic
2483+
2484+
client = Axiomatic(
2485+
api_key="YOUR_API_KEY",
2486+
)
2487+
client.pic.circuit.get_optimizable_parameters()
2488+
2489+
```
2490+
</dd>
2491+
</dl>
2492+
</dd>
2493+
</dl>
2494+
2495+
#### ⚙️ Parameters
2496+
2497+
<dl>
2498+
<dd>
2499+
2500+
<dl>
2501+
<dd>
2502+
2503+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
2504+
2505+
</dd>
2506+
</dl>
2507+
</dd>
2508+
</dl>
2509+
2510+
24612511
</dd>
24622512
</dl>
24632513
</details>

src/axiomatic/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
GenerateCodeResponse,
2626
GenerateComponentCodeResponse,
2727
GenerateLensCodeResponse,
28+
GetOptimizableParametersBody,
29+
GetOptimizableParametersResponse,
2830
GetSpectrumResponse,
2931
GetSpectrumResponseSpectrumItem,
3032
HttpValidationError,
@@ -118,6 +120,8 @@
118120
"GenerateCodeResponse",
119121
"GenerateComponentCodeResponse",
120122
"GenerateLensCodeResponse",
123+
"GetOptimizableParametersBody",
124+
"GetOptimizableParametersResponse",
121125
"GetSpectrumResponse",
122126
"GetSpectrumResponseSpectrumItem",
123127
"HttpValidationError",

src/axiomatic/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "axiomatic",
19-
"X-Fern-SDK-Version": "0.0.83",
19+
"X-Fern-SDK-Version": "0.0.84",
2020
}
2121
headers["X-API-Key"] = self.api_key
2222
return headers

src/axiomatic/pic/circuit/client.py

Lines changed: 123 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from ...types.optimize_placement_body_response import OptimizePlacementBodyResponse
2525
from .types.settings import Settings
2626
from ...types.get_spectrum_response import GetSpectrumResponse
27+
from ...types.get_optimizable_parameters_response import GetOptimizableParametersResponse
2728
from ...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

780823
class 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)

src/axiomatic/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from .generate_code_response import GenerateCodeResponse
2525
from .generate_component_code_response import GenerateComponentCodeResponse
2626
from .generate_lens_code_response import GenerateLensCodeResponse
27+
from .get_optimizable_parameters_body import GetOptimizableParametersBody
28+
from .get_optimizable_parameters_response import GetOptimizableParametersResponse
2729
from .get_spectrum_response import GetSpectrumResponse
2830
from .get_spectrum_response_spectrum_item import GetSpectrumResponseSpectrumItem
2931
from .http_validation_error import HttpValidationError
@@ -96,6 +98,8 @@
9698
"GenerateCodeResponse",
9799
"GenerateComponentCodeResponse",
98100
"GenerateLensCodeResponse",
101+
"GetOptimizableParametersBody",
102+
"GetOptimizableParametersResponse",
99103
"GetSpectrumResponse",
100104
"GetSpectrumResponseSpectrumItem",
101105
"HttpValidationError",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ..core.pydantic_utilities import UniversalBaseModel
4+
from .netlist import Netlist
5+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
6+
import typing
7+
import pydantic
8+
9+
10+
class GetOptimizableParametersBody(UniversalBaseModel):
11+
netlist: Netlist
12+
13+
if IS_PYDANTIC_V2:
14+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15+
else:
16+
17+
class Config:
18+
frozen = True
19+
smart_union = True
20+
extra = pydantic.Extra.allow

0 commit comments

Comments
 (0)