Skip to content

Commit b11301c

Browse files
FEATURE: Fixed up utility doc
1 parent ff41a53 commit b11301c

File tree

15 files changed

+463
-300
lines changed

15 files changed

+463
-300
lines changed

doc/source/api/utility.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,16 @@ Classes
2222
value.Value
2323
edb_error_manager.EDBErrorSeverity
2424
edb_error_manager.EDBError
25-
edb_error_manager.get_error_messages
25+
edb_error_manager.get_error_messages
26+
27+
28+
Enums
29+
-----
30+
31+
.. autosummary::
32+
:toctree: _autosummary
33+
34+
heat_sink.HeatSinkFinOrientation
35+
hfss_extent_info.HFSSExtentInfoType
36+
hfss_extent_info.OpenRegionType
37+
layer_map.LayerMapUniqueDirection

src/ansys/edb/core/layout/cell.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
from ansys.edb.core.primitive.primitive import Primitive
1313
from ansys.edb.core.session import StubAccessor, StubType
1414
from ansys.edb.core.simulation_setup.simulation_setup import SimulationSetup
15-
from ansys.edb.core.utility.hfss_extent_info import HfssExtentInfo
15+
from ansys.edb.core.utility.hfss_extent_info import (
16+
HfssExtentInfo,
17+
HFSSExtentInfoType,
18+
OpenRegionType,
19+
)
1620
from ansys.edb.core.utility.temperature_settings import TemperatureSettings
1721
from ansys.edb.core.utility.value import Value
1822

@@ -93,11 +97,11 @@ def primitive_helper(msg):
9397
},
9498
"HfssExtentsType": {
9599
"msg": _translate_hfss_extents_enums,
96-
"val": HfssExtentInfo.HFSSExtentInfoType,
100+
"val": HFSSExtentInfoType,
97101
},
98102
"HfssExtentsOpenRegionType": {
99103
"msg": _translate_hfss_extents_enums,
100-
"val": HfssExtentInfo.OpenRegionType,
104+
"val": OpenRegionType,
101105
},
102106
}
103107

src/ansys/edb/core/utility/conversions.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
"""This module performs conversions from arbitrary user input to explicit types."""
2+
from __future__ import annotations
3+
4+
from typing import TYPE_CHECKING
5+
6+
if TYPE_CHECKING:
7+
from ansys.edb.core.typing import ValueLike, PointLike, Point3DLike
8+
29
from ansys.api.edb.v1.edb_messages_pb2 import ValueMessage
310

411
from ansys.edb.core.geometry import point3d_data, point_data
512
from ansys.edb.core.utility import value
613

714

8-
def to_value(val):
9-
"""Take a value implicitly convertible to a ``Value``type and return as a ``Value`` type.
15+
def to_value(val: ValueLike) -> value.Value:
16+
"""Take a value implicitly convertible to a :class:`.Value` type and return as a :class:`.Value` type.
1017
1118
Parameters
1219
----------
13-
val : ansys.edb.core.typing.ValueLike
20+
val : :term:`ValueLike`
1421
1522
Returns
1623
-------
17-
:class:`.Value`
24+
.Value
1825
"""
1926
if isinstance(val, value.Value):
2027
return val
@@ -26,16 +33,16 @@ def to_value(val):
2633
)
2734

2835

29-
def to_point(val):
30-
"""Take a value implicitly convertible to a ``PointData`` type and return as a ``PointData`` type.
36+
def to_point(val: PointLike) -> point_data.PointData:
37+
"""Take a value implicitly convertible to a :class:`.PointData` type and return as a :class:`.PointData` type.
3138
3239
Parameters
3340
----------
34-
val : ansys.edb.core.typing.PointLike
41+
val : :term:`Point2DLike`
3542
3643
Returns
3744
-------
38-
:class:`.PointData`
45+
.PointData
3946
"""
4047
if isinstance(val, point_data.PointData):
4148
return val
@@ -50,17 +57,16 @@ def to_point(val):
5057
)
5158

5259

53-
def to_point3d(val):
54-
"""Convert a value to a ``Point3DData`` object.
60+
def to_point3d(val: Point3DLike) -> point3d_data.Point3DData:
61+
"""Take a value implicitly convertible to a :class:`.Point3DData` type and return as a :class:`.Point3DData` type.
5562
5663
Parameters
5764
----------
58-
val : Point3DData, tuple[:term:`ValueLike`,:term:`ValueLike`,:term:`ValueLike`]
59-
Value to convert.
65+
val : :term:`Point3DLike`
6066
6167
Returns
6268
-------
63-
:class:`.Point3DData`
69+
.Point3DData
6470
"""
6571
if isinstance(val, point3d_data.Point3DData):
6672
return val

src/ansys/edb/core/utility/heat_sink.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
"""Heat sink."""
2+
from __future__ import annotations
3+
4+
from typing import TYPE_CHECKING
5+
6+
if TYPE_CHECKING:
7+
from ansys.edb.core.typing import ValueLike
28

39
from enum import Enum
410

@@ -16,7 +22,8 @@ class HeatSinkFinOrientation(Enum):
1622

1723

1824
class HeatSink:
19-
"""Represents a heat sink.
25+
"""Represents a heat sink, a three-dimensional modeling component \
26+
that can exchange radiation with other objects in the model.
2027
2128
Attributes
2229
----------
@@ -28,20 +35,33 @@ class HeatSink:
2835
Base elevation of the the heat sink.
2936
fin_height : :term:`ValueLike`
3037
Fin height of the heat sink.
31-
fin_orientation : HeatSinkFinOrientation
38+
fin_orientation : .HeatSinkFinOrientation
3239
Fin orientation of the heat sink if it is not set to the X axis.
33-
3440
"""
3541

3642
def __init__(
3743
self,
38-
fin_thickness=0,
39-
fin_spacing=0,
40-
fin_base_height=0,
41-
fin_height=0,
42-
fin_orientation=HeatSinkFinOrientation.X_ORIENTED,
44+
fin_thickness: ValueLike = 0,
45+
fin_spacing: ValueLike = 0,
46+
fin_base_height: ValueLike = 0,
47+
fin_height: ValueLike = 0,
48+
fin_orientation: HeatSinkFinOrientation = HeatSinkFinOrientation.X_ORIENTED,
4349
):
44-
"""Initialize a heat sink object using given values."""
50+
"""Initialize a heat sink object using given values.
51+
52+
Parameters
53+
----------
54+
fin_thickness : :term:`ValueLike`
55+
Fin thickness of the heat sink.
56+
fin_spacing : :term:`ValueLike`
57+
Fin spacing of the heat sink.
58+
fin_base_height : :term:`ValueLike`
59+
Base elevation of the the heat sink.
60+
fin_height : :term:`ValueLike`
61+
Fin height of the heat sink.
62+
fin_orientation : .HeatSinkFinOrientation
63+
Fin orientation of the heat sink if it is not set to the X axis.
64+
"""
4565
self.fin_thickness = conversions.to_value(fin_thickness)
4666
self.fin_spacing = conversions.to_value(fin_spacing)
4767
self.fin_base_height = conversions.to_value(fin_base_height)

0 commit comments

Comments
 (0)