Skip to content

Commit 106548f

Browse files
authored
FIX: Fix primitive doc (#537)
1 parent 316acf4 commit 106548f

File tree

13 files changed

+454
-342
lines changed

13 files changed

+454
-342
lines changed

doc/source/api/primitive.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ Classes
2222

2323
Enums
2424
-----
25+
.. currentmodule:: ansys.edb.core
2526

2627
.. autosummary::
2728
:toctree: _autosummary
2829

29-
bondwire.BondwireCrossSectionType
30-
bondwire.BondwireType
31-
padstack_instance.BackDrillType
32-
path.PathCornerType
33-
path.PathEndCapType
34-
primitive.PrimitiveType
35-
rectangle.RectangleRepresentationType
30+
primitive.bondwire.BondwireCrossSectionType
31+
primitive.bondwire.BondwireType
32+
primitive.padstack_instance.BackDrillType
33+
primitive.path.PathCornerType
34+
primitive.path.PathEndCapType
35+
primitive.primitive.PrimitiveType
36+
primitive.rectangle.RectangleRepresentationType
37+
edb_defs.LayoutObjType

src/ansys/edb/core/inner/conn_obj.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def cast(self):
6060

6161
@property
6262
def obj_type(self):
63-
""":class:`LayoutObjType <ansys.edb.core.edb_defs.LayoutObjType>`: Layout object type.
63+
""":class:`.LayoutObjType`: Layout object type.
6464
6565
This property is read-only.
6666
"""
@@ -128,7 +128,7 @@ def group(self, group):
128128
def net(self):
129129
""":class:`.Net`: Net of the :term:`Connectable` object.
130130
131-
This property can be set with a :class:`.Net` instance, a string, or ``None``.
131+
This property can be set with a :class:`.Net` instance, a string, or :obj:`None`.
132132
"""
133133
from ansys.edb.core.net.net import Net
134134

src/ansys/edb/core/inner/layout_obj.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class LayoutObj(ObjBase):
1616

1717
@property
1818
def obj_type(self):
19-
""":class:`LayoutObjType <ansys.edb.core.edb_defs.LayoutObjType>`: Layout object type.
19+
""":class:`.LayoutObjType`: Layout object type.
2020
2121
This property is read-only.
2222
"""

src/ansys/edb/core/primitive/board_bend_def.py

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
"""Primitive classes."""
2+
from __future__ import annotations
3+
4+
from typing import TYPE_CHECKING
5+
6+
if TYPE_CHECKING:
7+
from ansys.edb.core.layout.layout import Layout
8+
from ansys.edb.core.typing import ValueLike, PointLike
9+
from ansys.edb.core.geometry.polygon_data import PolygonData
210

311
from ansys.api.edb.v1 import board_bend_def_pb2, board_bend_def_pb2_grpc
412

@@ -14,16 +22,23 @@ class BoardBendDef(Primitive):
1422
__stub: board_bend_def_pb2_grpc.BoardBendDefServiceStub = StubAccessor(StubType.board_bend_def)
1523

1624
@classmethod
17-
def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle):
25+
def create(
26+
cls,
27+
layout: Layout,
28+
zone_prim: Primitive,
29+
bend_middle: PointLike,
30+
bend_radius: ValueLike,
31+
bend_angle: ValueLike,
32+
) -> BoardBendDef:
1833
"""Create a board bend definition.
1934
2035
Parameters
2136
----------
22-
layout : :class:`.Layout`
37+
layout : .Layout
2338
Layout to create the board bend definition in.
24-
zone_prim : :class:`.Primitive`
39+
zone_prim : .Primitive
2540
Zone primitive to create the board bend definition on.
26-
bend_middle : (:term:`Point2DLike`, :term:`Point2DLike`)
41+
bend_middle : tuple of (:term:`Point2DLike`, :term:`Point2DLike`)
2742
Tuple containing the starting and ending points of the line that represents
2843
the middle of the bend.
2944
bend_radius : :term:`ValueLike`
@@ -49,7 +64,7 @@ def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle):
4964
)
5065

5166
@property
52-
def boundary_primitive(self):
67+
def boundary_primitive(self) -> Primitive:
5368
""":class:`.Primitive`: Zone primitive the board bend is placed on.
5469
5570
This property is read-only.
@@ -58,35 +73,35 @@ def boundary_primitive(self):
5873

5974
@property
6075
@parser.to_point_data_pair
61-
def bend_middle(self):
76+
def bend_middle(self) -> tuple[PointLike, PointLike]:
6277
"""(:term:`Point2DLike`, :term:`Point2DLike`): Tuple of the bend middle based on starting and ending points."""
6378
return self.__stub.GetBendMiddle(self.msg)
6479

6580
@bend_middle.setter
66-
def bend_middle(self, bend_middle):
81+
def bend_middle(self, bend_middle: tuple[PointLike, PointLike]):
6782
self.__stub.SetBendMiddle(messages.point_pair_property_message(self, bend_middle))
6883

6984
@property
70-
def radius(self):
71-
""":term:`ValueLike`: Radius of the bend."""
85+
def radius(self) -> Value:
86+
""":class:`.Value`: Radius of the bend."""
7287
return Value(self.__stub.GetRadius(self.msg))
7388

7489
@radius.setter
75-
def radius(self, val):
90+
def radius(self, val: ValueLike):
7691
self.__stub.SetRadius(messages.value_property_message(self, val))
7792

7893
@property
79-
def angle(self):
80-
""":term:`ValueLike`: Angle of the bend."""
94+
def angle(self) -> Value:
95+
""":class:`.Value`: Angle of the bend."""
8196
return Value(self.__stub.GetAngle(self.msg))
8297

8398
@angle.setter
84-
def angle(self, val):
99+
def angle(self, val: ValueLike):
85100
self.__stub.SetAngle(messages.value_property_message(self, val))
86101

87102
@property
88103
@parser.to_polygon_data_list
89-
def bent_regions(self):
104+
def bent_regions(self) -> list[PolygonData]:
90105
""":obj:`list` of :class:`.PolygonData`: Bent region polygons.
91106
92107
This list of a collection of polygon data represents the areas bent by the bend definition.

0 commit comments

Comments
 (0)