Skip to content

Commit da501de

Browse files
fix: docstyle ordering (#1925)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent c47c19d commit da501de

File tree

11 files changed

+90
-90
lines changed

11 files changed

+90
-90
lines changed

doc/changelog.d/1925.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docstyle ordering

src/ansys/geometry/core/_grpc/_services/_service.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ class _GRPCServices:
3535
"""
3636
Placeholder for the gRPC services (i.e. stubs).
3737
38-
Notes
39-
-----
40-
This class provides a unified interface to access the different
41-
gRPC services available in the Geometry API. It allows for easy
42-
switching between different versions of the API by using the
43-
`version` parameter in the constructor. The services are lazy-loaded
44-
to avoid unnecessary imports and to improve performance.
45-
4638
Parameters
4739
----------
4840
channel : grpc.Channel
4941
The gRPC channel to the server.
5042
version : GeometryApiProtos | str | None
5143
The version of the gRPC API protocol to use. If None, the latest
5244
version is used.
45+
46+
Notes
47+
-----
48+
This class provides a unified interface to access the different
49+
gRPC services available in the Geometry API. It allows for easy
50+
switching between different versions of the API by using the
51+
`version` parameter in the constructor. The services are lazy-loaded
52+
to avoid unnecessary imports and to improve performance.
5353
"""
5454

5555
def __init__(self, channel: grpc.Channel, version: GeometryApiProtos | str | None = None):

src/ansys/geometry/core/_grpc/_services/base/conversions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ def from_measurement_to_server_angle(input: Measurement) -> float:
5959
def to_distance(value: float | int) -> Distance:
6060
"""Convert a server value to a Distance object.
6161
62-
Notes
63-
-----
64-
The value is converted to a Distance object using the default server length unit.
65-
The value should represent a length in the server's unit system.
66-
6762
Parameters
6863
----------
6964
value : float | int
@@ -73,5 +68,10 @@ def to_distance(value: float | int) -> Distance:
7368
-------
7469
Distance
7570
Converted distance.
71+
72+
Notes
73+
-----
74+
The value is converted to a Distance object using the default server length unit.
75+
The value should represent a length in the server's unit system.
7676
"""
7777
return Distance(value, DEFAULT_UNITS.SERVER_LENGTH)

src/ansys/geometry/core/_grpc/_version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ def from_string(version_string: str) -> "GeometryApiProtos":
7171
def verify_supported(self, channel: grpc.Channel) -> bool:
7272
"""Check if the version is supported.
7373
74-
Notes
75-
-----
76-
This method checks if the server supports the gRPC API protocol version.
77-
7874
Parameters
7975
----------
8076
channel : grpc.Channel
@@ -84,6 +80,10 @@ def verify_supported(self, channel: grpc.Channel) -> bool:
8480
-------
8581
bool
8682
True if the server supports the version, otherwise False.
83+
84+
Notes
85+
-----
86+
This method checks if the server supports the gRPC API protocol version.
8787
"""
8888
pb2_grpc = self.value[1]
8989
if pb2_grpc is None:

src/ansys/geometry/core/connection/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@
5151
def _create_geometry_channel(target: str) -> grpc.Channel:
5252
"""Create a Geometry service gRPC channel.
5353
54-
Notes
55-
-----
56-
Contains specific options for the Geometry service.
57-
5854
Parameters
5955
----------
6056
target : str
@@ -65,6 +61,10 @@ def _create_geometry_channel(target: str) -> grpc.Channel:
6561
-------
6662
~grpc.Channel
6763
gRPC channel for the Geometry service.
64+
65+
Notes
66+
-----
67+
Contains specific options for the Geometry service.
6868
"""
6969
return grpc.insecure_channel(
7070
target,
@@ -94,16 +94,16 @@ def wait_until_healthy(channel: grpc.Channel | str, timeout: float) -> grpc.Chan
9494
* If the total elapsed time exceeds the value for the ``timeout`` parameter,
9595
a ``TimeoutError`` is raised.
9696
97-
Raises
98-
------
99-
TimeoutError
100-
Raised when the total elapsed time exceeds the value for the ``timeout`` parameter.
101-
10297
Returns
10398
-------
10499
grpc.Channel
105100
The channel that was passed in. This channel is guaranteed to be healthy.
106101
If a string was passed in, a channel is created using the default insecure channel.
102+
103+
Raises
104+
------
105+
TimeoutError
106+
Raised when the total elapsed time exceeds the value for the ``timeout`` parameter.
107107
"""
108108
t_max = time.time() + timeout
109109
t_out = 0.1

src/ansys/geometry/core/designer/component.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,6 @@ def set_shared_topology(self, share_type: SharedTopologyType) -> None:
506506
def __build_body_from_response(self, response: dict) -> Body:
507507
"""Build a body from a response dictionary coming out of the gRPC call.
508508
509-
Notes
510-
-----
511-
This is a completely private method and is intended to be
512-
used only within the class. It handles the MasterBody and
513-
Body creation, and addition to the component.
514-
515509
Parameters
516510
----------
517511
response : dict
@@ -521,6 +515,12 @@ def __build_body_from_response(self, response: dict) -> Body:
521515
-------
522516
Body
523517
Body object.
518+
519+
Notes
520+
-----
521+
This is a completely private method and is intended to be
522+
used only within the class. It handles the MasterBody and
523+
Body creation, and addition to the component.
524524
"""
525525
tb = MasterBody(
526526
response["master_id"],
@@ -1102,10 +1102,6 @@ def __create_beams_legacy(
11021102
) -> list[Beam]:
11031103
"""Create beams under the component.
11041104
1105-
Notes
1106-
-----
1107-
This is a legacy method, which is used in versions up to Ansys 25.1.1 products.
1108-
11091105
Parameters
11101106
----------
11111107
segments : list[tuple[Point3D, Point3D]]
@@ -1117,6 +1113,10 @@ def __create_beams_legacy(
11171113
-------
11181114
list[Beam]
11191115
A list of the created Beams.
1116+
1117+
Notes
1118+
-----
1119+
This is a legacy method, which is used in versions up to Ansys 25.1.1 products.
11201120
"""
11211121
request = CreateBeamSegmentsRequest(parent=self.id, profile=profile.id)
11221122

src/ansys/geometry/core/designer/design.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,6 @@ def download(
321321
def __export_and_download_legacy(self, format: DesignFileFormat) -> bytes:
322322
"""Export and download the design from the server.
323323
324-
Notes
325-
-----
326-
This is a legacy method, which is used in versions
327-
up to Ansys 25.1.1 products.
328-
329324
Parameters
330325
----------
331326
format : DesignFileFormat
@@ -335,6 +330,11 @@ def __export_and_download_legacy(self, format: DesignFileFormat) -> bytes:
335330
-------
336331
bytes
337332
The raw data from the exported and downloaded file.
333+
334+
Notes
335+
-----
336+
This is a legacy method, which is used in versions
337+
up to Ansys 25.1.1 products.
338338
"""
339339
# Process response
340340
self._grpc_client.log.debug(f"Requesting design download in {format.value[0]} format.")

src/ansys/geometry/core/designer/face.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,15 @@ def tessellate(self, tess_options: TessellationOptions | None = None) -> "pv.Pol
556556
tess_options : TessellationOptions | None, default: None
557557
A set of options to determine the tessellation quality.
558558
559-
Notes
560-
-----
561-
The tessellation options are ONLY used if the face has not been tessellated before.
562-
If the face has been tessellated before, the stored tessellation is returned.
563-
564559
Returns
565560
-------
566561
~pyvista.PolyData
567562
:class:`pyvista.PolyData` object holding the face.
563+
564+
Notes
565+
-----
566+
The tessellation options are ONLY used if the face has not been tessellated before.
567+
If the face has been tessellated before, the stored tessellation is returned.
568568
"""
569569
# If tessellation has not been called before... call it
570570
if self._body._template._tessellation is None:

src/ansys/geometry/core/parameters/parameter.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ class ParameterUpdateStatus(Enum):
5858
def _from_update_status(status: GRPCUpdateStatus) -> "ParameterUpdateStatus":
5959
"""Convert GRPCUpdateStatus to ParameterUpdateStatus.
6060
61-
Notes
62-
-----
63-
This method is used to convert the status of the update from gRPC to the
64-
parameter update status. Not to be used directly by the user.
65-
6661
Parameters
6762
----------
6863
status : GRPCUpdateStatus
@@ -72,6 +67,11 @@ def _from_update_status(status: GRPCUpdateStatus) -> "ParameterUpdateStatus":
7267
-------
7368
ParameterUpdateStatus
7469
Parameter update status.
70+
71+
Notes
72+
-----
73+
This method is used to convert the status of the update from gRPC to the
74+
parameter update status. Not to be used directly by the user.
7575
"""
7676
status_mapping = {
7777
GRPCUpdateStatus.SUCCESS: ParameterUpdateStatus.SUCCESS,
@@ -107,11 +107,6 @@ def __init__(self, id: int, name: str, dimension_type: ParameterType, dimension_
107107
def _from_proto(cls, proto: GRPCDrivingDimension) -> "Parameter":
108108
"""Create a ``Parameter`` instance from a ``proto`` object.
109109
110-
Notes
111-
-----
112-
This method is used to convert the parameter from gRPC to the parameter
113-
object. Not to be used directly by the user.
114-
115110
Parameters
116111
----------
117112
proto : GRPCDrivingDimension
@@ -121,6 +116,11 @@ def _from_proto(cls, proto: GRPCDrivingDimension) -> "Parameter":
121116
-------
122117
Parameter
123118
Parameter object.
119+
120+
Notes
121+
-----
122+
This method is used to convert the parameter from gRPC to the parameter
123+
object. Not to be used directly by the user.
124124
"""
125125
return cls(
126126
id=proto.id,
@@ -162,15 +162,15 @@ def dimension_type(self, value: ParameterType):
162162
def _to_proto(self):
163163
"""Convert a ``Parameter`` instance to a ``proto`` object.
164164
165-
Notes
166-
-----
167-
This method is used to convert the parameter from the parameter object to
168-
gRPC. Not to be used directly by the user.
169-
170165
Returns
171166
-------
172167
GRPCDrivingDimension
173168
Parameter object in gRPC.
169+
170+
Notes
171+
-----
172+
This method is used to convert the parameter from the parameter object to
173+
gRPC. Not to be used directly by the user.
174174
"""
175175
return GRPCDrivingDimension(
176176
id=self.id,

src/ansys/geometry/core/shapes/curves/nurbs.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,6 @@ def project_point(
218218
219219
This method returns the evaluation at the closest point.
220220
221-
Notes
222-
-----
223-
Based on `the NURBS book <https://link.springer.com/book/10.1007/978-3-642-59223-2>`_,
224-
the projection of a point to a NURBS curve is the solution to the following optimization
225-
problem: minimize the distance between the point and the curve. The distance is defined
226-
as the Euclidean distance squared. For more information, please refer to
227-
the implementation of the `distance_squared` function.
228-
229221
Parameters
230222
----------
231223
point : Point3D
@@ -239,6 +231,13 @@ def project_point(
239231
CurveEvaluation
240232
Evaluation at the closest point on the curve.
241233
234+
Notes
235+
-----
236+
Based on `the NURBS book <https://link.springer.com/book/10.1007/978-3-642-59223-2>`_,
237+
the projection of a point to a NURBS curve is the solution to the following optimization
238+
problem: minimize the distance between the point and the curve. The distance is defined
239+
as the Euclidean distance squared. For more information, please refer to
240+
the implementation of the `distance_squared` function.
242241
"""
243242
import numpy as np
244243
from scipy.optimize import minimize

0 commit comments

Comments
 (0)