Skip to content

Commit ec7d3c8

Browse files
committed
Release 0.0.59
1 parent 3eb9d69 commit ec7d3c8

File tree

9 files changed

+264
-6
lines changed

9 files changed

+264
-6
lines changed

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.58"
6+
version = "0.0.59"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,85 @@ client.pic.circuit.verify(
17241724
</dl>
17251725

17261726

1727+
</dd>
1728+
</dl>
1729+
</details>
1730+
1731+
<details><summary><code>client.pic.circuit.<a href="src/axiomatic/pic/circuit/client.py">placementoptimize</a>(...)</code></summary>
1732+
<dl>
1733+
<dd>
1734+
1735+
#### 📝 Description
1736+
1737+
<dl>
1738+
<dd>
1739+
1740+
<dl>
1741+
<dd>
1742+
1743+
Optimizes the placement of a circuit
1744+
</dd>
1745+
</dl>
1746+
</dd>
1747+
</dl>
1748+
1749+
#### 🔌 Usage
1750+
1751+
<dl>
1752+
<dd>
1753+
1754+
<dl>
1755+
<dd>
1756+
1757+
```python
1758+
from axiomatic import Axiomatic
1759+
1760+
client = Axiomatic(
1761+
api_key="YOUR_API_KEY",
1762+
)
1763+
client.pic.circuit.placementoptimize(
1764+
netlist={"key": "value"},
1765+
method="method",
1766+
)
1767+
1768+
```
1769+
</dd>
1770+
</dl>
1771+
</dd>
1772+
</dl>
1773+
1774+
#### ⚙️ Parameters
1775+
1776+
<dl>
1777+
<dd>
1778+
1779+
<dl>
1780+
<dd>
1781+
1782+
**netlist:** `typing.Dict[str, typing.Optional[typing.Any]]`
1783+
1784+
</dd>
1785+
</dl>
1786+
1787+
<dl>
1788+
<dd>
1789+
1790+
**method:** `str`
1791+
1792+
</dd>
1793+
</dl>
1794+
1795+
<dl>
1796+
<dd>
1797+
1798+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1799+
1800+
</dd>
1801+
</dl>
1802+
</dd>
1803+
</dl>
1804+
1805+
17271806
</dd>
17281807
</dl>
17291808
</details>

src/axiomatic/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
NetlistPlacementsValueValue,
2121
OptimizationHistory,
2222
OptimizeNetlistResponse,
23+
OptimizePlacementBodyResponse,
2324
Parameter,
2425
ParameterConstraint,
2526
ParseResponse,
@@ -79,6 +80,7 @@
7980
"NetlistPlacementsValueValue",
8081
"OptimizationHistory",
8182
"OptimizeNetlistResponse",
83+
"OptimizePlacementBodyResponse",
8284
"Parameter",
8385
"ParameterConstraint",
8486
"ParseResponse",

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.58",
19+
"X-Fern-SDK-Version": "0.0.59",
2020
}
2121
headers["X-API-Key"] = self.api_key
2222
return headers

src/axiomatic/pic/circuit/client.py

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ...types.parameter import Parameter
2121
from ...types.optimize_netlist_response import OptimizeNetlistResponse
2222
from ...types.verify_circuit_code_response import VerifyCircuitCodeResponse
23+
from ...types.optimize_placement_body_response import OptimizePlacementBodyResponse
2324
from ...core.client_wrapper import AsyncClientWrapper
2425

2526
# this is used as the default value for optional parameters
@@ -602,6 +603,79 @@ def verify(
602603
raise ApiError(status_code=_response.status_code, body=_response.text)
603604
raise ApiError(status_code=_response.status_code, body=_response_json)
604605

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+
605679

606680
class AsyncCircuitClient:
607681
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -1236,3 +1310,84 @@ async def main() -> None:
12361310
except JSONDecodeError:
12371311
raise ApiError(status_code=_response.status_code, body=_response.text)
12381312
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)

src/axiomatic/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .netlist_placements_value_value import NetlistPlacementsValueValue
2020
from .optimization_history import OptimizationHistory
2121
from .optimize_netlist_response import OptimizeNetlistResponse
22+
from .optimize_placement_body_response import OptimizePlacementBodyResponse
2223
from .parameter import Parameter
2324
from .parameter_constraint import ParameterConstraint
2425
from .parse_response import ParseResponse
@@ -69,6 +70,7 @@
6970
"NetlistPlacementsValueValue",
7071
"OptimizationHistory",
7172
"OptimizeNetlistResponse",
73+
"OptimizePlacementBodyResponse",
7274
"Parameter",
7375
"ParameterConstraint",
7476
"ParseResponse",
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 OptimizePlacementBodyResponse(UniversalBaseModel):
11+
circuit: 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

src/axiomatic/types/structure_function_call.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class StructureFunctionCall(UniversalBaseModel):
1313
The model describing a function call.
1414
"""
1515

16-
type: typing.Optional[typing.Literal["Z3_EXPRESSION"]] = None
16+
type: typing.Optional[typing.Literal["STRUCTURE_FUNCTION_CALL"]] = None
1717
function_name: str = pydantic.Field()
1818
"""
1919
The name of the function that is called.

0 commit comments

Comments
 (0)