Skip to content

Commit 964c1f2

Browse files
committed
Release 0.0.89
1 parent 44c7fc1 commit 964c1f2

File tree

10 files changed

+285
-14
lines changed

10 files changed

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

reference.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,84 @@ client.pic.document.summarize(
17821782
</details>
17831783

17841784
## Pic Circuit
1785+
<details><summary><code>client.pic.circuit.<a href="src/axiomatic/pic/circuit/client.py">parse</a>(...)</code></summary>
1786+
<dl>
1787+
<dd>
1788+
1789+
#### 📝 Description
1790+
1791+
<dl>
1792+
<dd>
1793+
1794+
<dl>
1795+
<dd>
1796+
1797+
Parse a piece of text into a valid formal statement, if possible.
1798+
</dd>
1799+
</dl>
1800+
</dd>
1801+
</dl>
1802+
1803+
#### 🔌 Usage
1804+
1805+
<dl>
1806+
<dd>
1807+
1808+
<dl>
1809+
<dd>
1810+
1811+
```python
1812+
from axiomatic import Axiomatic
1813+
1814+
client = Axiomatic(
1815+
api_key="YOUR_API_KEY",
1816+
)
1817+
client.pic.circuit.parse(
1818+
text="text",
1819+
)
1820+
1821+
```
1822+
</dd>
1823+
</dl>
1824+
</dd>
1825+
</dl>
1826+
1827+
#### ⚙️ Parameters
1828+
1829+
<dl>
1830+
<dd>
1831+
1832+
<dl>
1833+
<dd>
1834+
1835+
**text:** `str`
1836+
1837+
</dd>
1838+
</dl>
1839+
1840+
<dl>
1841+
<dd>
1842+
1843+
**informalize:** `typing.Optional[bool]`
1844+
1845+
</dd>
1846+
</dl>
1847+
1848+
<dl>
1849+
<dd>
1850+
1851+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1852+
1853+
</dd>
1854+
</dl>
1855+
</dd>
1856+
</dl>
1857+
1858+
1859+
</dd>
1860+
</dl>
1861+
</details>
1862+
17851863
<details><summary><code>client.pic.circuit.<a href="src/axiomatic/pic/circuit/client.py">validate</a>(...)</code></summary>
17861864
<dl>
17871865
<dd>

src/axiomatic/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@
4444
ParameterOutputLowerBound,
4545
ParameterOutputUpperBound,
4646
ParseResponse,
47+
ParseStatementResponse,
4748
PdkType,
4849
PicInstance,
4950
PicInstanceInfoValue,
5051
PicInstanceSettingsValue,
51-
PicWarnings,
52+
PicWarning,
5253
Placement,
5354
PlotInfo,
5455
PlotParserOutput,
@@ -58,6 +59,7 @@
5859
SolutionResponse,
5960
SolutionResponseSolutionValue,
6061
Spectrum,
62+
Statement,
6163
StatementDictionary,
6264
StatementType,
6365
StatementValidation,
@@ -146,11 +148,12 @@
146148
"ParameterOutputLowerBound",
147149
"ParameterOutputUpperBound",
148150
"ParseResponse",
151+
"ParseStatementResponse",
149152
"PdkType",
150153
"PicInstance",
151154
"PicInstanceInfoValue",
152155
"PicInstanceSettingsValue",
153-
"PicWarnings",
156+
"PicWarning",
154157
"Placement",
155158
"PlotInfo",
156159
"PlotParserOutput",
@@ -160,6 +163,7 @@
160163
"SolutionResponse",
161164
"SolutionResponseSolutionValue",
162165
"Spectrum",
166+
"Statement",
163167
"StatementDictionary",
164168
"StatementType",
165169
"StatementValidation",

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

src/axiomatic/pic/circuit/client.py

Lines changed: 158 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
import typing
44
from ...core.client_wrapper import SyncClientWrapper
5-
from ...types.netlist import Netlist
6-
from ...types.statement_dictionary import StatementDictionary
7-
from ...types.computation import Computation
85
from ...core.request_options import RequestOptions
9-
from ...types.validate_netlist_response import ValidateNetlistResponse
10-
from ...core.serialization import convert_and_respect_annotation_metadata
6+
from ...types.parse_statement_response import ParseStatementResponse
117
from ...core.pydantic_utilities import parse_obj_as
128
from ...errors.unprocessable_entity_error import UnprocessableEntityError
139
from ...types.http_validation_error import HttpValidationError
1410
from json.decoder import JSONDecodeError
1511
from ...core.api_error import ApiError
12+
from ...types.netlist import Netlist
13+
from ...types.statement_dictionary import StatementDictionary
14+
from ...types.computation import Computation
15+
from ...types.validate_netlist_response import ValidateNetlistResponse
16+
from ...core.serialization import convert_and_respect_annotation_metadata
1617
from ...types.pdk_type import PdkType
1718
from ...types.formalize_circuit_response import FormalizeCircuitResponse
1819
from .types.statement import Statement
@@ -38,6 +39,78 @@ class CircuitClient:
3839
def __init__(self, *, client_wrapper: SyncClientWrapper):
3940
self._client_wrapper = client_wrapper
4041

42+
def parse(
43+
self,
44+
*,
45+
text: str,
46+
informalize: typing.Optional[bool] = OMIT,
47+
request_options: typing.Optional[RequestOptions] = None,
48+
) -> ParseStatementResponse:
49+
"""
50+
Parse a piece of text into a valid formal statement, if possible.
51+
52+
Parameters
53+
----------
54+
text : str
55+
56+
informalize : typing.Optional[bool]
57+
58+
request_options : typing.Optional[RequestOptions]
59+
Request-specific configuration.
60+
61+
Returns
62+
-------
63+
ParseStatementResponse
64+
Successful Response
65+
66+
Examples
67+
--------
68+
from axiomatic import Axiomatic
69+
70+
client = Axiomatic(
71+
api_key="YOUR_API_KEY",
72+
)
73+
client.pic.circuit.parse(
74+
text="text",
75+
)
76+
"""
77+
_response = self._client_wrapper.httpx_client.request(
78+
"pic/circuit/statement/parse",
79+
method="POST",
80+
json={
81+
"text": text,
82+
"informalize": informalize,
83+
},
84+
headers={
85+
"content-type": "application/json",
86+
},
87+
request_options=request_options,
88+
omit=OMIT,
89+
)
90+
try:
91+
if 200 <= _response.status_code < 300:
92+
return typing.cast(
93+
ParseStatementResponse,
94+
parse_obj_as(
95+
type_=ParseStatementResponse, # type: ignore
96+
object_=_response.json(),
97+
),
98+
)
99+
if _response.status_code == 422:
100+
raise UnprocessableEntityError(
101+
typing.cast(
102+
HttpValidationError,
103+
parse_obj_as(
104+
type_=HttpValidationError, # type: ignore
105+
object_=_response.json(),
106+
),
107+
)
108+
)
109+
_response_json = _response.json()
110+
except JSONDecodeError:
111+
raise ApiError(status_code=_response.status_code, body=_response.text)
112+
raise ApiError(status_code=_response.status_code, body=_response_json)
113+
41114
def validate(
42115
self,
43116
*,
@@ -928,6 +1001,86 @@ class AsyncCircuitClient:
9281001
def __init__(self, *, client_wrapper: AsyncClientWrapper):
9291002
self._client_wrapper = client_wrapper
9301003

1004+
async def parse(
1005+
self,
1006+
*,
1007+
text: str,
1008+
informalize: typing.Optional[bool] = OMIT,
1009+
request_options: typing.Optional[RequestOptions] = None,
1010+
) -> ParseStatementResponse:
1011+
"""
1012+
Parse a piece of text into a valid formal statement, if possible.
1013+
1014+
Parameters
1015+
----------
1016+
text : str
1017+
1018+
informalize : typing.Optional[bool]
1019+
1020+
request_options : typing.Optional[RequestOptions]
1021+
Request-specific configuration.
1022+
1023+
Returns
1024+
-------
1025+
ParseStatementResponse
1026+
Successful Response
1027+
1028+
Examples
1029+
--------
1030+
import asyncio
1031+
1032+
from axiomatic import AsyncAxiomatic
1033+
1034+
client = AsyncAxiomatic(
1035+
api_key="YOUR_API_KEY",
1036+
)
1037+
1038+
1039+
async def main() -> None:
1040+
await client.pic.circuit.parse(
1041+
text="text",
1042+
)
1043+
1044+
1045+
asyncio.run(main())
1046+
"""
1047+
_response = await self._client_wrapper.httpx_client.request(
1048+
"pic/circuit/statement/parse",
1049+
method="POST",
1050+
json={
1051+
"text": text,
1052+
"informalize": informalize,
1053+
},
1054+
headers={
1055+
"content-type": "application/json",
1056+
},
1057+
request_options=request_options,
1058+
omit=OMIT,
1059+
)
1060+
try:
1061+
if 200 <= _response.status_code < 300:
1062+
return typing.cast(
1063+
ParseStatementResponse,
1064+
parse_obj_as(
1065+
type_=ParseStatementResponse, # type: ignore
1066+
object_=_response.json(),
1067+
),
1068+
)
1069+
if _response.status_code == 422:
1070+
raise UnprocessableEntityError(
1071+
typing.cast(
1072+
HttpValidationError,
1073+
parse_obj_as(
1074+
type_=HttpValidationError, # type: ignore
1075+
object_=_response.json(),
1076+
),
1077+
)
1078+
)
1079+
_response_json = _response.json()
1080+
except JSONDecodeError:
1081+
raise ApiError(status_code=_response.status_code, body=_response.text)
1082+
raise ApiError(status_code=_response.status_code, body=_response_json)
1083+
9311084
async def validate(
9321085
self,
9331086
*,

src/axiomatic/types/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
from .parameter_output_lower_bound import ParameterOutputLowerBound
4444
from .parameter_output_upper_bound import ParameterOutputUpperBound
4545
from .parse_response import ParseResponse
46+
from .parse_statement_response import ParseStatementResponse
4647
from .pdk_type import PdkType
4748
from .pic_instance import PicInstance
4849
from .pic_instance_info_value import PicInstanceInfoValue
4950
from .pic_instance_settings_value import PicInstanceSettingsValue
50-
from .pic_warnings import PicWarnings
51+
from .pic_warning import PicWarning
5152
from .placement import Placement
5253
from .plot_info import PlotInfo
5354
from .plot_parser_output import PlotParserOutput
@@ -57,6 +58,7 @@
5758
from .solution_response import SolutionResponse
5859
from .solution_response_solution_value import SolutionResponseSolutionValue
5960
from .spectrum import Spectrum
61+
from .statement import Statement
6062
from .statement_dictionary import StatementDictionary
6163
from .statement_type import StatementType
6264
from .statement_validation import StatementValidation
@@ -123,11 +125,12 @@
123125
"ParameterOutputLowerBound",
124126
"ParameterOutputUpperBound",
125127
"ParseResponse",
128+
"ParseStatementResponse",
126129
"PdkType",
127130
"PicInstance",
128131
"PicInstanceInfoValue",
129132
"PicInstanceSettingsValue",
130-
"PicWarnings",
133+
"PicWarning",
131134
"Placement",
132135
"PlotInfo",
133136
"PlotParserOutput",
@@ -137,6 +140,7 @@
137140
"SolutionResponse",
138141
"SolutionResponseSolutionValue",
139142
"Spectrum",
143+
"Statement",
140144
"StatementDictionary",
141145
"StatementType",
142146
"StatementValidation",

src/axiomatic/types/netlist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .net import Net
88
from .placement import Placement
99
from .bundle import Bundle
10-
from .pic_warnings import PicWarnings
10+
from .pic_warning import PicWarning
1111
from ..core.pydantic_utilities import IS_PYDANTIC_V2
1212
import pydantic
1313

@@ -24,7 +24,7 @@ class Netlist(UniversalBaseModel):
2424
ports: typing.Optional[typing.Dict[str, str]] = None
2525
placements: typing.Optional[typing.Dict[str, Placement]] = None
2626
routes: typing.Optional[typing.Dict[str, Bundle]] = None
27-
warnings: typing.Optional[PicWarnings] = None
27+
warnings: typing.Optional[typing.List[PicWarning]] = None
2828

2929
if IS_PYDANTIC_V2:
3030
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

0 commit comments

Comments
 (0)