diff --git a/doc/changelog.d/1556.fixed.md b/doc/changelog.d/1556.fixed.md new file mode 100644 index 0000000000..62d777bd70 --- /dev/null +++ b/doc/changelog.d/1556.fixed.md @@ -0,0 +1 @@ +numpydoc warnings \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 3733b0b6a9..7758b3cc06 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -84,12 +84,6 @@ def get_wheelhouse_assets_dictionary(): def intersphinx_pyansys_geometry(switcher_version: str): """Auxiliary method to build the intersphinx mapping for PyAnsys Geometry. - Notes - ----- - If the objects.inv file is not found whenever it is a release, the method - will default to the "dev" version. If the objects.inv file is not found - for the "dev" version, the method will return an empty string. - Parameters ---------- switcher_version : str @@ -99,6 +93,12 @@ def intersphinx_pyansys_geometry(switcher_version: str): ------- str The intersphinx mapping for PyAnsys Geometry. + + Notes + ----- + If the objects.inv file is not found whenever it is a release, the method + will default to the "dev" version. If the objects.inv file is not found + for the "dev" version, the method will return an empty string. """ prefix = "https://geometry.docs.pyansys.com/version" @@ -230,13 +230,22 @@ def intersphinx_pyansys_geometry(switcher_version: str): "GL10", # reST directives {directives} must be followed by two colons "SS01", # No summary found "SS02", # Summary does not start with a capital letter - # "SS03", # Summary does not end with a period + "SS03", # Summary does not end with a period "SS04", # Summary contains heading whitespaces # "SS05", # Summary must start with infinitive verb, not third person "RT02", # The first line of the Returns section should contain only the # type, unless multiple values are being returned" } +# Ignoring numpydoc validation on built-in methods from Python +numpydoc_validation_exclude = { + "add_note", + "isEnabledFor", + "validate", + "__cause__", + "__context__", +} + # static path html_static_path = ["_static"] diff --git a/src/ansys/geometry/core/connection/docker_instance.py b/src/ansys/geometry/core/connection/docker_instance.py index 846355dd1c..e93dc52621 100644 --- a/src/ansys/geometry/core/connection/docker_instance.py +++ b/src/ansys/geometry/core/connection/docker_instance.py @@ -115,15 +115,15 @@ class LocalDockerInstance: def docker_client() -> "DockerClient": """Get the initialized ``__DOCKER_CLIENT__`` object. - Notes - ----- - The ``LocalDockerInstance`` class performs a lazy initialization of the - ``__DOCKER_CLIENT__`` class variable. - Returns ------- ~docker.client.DockerClient Initialized Docker client. + + Notes + ----- + The ``LocalDockerInstance`` class performs a lazy initialization of the + ``__DOCKER_CLIENT__`` class variable. """ if not LocalDockerInstance.__DOCKER_CLIENT__: LocalDockerInstance.__DOCKER_CLIENT__ = DockerClient.from_env() @@ -327,10 +327,6 @@ def existed_previously(self) -> bool: def get_geometry_container_type(instance: LocalDockerInstance) -> GeometryContainers | None: """Provide back the ``GeometryContainers`` value. - Notes - ----- - This method returns the first hit on the available tags. - Parameters ---------- instance : LocalDockerInstance @@ -341,6 +337,10 @@ def get_geometry_container_type(instance: LocalDockerInstance) -> GeometryContai GeometryContainers or None The GeometryContainer value corresponding to the previous image or None if not match. + + Notes + ----- + This method returns the first hit on the available tags. """ for tag in instance.container.image.tags: for geom_services in GeometryContainers: diff --git a/src/ansys/geometry/core/connection/launcher.py b/src/ansys/geometry/core/connection/launcher.py index 6475932ab9..1a08e80afa 100644 --- a/src/ansys/geometry/core/connection/launcher.py +++ b/src/ansys/geometry/core/connection/launcher.py @@ -550,6 +550,11 @@ def launch_modeler_with_geometry_service( Placeholder to prevent errors when passing additional arguments that are not compatible with this method. + Returns + ------- + Modeler + Instance of the Geometry service. + Raises ------ ConnectionError @@ -559,11 +564,6 @@ def launch_modeler_with_geometry_service( If there is not an Ansys product 24.1 version or later installed a SystemError will be raised. - Returns - ------- - Modeler - Instance of the Geometry service. - Examples -------- Starting a geometry service with the default parameters and getting back a ``Modeler`` @@ -683,6 +683,11 @@ def launch_modeler_with_discovery( Placeholder to prevent errors when passing additional arguments that are not compatible with this method. + Returns + ------- + Modeler + Instance of the Geometry service. + Raises ------ ConnectionError @@ -692,11 +697,6 @@ def launch_modeler_with_discovery( or if a specific product's version is requested but not installed locally then a SystemError will be raised. - Returns - ------- - Modeler - Instance of the Geometry service. - Examples -------- Starting an Ansys Discovery session with the default parameters and getting back a ``Modeler`` @@ -810,6 +810,11 @@ def launch_modeler_with_spaceclaim( Placeholder to prevent errors when passing additional arguments that are not compatible with this method. + Returns + ------- + Modeler + Instance of the Geometry service. + Raises ------ ConnectionError @@ -819,11 +824,6 @@ def launch_modeler_with_spaceclaim( or if a specific product's version is requested but not installed locally then a SystemError will be raised. - Returns - ------- - Modeler - Instance of the Geometry service. - Examples -------- Starting an Ansys SpaceClaim session with the default parameters and get back a ``Modeler`` diff --git a/src/ansys/geometry/core/connection/product_instance.py b/src/ansys/geometry/core/connection/product_instance.py index b4808c0373..2f18545ff8 100644 --- a/src/ansys/geometry/core/connection/product_instance.py +++ b/src/ansys/geometry/core/connection/product_instance.py @@ -237,6 +237,11 @@ def prepare_and_start_backend( logs_folder : str, optional DEPRECATED. Use ``server_logs_folder`` instead. + Returns + ------- + Modeler + Instance of the Geometry service. + Raises ------ ConnectionError @@ -245,11 +250,6 @@ def prepare_and_start_backend( If there is not an Ansys product 24.1 version or later installed or if a specific product's version is requested but not installed locally then a SystemError will be raised. - - Returns - ------- - Modeler - Instance of the Geometry service. """ from ansys.geometry.core.modeler import Modeler @@ -464,10 +464,6 @@ def _manifest_path_provider( def __start_program(args: list[str], local_env: dict[str, str]) -> subprocess.Popen: """Start the program. - Notes - ----- - The path is the first item of the ``args`` array argument. - Parameters ---------- args : list[str] @@ -480,6 +476,10 @@ def __start_program(args: list[str], local_env: dict[str, str]) -> subprocess.Po ------- subprocess.Popen The subprocess object. + + Notes + ----- + The path is the first item of the ``args`` array argument. """ # private method and controlled input by library - excluding bandit check. return subprocess.Popen( # nosec B603 diff --git a/src/ansys/geometry/core/designer/body.py b/src/ansys/geometry/core/designer/body.py index d1738a3fde..4f5414812b 100644 --- a/src/ansys/geometry/core/designer/body.py +++ b/src/ansys/geometry/core/designer/body.py @@ -310,16 +310,16 @@ def project_curves( Whether to project only one curve of the entire sketch. When ``True``, only one curve is projected. + Returns + ------- + list[Face] + All faces from the project curves operation. + Notes ----- The ``only_one_curve`` parameter allows you to optimize the server call because projecting curves is an expensive operation. This reduces the workload on the server side. - - Returns - ------- - list[Face] - All faces from the project curves operation. """ return @@ -350,16 +350,16 @@ def imprint_projected_curves( Whether to project only one curve of the entire sketch. When ``True``, only one curve is projected. + Returns + ------- + list[Face] + All imprinted faces from the operation. + Notes ----- The ``only_one_curve`` parameter allows you to optimize the server call because projecting curves is an expensive operation. This reduces the workload on the server side. - - Returns - ------- - list[Face] - All imprinted faces from the operation. """ return @@ -408,15 +408,15 @@ def rotate( def scale(self, value: Real) -> None: """Scale the geometry body by the given value. - Notes - ----- - The calling object is directly modified when this method is called. - Thus, it is important to make copies if needed. - Parameters ---------- value: Real Value to scale the body by. + + Notes + ----- + The calling object is directly modified when this method is called. + Thus, it is important to make copies if needed. """ return @@ -424,15 +424,15 @@ def scale(self, value: Real) -> None: def map(self, frame: Frame) -> None: """Map the geometry body to the new specified frame. - Notes - ----- - The calling object is directly modified when this method is called. - Thus, it is important to make copies if needed. - Parameters ---------- frame: Frame Structure defining the orientation of the body. + + Notes + ----- + The calling object is directly modified when this method is called. + Thus, it is important to make copies if needed. """ return @@ -440,15 +440,15 @@ def map(self, frame: Frame) -> None: def mirror(self, plane: Plane) -> None: """Mirror the geometry body across the specified plane. - Notes - ----- - The calling object is directly modified when this method is called. - Thus, it is important to make copies if needed. - Parameters ---------- plane: Plane Represents the mirror. + + Notes + ----- + The calling object is directly modified when this method is called. + Thus, it is important to make copies if needed. """ return @@ -601,13 +601,6 @@ def plot( def intersect(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False) -> None: """Intersect two (or more) bodies. - Notes - ----- - The ``self`` parameter is directly modified with the result, and - the ``other`` parameter is consumed. Thus, it is important to make - copies if needed. If the ``keep_other`` parameter is set to ``True``, - the intersected body is retained. - Parameters ---------- other : Body @@ -619,19 +612,19 @@ def intersect(self, other: Union["Body", Iterable["Body"]], keep_other: bool = F ------ ValueError If the bodies do not intersect. - """ - return - - @protect_grpc - def subtract(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False) -> None: - """Subtract two (or more) bodies. Notes ----- The ``self`` parameter is directly modified with the result, and the ``other`` parameter is consumed. Thus, it is important to make copies if needed. If the ``keep_other`` parameter is set to ``True``, - the subtracted body is retained. + the intersected body is retained. + """ + return + + @protect_grpc + def subtract(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False) -> None: + """Subtract two (or more) bodies. Parameters ---------- @@ -644,19 +637,19 @@ def subtract(self, other: Union["Body", Iterable["Body"]], keep_other: bool = Fa ------ ValueError If the subtraction results in an empty (complete) subtraction. - """ - return - - @protect_grpc - def unite(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False) -> None: - """Unite two (or more) bodies. Notes ----- The ``self`` parameter is directly modified with the result, and the ``other`` parameter is consumed. Thus, it is important to make copies if needed. If the ``keep_other`` parameter is set to ``True``, - the united body is retained. + the subtracted body is retained. + """ + return + + @protect_grpc + def unite(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False) -> None: + """Unite two (or more) bodies. Parameters ---------- @@ -664,6 +657,13 @@ def unite(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False Body to unite with the ``self`` parameter. keep_other : bool, default: False Whether to retain the united body or not. + + Notes + ----- + The ``self`` parameter is directly modified with the result, and + the ``other`` parameter is consumed. Thus, it is important to make + copies if needed. If the ``keep_other`` parameter is set to ``True``, + the united body is retained. """ return diff --git a/src/ansys/geometry/core/designer/component.py b/src/ansys/geometry/core/designer/component.py index a4e81f3871..50520f2922 100644 --- a/src/ansys/geometry/core/designer/component.py +++ b/src/ansys/geometry/core/designer/component.py @@ -362,11 +362,6 @@ def modify_placement( ): """Apply a translation and/or rotation to the placement matrix. - Notes - ----- - To reset a component's placement to an identity matrix, see - :func:`reset_placement()` or call :func:`modify_placement()` with no arguments. - Parameters ---------- translation : Vector3D, default: None @@ -377,6 +372,11 @@ def modify_placement( Direction of the axis to rotate the component about. rotation_angle : ~pint.Quantity | Angle | Real, default: 0 Angle to rotate the component around the axis. + + Notes + ----- + To reset a component's placement to an identity matrix, see + :func:`reset_placement()` or call :func:`modify_placement()` with no arguments. """ t = ( Direction(x=translation.x, y=translation.y, z=translation.z) @@ -487,10 +487,6 @@ def extrude_sketch( ) -> Body | None: """Create a solid body by extruding the sketch profile a distance. - Notes - ----- - The newly created body is placed under this component within the design assembly. - Parameters ---------- name : str @@ -513,6 +509,10 @@ def extrude_sketch( Extruded body from the given sketch. None If the cut parameter is ``True``, the function returns ``None``. + + Notes + ----- + The newly created body is placed under this component within the design assembly. """ # Sanity checks on inputs distance = distance if isinstance(distance, Distance) else Distance(distance) @@ -570,10 +570,6 @@ def sweep_sketch( ) -> Body: """Create a body by sweeping a planar profile along a path. - Notes - ----- - The newly created body is placed under this component within the design assembly. - Parameters ---------- name : str @@ -587,6 +583,10 @@ def sweep_sketch( ------- Body Created body from the given sketch. + + Notes + ----- + The newly created body is placed under this component within the design assembly. """ # Convert each ``TrimmedCurve`` in path to equivalent gRPC type path_grpc = [] @@ -620,10 +620,6 @@ def sweep_chain( ) -> Body: """Create a body by sweeping a chain of curves along a path. - Notes - ----- - The newly created body is placed under this component within the design assembly. - Parameters ---------- name : str @@ -637,6 +633,10 @@ def sweep_chain( ------- Body Created body from the given sketch. + + Notes + ----- + The newly created body is placed under this component within the design assembly. """ # Convert each ``TrimmedCurve`` in path and chain to equivalent gRPC types path_grpc = [trimmed_curve_to_grpc_trimmed_curve(tc) for tc in path] @@ -723,12 +723,6 @@ def extrude_face( There are no modifications against the body containing the source face. - Notes - ----- - The source face can be anywhere within the design component hierarchy. - Therefore, there is no validation requiring that the face is placed under the - target component where the body is to be created. - Parameters ---------- name : str @@ -746,6 +740,12 @@ def extrude_face( ------- Body Extruded solid body. + + Notes + ----- + The source face can be anywhere within the design component hierarchy. + Therefore, there is no validation requiring that the face is placed under the + target component where the body is to be created. """ # Sanity checks on inputs distance = distance if isinstance(distance, Distance) else Distance(distance) @@ -917,12 +917,6 @@ def create_surface(self, name: str, sketch: Sketch) -> Body: def create_surface_from_face(self, name: str, face: Face) -> Body: """Create a surface body based on a face. - Notes - ----- - The source face can be anywhere within the design component hierarchy. - Therefore, there is no validation requiring that the face is placed under the - target component where the body is to be created. - Parameters ---------- name : str @@ -934,6 +928,12 @@ def create_surface_from_face(self, name: str, face: Face) -> Body: ------- Body Surface body. + + Notes + ----- + The source face can be anywhere within the design component hierarchy. + Therefore, there is no validation requiring that the face is placed under the + target component where the body is to be created. """ # Take the face source directly. No need to verify the source of the face. request = CreateBodyFromFaceRequest( @@ -959,11 +959,6 @@ def create_surface_from_face(self, name: str, face: Face) -> Body: def create_body_from_surface(self, name: str, trimmed_surface: TrimmedSurface) -> Body: """Create a surface body from a trimmed surface. - Notes - ----- - It is possible to create a closed solid body (as opposed to an open surface body) with a - Sphere or Torus if they are untrimmed. This can be validated with `body.is_surface`. - Parameters ---------- name : str @@ -975,6 +970,11 @@ def create_body_from_surface(self, name: str, trimmed_surface: TrimmedSurface) - ------- Body Surface body. + + Notes + ----- + It is possible to create a closed solid body (as opposed to an open surface body) with a + Sphere or Torus if they are untrimmed. This can be validated with `body.is_surface`. """ surface = trimmed_surface_to_grpc_trimmed_surface(trimmed_surface) request = CreateSurfaceBodyRequest( @@ -1023,11 +1023,6 @@ def translate_bodies( ) -> None: """Translate the bodies in a specified direction by a distance. - Notes - ----- - If the body does not belong to this component (or its children), it - is not translated. - Parameters ---------- bodies: list[Body] @@ -1040,6 +1035,11 @@ def translate_bodies( Returns ------- None + + Notes + ----- + If the body does not belong to this component (or its children), it + is not translated. """ body_ids_found = [] @@ -1075,17 +1075,17 @@ def create_beams( ) -> list[Beam]: """Create beams under the component. - Notes - ----- - The newly created beams synchronize to a design within a supporting - Geometry service instance. - Parameters ---------- segments : list[tuple[Point3D, Point3D]] list of start and end pairs, each specifying a single line segment. profile : BeamProfile Beam profile to use to create the beams. + + Notes + ----- + The newly created beams synchronize to a design within a supporting + Geometry service instance. """ request = CreateBeamSegmentsRequest(parent=self.id, profile=profile.id) @@ -1134,15 +1134,15 @@ def create_beam(self, start: Point3D, end: Point3D, profile: BeamProfile) -> Bea def delete_component(self, component: Union["Component", str]) -> None: """Delete a component (itself or its children). - Notes - ----- - If the component is not this component (or its children), it - is not deleted. - Parameters ---------- component : Component | str ID of the component or instance to delete. + + Notes + ----- + If the component is not this component (or its children), it + is not deleted. """ id = component if isinstance(component, str) else component.id component_requested = self.search_component(id) @@ -1169,15 +1169,15 @@ def delete_component(self, component: Union["Component", str]) -> None: def delete_body(self, body: Body | str) -> None: """Delete a body belonging to this component (or its children). - Notes - ----- - If the body does not belong to this component (or its children), it - is not deleted. - Parameters ---------- body : Body | str ID of the body or instance to delete. + + Notes + ----- + If the body does not belong to this component (or its children), it + is not deleted. """ id = body if isinstance(body, str) else body.id body_requested = self.search_body(id) @@ -1257,16 +1257,16 @@ def add_design_points( def delete_beam(self, beam: Beam | str) -> None: """Delete an existing beam belonging to this component's scope. + Parameters + ---------- + beam : Beam | str + ID of the beam or instance to delete. + Notes ----- If the beam belongs to this component's children, it is deleted. If the beam does not belong to this component (or its children), it is not deleted. - - Parameters - ---------- - beam : Beam | str - ID of the beam or instance to delete. """ id = beam if isinstance(beam, str) else beam.id beam_requested = self.search_beam(id) @@ -1323,11 +1323,6 @@ def search_component(self, id: str) -> Union["Component", None]: def search_body(self, id: str) -> Body | None: """Search bodies in the component's scope. - Notes - ----- - This method searches for bodies in the component and nested components - recursively. - Parameters ---------- id : str @@ -1337,6 +1332,11 @@ def search_body(self, id: str) -> Body | None: ------- Body | None Body with the requested ID. If the ID is not found, ``None`` is returned. + + Notes + ----- + This method searches for bodies in the component and nested components + recursively. """ # Search in component's bodies for body in self.bodies: @@ -1357,11 +1357,6 @@ def search_body(self, id: str) -> Body | None: def search_beam(self, id: str) -> Beam | None: """Search beams in the component's scope. - Notes - ----- - This method searches for beams in the component and nested components - recursively. - Parameters ---------- id : str @@ -1371,6 +1366,11 @@ def search_beam(self, id: str) -> Beam | None: ------- Beam | None Beam with the requested ID. If the ID is not found, ``None`` is returned. + + Notes + ----- + This method searches for beams in the component and nested components + recursively. """ # Search in component's beams for beam in self.beams: diff --git a/src/ansys/geometry/core/designer/design.py b/src/ansys/geometry/core/designer/design.py index 449c4970ee..4809e99c22 100644 --- a/src/ansys/geometry/core/designer/design.py +++ b/src/ansys/geometry/core/designer/design.py @@ -588,11 +588,6 @@ def delete_named_selection(self, named_selection: NamedSelection | str) -> None: def delete_component(self, component: Union["Component", str]) -> None: """Delete a component (itself or its children). - Notes - ----- - If the component is not this component (or its children), it - is not deleted. - Parameters ---------- id : Union[Component, str] @@ -602,6 +597,11 @@ def delete_component(self, component: Union["Component", str]) -> None: ------ ValueError The design itself cannot be deleted. + + Notes + ----- + If the component is not this component (or its children), it + is not deleted. """ id = component if isinstance(component, str) else component.id if id == self.id: diff --git a/src/ansys/geometry/core/designer/face.py b/src/ansys/geometry/core/designer/face.py index 144ed36417..9c0191e905 100644 --- a/src/ansys/geometry/core/designer/face.py +++ b/src/ansys/geometry/core/designer/face.py @@ -84,11 +84,6 @@ class FaceLoopType(Enum): class FaceLoop: """Provides an internal class holding the face loops defined. - Notes - ----- - This class is to be used only when parsing server side results. It is not - intended to be instantiated by a user. - Parameters ---------- type : FaceLoopType @@ -101,6 +96,11 @@ class FaceLoop: Maximum point of the bounding box containing the loop. edges : list[Edge] Edges contained in the loop. + + Notes + ----- + This class is to be used only when parsing server side results. It is not + intended to be instantiated by a user. """ def __init__( @@ -291,12 +291,6 @@ def loops(self) -> list[FaceLoop]: def normal(self, u: float = 0.5, v: float = 0.5) -> UnitVector3D: """Get the normal direction to the face at certain UV coordinates. - Notes - ----- - To properly use this method, you must handle UV coordinates. Thus, you must - know how these relate to the underlying Geometry service. It is an advanced - method for Geometry experts only. - Parameters ---------- u : float, default: 0.5 @@ -312,6 +306,12 @@ def normal(self, u: float = 0.5, v: float = 0.5) -> UnitVector3D: :class:`UnitVector3D` object evaluated at the given U and V coordinates. This :class:`UnitVector3D` object is perpendicular to the surface at the given UV coordinates. + + Notes + ----- + To properly use this method, you must handle UV coordinates. Thus, you must + know how these relate to the underlying Geometry service. It is an advanced + method for Geometry experts only. """ try: return self.shape.normal(u, v) @@ -325,10 +325,6 @@ def normal(self, u: float = 0.5, v: float = 0.5) -> UnitVector3D: def face_normal(self, u: float = 0.5, v: float = 0.5) -> UnitVector3D: # [deprecated-method] """Get the normal direction to the face at certain UV coordinates. - Notes - ----- - This method is deprecated. Use the ``normal`` method instead. - Parameters ---------- u : float, default: 0.5 @@ -344,6 +340,10 @@ def face_normal(self, u: float = 0.5, v: float = 0.5) -> UnitVector3D: # [depre :class:`UnitVector3D` object evaluated at the given U and V coordinates. This :class:`UnitVector3D` object is perpendicular to the surface at the given UV coordinates. + + Notes + ----- + This method is deprecated. Use the ``normal`` method instead. """ return self.normal(u, v) @@ -352,12 +352,6 @@ def face_normal(self, u: float = 0.5, v: float = 0.5) -> UnitVector3D: # [depre def point(self, u: float = 0.5, v: float = 0.5) -> Point3D: """Get a point of the face evaluated at certain UV coordinates. - Notes - ----- - To properly use this method, you must handle UV coordinates. Thus, you must - know how these relate to the underlying Geometry service. It is an advanced - method for Geometry experts only. - Parameters ---------- u : float, default: 0.5 @@ -371,6 +365,12 @@ def point(self, u: float = 0.5, v: float = 0.5) -> Point3D: ------- Point3D :class:`Point3D` object evaluated at the given UV coordinates. + + Notes + ----- + To properly use this method, you must handle UV coordinates. Thus, you must + know how these relate to the underlying Geometry service. It is an advanced + method for Geometry experts only. """ try: return self.shape.evaluate_proportion(u, v).position @@ -384,10 +384,6 @@ def point(self, u: float = 0.5, v: float = 0.5) -> Point3D: def face_point(self, u: float = 0.5, v: float = 0.5) -> Point3D: """Get a point of the face evaluated at certain UV coordinates. - Notes - ----- - This method is deprecated. Use the ``point`` method instead. - Parameters ---------- u : float, default: 0.5 @@ -401,6 +397,10 @@ def face_point(self, u: float = 0.5, v: float = 0.5) -> Point3D: ------- Point3D :class:`Point3D` object evaluated at the given UV coordinates. + + Notes + ----- + This method is deprecated. Use the ``point`` method instead. """ return self.point(u, v) diff --git a/src/ansys/geometry/core/designer/part.py b/src/ansys/geometry/core/designer/part.py index 850ef70b0e..c6669ad09c 100644 --- a/src/ansys/geometry/core/designer/part.py +++ b/src/ansys/geometry/core/designer/part.py @@ -102,11 +102,6 @@ def __repr__(self) -> str: class MasterComponent: """Represents a part occurrence. - Notes - ----- - This class should not be accessed by users. It holds the fundamental data of - an assembly. Master components wrap parts by adding a transform matrix. - Parameters ---------- id : str @@ -117,6 +112,11 @@ class MasterComponent: Reference to the transformed part's master part. transform : Matrix44 4x4 transformation matrix from the master part. + + Notes + ----- + This class should not be accessed by users. It holds the fundamental data of + an assembly. Master components wrap parts by adding a transform matrix. """ def __init__( diff --git a/src/ansys/geometry/core/math/bbox.py b/src/ansys/geometry/core/math/bbox.py index 3559daafa5..3b8c70ada5 100644 --- a/src/ansys/geometry/core/math/bbox.py +++ b/src/ansys/geometry/core/math/bbox.py @@ -108,15 +108,15 @@ def y_max(self) -> Real: def add_point(self, point: Point2D) -> None: """Extend the ranges of the bounding box to include a point. - Notes - ----- - This method is only applicable if the point components are outside - the current bounds. - Parameters ---------- point : Point2D Point to include within the bounds. + + Notes + ----- + This method is only applicable if the point components are outside + the current bounds. """ self.add_point_components( point.x.m_as(DEFAULT_UNITS.LENGTH), point.y.m_as(DEFAULT_UNITS.LENGTH) @@ -126,17 +126,17 @@ def add_point(self, point: Point2D) -> None: def add_point_components(self, x: Real, y: Real) -> None: """Extend the ranges of the bounding box to include the X and Y values. - Notes - ----- - This method is only applicable if the point components are outside - the current bounds. - Parameters ---------- x : Real Point X component to include within the bounds. y : Real Point Y component to include within the bounds. + + Notes + ----- + This method is only applicable if the point components are outside + the current bounds. """ self._x_min = x if x < self._x_min else self._x_min self._x_max = x if x > self._x_max else self._x_max diff --git a/src/ansys/geometry/core/math/misc.py b/src/ansys/geometry/core/math/misc.py index c480537ad9..59c0566c4d 100644 --- a/src/ansys/geometry/core/math/misc.py +++ b/src/ansys/geometry/core/math/misc.py @@ -48,14 +48,6 @@ def get_two_circle_intersections( r1 : Real Radius of the second circle. - Notes - ----- - This function is based on the following StackOverflow post: - https://stackoverflow.com/questions/55816902/finding-the-intersection-of-two-circles - - That post is based on the following implementation: - https://paulbourke.net/geometry/circlesphere/ - Returns ------- tuple[tuple[Real, Real], tuple[Real, Real]] | None @@ -63,6 +55,14 @@ def get_two_circle_intersections( The points are returned as ``((x3, y3), (x4, y4))``, where ``(x3, y3)`` and ``(x4, y4)`` are the intersection points of the two circles. If the circles do not intersect, then ``None`` is returned. + + Notes + ----- + This function is based on the following StackOverflow post: + https://stackoverflow.com/questions/55816902/finding-the-intersection-of-two-circles + + That post is based on the following implementation: + https://paulbourke.net/geometry/circlesphere/ """ # circle 1: (x0, y0), radius r0 # circle 2: (x1, y1), radius r1 diff --git a/src/ansys/geometry/core/math/point.py b/src/ansys/geometry/core/math/point.py index dda9805bf1..030d9345d7 100644 --- a/src/ansys/geometry/core/math/point.py +++ b/src/ansys/geometry/core/math/point.py @@ -314,12 +314,6 @@ def base_unit(self) -> Unit: def transform(self, matrix: "Matrix44") -> "Point3D": """Transform the 3D point with a transformation matrix. - Notes - ----- - Transform the ``Point3D`` object by applying the specified 4x4 - transformation matrix and return a new ``Point3D`` object representing the - transformed point. - Parameters ---------- matrix : Matrix44 @@ -330,6 +324,12 @@ def transform(self, matrix: "Matrix44") -> "Point3D": Point3D New 3D point that is the transformed copy of the original 3D point after applying the transformation matrix. + + Notes + ----- + Transform the ``Point3D`` object by applying the specified 4x4 + transformation matrix and return a new ``Point3D`` object representing the + transformed point. """ point_4x1 = np.append(self, 1) result_4x1 = matrix * point_4x1 diff --git a/src/ansys/geometry/core/math/vector.py b/src/ansys/geometry/core/math/vector.py index 631478338f..f24821e883 100644 --- a/src/ansys/geometry/core/math/vector.py +++ b/src/ansys/geometry/core/math/vector.py @@ -141,12 +141,6 @@ def normalize(self) -> "Vector3D": def transform(self, matrix: "Matrix44") -> "Vector3D": """Transform the 3D vector3D with a transformation matrix. - Notes - ----- - Transform the ``Vector3D`` object by applying the specified 4x4 - transformation matrix and return a new ``Vector3D`` object representing the - transformed vector. - Parameters ---------- matrix : Matrix44 @@ -157,6 +151,12 @@ def transform(self, matrix: "Matrix44") -> "Vector3D": Vector3D A new 3D vector that is the transformed copy of the original 3D vector after applying the transformation matrix. + + Notes + ----- + Transform the ``Vector3D`` object by applying the specified 4x4 + transformation matrix and return a new ``Vector3D`` object representing the + transformed vector. """ vector_4x1 = np.append(self, 1) result_4x1 = matrix * vector_4x1 @@ -253,15 +253,15 @@ class representing the first point. :class:`Point3D ` class representing the second point. - Notes - ----- - The resulting 3D vector is always expressed in ``Point3D`` - base units. - Returns ------- Vector3D 3D vector from ``point_a`` to ``point_b``. + + Notes + ----- + The resulting 3D vector is always expressed in ``Point3D`` + base units. """ return Vector3D(point_b - point_a) @@ -447,15 +447,15 @@ class representing the first point. :class:`Point2D ` class representing the second point. - Notes - ----- - The resulting 2D vector is always expressed in ``Point2D`` - base units. - Returns ------- Vector2D 2D vector from ``point_a`` to ``point_b``. + + Notes + ----- + The resulting 2D vector is always expressed in ``Point2D`` + base units. """ return Vector2D(point_b - point_a) diff --git a/src/ansys/geometry/core/misc/accuracy.py b/src/ansys/geometry/core/misc/accuracy.py index a18e20acfd..3fcde7b63c 100644 --- a/src/ansys/geometry/core/misc/accuracy.py +++ b/src/ansys/geometry/core/misc/accuracy.py @@ -57,15 +57,15 @@ def double_accuracy() -> Real: def length_is_equal(comparison_length: Real, reference_length: Real) -> bool: """Check if the comparison length is equal to the reference length. - Notes - ----- - The check is done up to the constant value specified for ``LENGTH_ACCURACY``. - Returns ------- bool ``True`` if the comparison length is equal to the reference length within the length accuracy, ``False`` otherwise. + + Notes + ----- + The check is done up to the constant value specified for ``LENGTH_ACCURACY``. """ return Accuracy.is_within_tolerance( comparison_length, reference_length, LENGTH_ACCURACY, LENGTH_ACCURACY @@ -92,15 +92,15 @@ def compare_with_tolerance( def length_is_greater_than_or_equal(comparison_length: Real, reference_length: Real) -> bool: """Check if the length is greater than the reference length. - Notes - ----- - The check is done up to the constant value specified for ``LENGTH_ACCURACY``. - Returns ------- bool ``True`` if the comparison length is greater than the reference length within the length accuracy, ``False`` otherwise. + + Notes + ----- + The check is done up to the constant value specified for ``LENGTH_ACCURACY``. """ return bool( comparison_length > reference_length @@ -111,15 +111,15 @@ def length_is_greater_than_or_equal(comparison_length: Real, reference_length: R def length_is_less_than_or_equal(comparison_length: Real, reference_length: Real) -> bool: """Check if the length is less than or equal to the reference length. - Notes - ----- - The check is done up to the constant value specified for ``LENGTH_ACCURACY``. - Returns ------- bool ``True`` if the comparison length is less than or equal to the reference length within the length accuracy, ``False`` otherwise. + + Notes + ----- + The check is done up to the constant value specified for ``LENGTH_ACCURACY``. """ return bool( comparison_length < reference_length diff --git a/src/ansys/geometry/core/misc/auxiliary.py b/src/ansys/geometry/core/misc/auxiliary.py index be13ad0404..eb006d93d0 100644 --- a/src/ansys/geometry/core/misc/auxiliary.py +++ b/src/ansys/geometry/core/misc/auxiliary.py @@ -117,11 +117,6 @@ def __traverse_all_bodies(comp: Union["Design", "Component"]) -> list["Body"]: This is a private method. Do not use it directly. - Notes - ----- - This method is a recursive helper function to traverse all bodies in a - design and all its subcomponents. - Parameters ---------- design : Design @@ -131,6 +126,11 @@ def __traverse_all_bodies(comp: Union["Design", "Component"]) -> list["Body"]: ------- list[Body] List of all bodies in the design or component. + + Notes + ----- + This method is a recursive helper function to traverse all bodies in a + design and all its subcomponents. """ bodies = [] bodies.extend(comp.bodies) @@ -143,10 +143,6 @@ def __traverse_all_bodies(comp: Union["Design", "Component"]) -> list["Body"]: def get_bodies_from_ids(design: "Design", body_ids: list[str]) -> list["Body"]: """Find the ``Body`` objects inside a ``Design`` from its ids. - Notes - ----- - This method takes a design and body ids, and gets their corresponding ``Body`` object. - Parameters ---------- design : Design @@ -158,6 +154,10 @@ def get_bodies_from_ids(design: "Design", body_ids: list[str]) -> list["Body"]: ------- list[Body] List of Body objects. + + Notes + ----- + This method takes a design and body ids, and gets their corresponding ``Body`` object. """ return [body for body in __traverse_all_bodies(design) if body.id in body_ids] @@ -165,10 +165,6 @@ def get_bodies_from_ids(design: "Design", body_ids: list[str]) -> list["Body"]: def get_faces_from_ids(design: "Design", face_ids: list[str]) -> list["Face"]: """Find the ``Face`` objects inside a ``Design`` from its ids. - Notes - ----- - This method takes a design and face ids, and gets their corresponding ``Face`` object. - Parameters ---------- design : Design @@ -180,6 +176,10 @@ def get_faces_from_ids(design: "Design", face_ids: list[str]) -> list["Face"]: ------- list[Face] List of Face objects. + + Notes + ----- + This method takes a design and face ids, and gets their corresponding ``Face`` object. """ return [ face for body in __traverse_all_bodies(design) for face in body.faces if face.id in face_ids @@ -189,10 +189,6 @@ def get_faces_from_ids(design: "Design", face_ids: list[str]) -> list["Face"]: def get_edges_from_ids(design: "Design", edge_ids: list[str]) -> list["Edge"]: """Find the ``Edge`` objects inside a ``Design`` from its ids. - Notes - ----- - This method takes a design and edge ids, and gets their corresponding ``Edge`` objects. - Parameters ---------- design : Design @@ -204,6 +200,10 @@ def get_edges_from_ids(design: "Design", edge_ids: list[str]) -> list["Edge"]: ------- list[Edge] List of Edge objects. + + Notes + ----- + This method takes a design and edge ids, and gets their corresponding ``Edge`` objects. """ return [ edge for body in __traverse_all_bodies(design) for edge in body.edges if edge.id in edge_ids diff --git a/src/ansys/geometry/core/modeler.py b/src/ansys/geometry/core/modeler.py index 4b994ec5d6..e7f98b1648 100644 --- a/src/ansys/geometry/core/modeler.py +++ b/src/ansys/geometry/core/modeler.py @@ -242,15 +242,15 @@ def close(self, close_designs: bool = True) -> None: def exit(self, close_designs: bool = True) -> None: """Access the client's close method. - Notes - ----- - This method is calling the same method as - :func:`close() `. - Parameters ---------- close_designs : bool, default: True Whether to close all designs before closing the client. + + Notes + ----- + This method is calling the same method as + :func:`close() `. """ self.close(close_designs=close_designs) @@ -262,11 +262,6 @@ def _upload_file( ) -> str: """Upload a file from the client to the server. - Notes - ----- - This method creates a file on the server that has the same name and extension - as the file on the client. - Parameters ---------- file_path : str @@ -280,6 +275,11 @@ def _upload_file( ------- file_path : str Full path of the file uploaded to the server. + + Notes + ----- + This method creates a file on the server that has the same name and extension + as the file on the client. """ from pathlib import Path @@ -425,12 +425,6 @@ def run_discovery_script_file( an error. If you are using Discovery or SpaceClaim, the product will determine the API version to use, so there is no need to specify this parameter. - Notes - ----- - The Ansys Geometry Service only supports scripts that are of the - same version as the running service. Any ``api_version`` input will - be ignored. - Returns ------- dict[str, str] @@ -443,6 +437,12 @@ def run_discovery_script_file( GeometryRuntimeError If the Discovery script fails to run. Otherwise, assume that the script ran successfully. + + Notes + ----- + The Ansys Geometry Service only supports scripts that are of the + same version as the running service. Any ``api_version`` input will + be ignored. """ # Use str format of Path object here file_path = str(file_path) if isinstance(file_path, Path) else file_path diff --git a/src/ansys/geometry/core/plotting/plotter.py b/src/ansys/geometry/core/plotting/plotter.py index 86e6fe4e34..d19335ea10 100644 --- a/src/ansys/geometry/core/plotting/plotter.py +++ b/src/ansys/geometry/core/plotting/plotter.py @@ -300,11 +300,6 @@ def add_component_by_body( ) -> None: """Add a component on a per body basis. - Notes - ----- - This will allow to make use of the service colors. At the same time, it will be - slower than the add_component method. - Parameters ---------- component : Component @@ -312,6 +307,11 @@ def add_component_by_body( **plotting_options : dict, default: None Keyword arguments. For allowable keyword arguments, see the :meth:`Plotter.add_mesh ` method. + + Notes + ----- + This will allow to make use of the service colors. At the same time, it will be + slower than the add_component method. """ # Recursively add the bodies and components for body in component.bodies: diff --git a/src/ansys/geometry/core/shapes/curves/line.py b/src/ansys/geometry/core/shapes/curves/line.py index 3b12ab4692..3258180ed5 100644 --- a/src/ansys/geometry/core/shapes/curves/line.py +++ b/src/ansys/geometry/core/shapes/curves/line.py @@ -226,14 +226,14 @@ def position(self) -> Point3D: def tangent(self) -> UnitVector3D: """Tangent of the evaluation. - Notes - ----- - This is always equal to the direction of the line. - Returns ------- UnitVector3D Tangent unit vector to the line at this evaluation. + + Notes + ----- + This is always equal to the direction of the line. """ return self.line.direction diff --git a/src/ansys/geometry/core/shapes/parameterization.py b/src/ansys/geometry/core/shapes/parameterization.py index 26a6c08691..754f82b88e 100644 --- a/src/ansys/geometry/core/shapes/parameterization.py +++ b/src/ansys/geometry/core/shapes/parameterization.py @@ -34,18 +34,18 @@ class ParamUV: """ Parameter class containing 2 parameters: (u, v). - Notes - ----- - Likened to a 2D point in UV space Used as an argument in parametric - surface evaluations. This matches the service implementation for the - Geometry service. - Parameters ---------- u : Real - u-parameter. + U parameter. v : Real - v-parameter. + V parameter. + + Notes + ----- + Likened to a 2D point in UV space. Used as an argument in parametric + surface evaluations. This matches the service implementation for the + Geometry service. """ def __init__(self, u: Real, v: Real) -> None: @@ -55,12 +55,12 @@ def __init__(self, u: Real, v: Real) -> None: @property def u(self) -> Real: - """u-parameter.""" + """U parameter.""" return self._u @property def v(self) -> Real: - """v-parameter.""" + """V parameter.""" return self._v @check_input_types diff --git a/src/ansys/geometry/core/shapes/surfaces/cylinder.py b/src/ansys/geometry/core/shapes/surfaces/cylinder.py index c0d4ae9595..3855b2f8ae 100644 --- a/src/ansys/geometry/core/shapes/surfaces/cylinder.py +++ b/src/ansys/geometry/core/shapes/surfaces/cylinder.py @@ -111,13 +111,6 @@ def dir_z(self) -> UnitVector3D: def surface_area(self, height: Quantity | Distance | Real) -> Quantity: """Get the surface area of the cylinder. - Notes - ----- - By nature, a cylinder is infinite. If you want to get the surface area, - you must bound it by a height. Normally a cylinder surface is not closed - (does not have "caps" on the ends). This method assumes that the cylinder - is closed for the purpose of getting the surface area. - Parameters ---------- height : ~pint.Quantity | Distance | Real @@ -127,6 +120,13 @@ def surface_area(self, height: Quantity | Distance | Real) -> Quantity: ------- ~pint.Quantity Surface area of the temporarily bounded cylinder. + + Notes + ----- + By nature, a cylinder is infinite. If you want to get the surface area, + you must bound it by a height. Normally a cylinder surface is not closed + (does not have "caps" on the ends). This method assumes that the cylinder + is closed for the purpose of getting the surface area. """ height = height if isinstance(height, Distance) else Distance(height) if height.value <= 0: @@ -137,13 +137,6 @@ def surface_area(self, height: Quantity | Distance | Real) -> Quantity: def volume(self, height: Quantity | Distance | Real) -> Quantity: """Get the volume of the cylinder. - Notes - ----- - By nature, a cylinder is infinite. If you want to get the surface area, - you must bound it by a height. Normally a cylinder surface is not closed - (does not have "caps" on the ends). This method assumes that the cylinder - is closed for the purpose of getting the surface area. - Parameters ---------- height : ~pint.Quantity | Distance | Real @@ -153,6 +146,13 @@ def volume(self, height: Quantity | Distance | Real) -> Quantity: ------- ~pint.Quantity Volume of the temporarily bounded cylinder. + + Notes + ----- + By nature, a cylinder is infinite. If you want to get the surface area, + you must bound it by a height. Normally a cylinder surface is not closed + (does not have "caps" on the ends). This method assumes that the cylinder + is closed for the purpose of getting the surface area. """ height = height if isinstance(height, Distance) else Distance(height) if height.value <= 0: diff --git a/src/ansys/geometry/core/sketch/arc.py b/src/ansys/geometry/core/sketch/arc.py index 7b968b97dc..5f61e9fa4c 100644 --- a/src/ansys/geometry/core/sketch/arc.py +++ b/src/ansys/geometry/core/sketch/arc.py @@ -148,15 +148,15 @@ def sector_area(self) -> Quantity: def visualization_polydata(self) -> pv.PolyData: """VTK polydata representation for PyVista visualization. - Notes - ----- - The representation lies in the X/Y plane within - the standard global Cartesian coordinate system. - Returns ------- pyvista.PolyData VTK pyvista.Polydata configuration. + + Notes + ----- + The representation lies in the X/Y plane within + the standard global Cartesian coordinate system. """ if np.isclose(self.angle, np.pi): # PyVista hack... Maybe worth implementing something in PyVista... @@ -201,6 +201,11 @@ def __ne__(self, other: "Arc") -> bool: def __arc_pyvista_hack(self): """Hack for close to PI arcs. + Returns + ------- + pyvista.PolyData + VTK pyvista.Polydata configuration. + Notes ----- PyVista does not know whether the rotation is @@ -209,11 +214,6 @@ def __arc_pyvista_hack(self): This means that the arc must be divided in two so that it is properly defined based on the known sense of rotation. - - Returns - ------- - pyvista.PolyData - VTK pyvista.Polydata configuration. """ # Define the arc mid point if not self.is_clockwise: diff --git a/src/ansys/geometry/core/sketch/circle.py b/src/ansys/geometry/core/sketch/circle.py index 26c2174688..264e6d7e0f 100644 --- a/src/ansys/geometry/core/sketch/circle.py +++ b/src/ansys/geometry/core/sketch/circle.py @@ -126,14 +126,14 @@ def visualization_polydata(self) -> pv.PolyData: def plane_change(self, plane: Plane) -> None: """Redefine the plane containing the ``SketchCircle`` objects. - Notes - ----- - This implies that their 3D definition might suffer changes. - Parameters ---------- plane : Plane Desired new plane that is to contain the sketched circle. + + Notes + ----- + This implies that their 3D definition might suffer changes. """ # Reinitialize the circle definition for the given plane self._init_primitive_circle_from_plane(plane) diff --git a/src/ansys/geometry/core/sketch/edge.py b/src/ansys/geometry/core/sketch/edge.py index b867cc391c..9eedec3ed6 100644 --- a/src/ansys/geometry/core/sketch/edge.py +++ b/src/ansys/geometry/core/sketch/edge.py @@ -67,15 +67,15 @@ def visualization_polydata(self) -> pv.PolyData: def plane_change(self, plane: "Plane") -> None: """Redefine the plane containing ``SketchEdge`` objects. + Parameters + ---------- + plane : Plane + Desired new plane that is to contain the sketched edge. + Notes ----- This implies that their 3D definition might suffer changes. By default, this metho does nothing. It is required to be implemented in child ``SketchEdge`` classes. - - Parameters - ---------- - plane : Plane - Desired new plane that is to contain the sketched edge. """ pass diff --git a/src/ansys/geometry/core/sketch/ellipse.py b/src/ansys/geometry/core/sketch/ellipse.py index eebf2ee543..d6a4bf26a3 100644 --- a/src/ansys/geometry/core/sketch/ellipse.py +++ b/src/ansys/geometry/core/sketch/ellipse.py @@ -200,14 +200,14 @@ def visualization_polydata(self) -> pv.PolyData: def plane_change(self, plane: Plane) -> None: """Redefine the plane containing ``SketchEllipse`` objects. - Notes - ----- - This implies that their 3D definition might suffer changes. - Parameters ---------- plane : Plane Desired new plane that is to contain the sketched ellipse. + + Notes + ----- + This implies that their 3D definition might suffer changes. """ # Reinitialize the Circle definition for the given plane self._init_primitive_ellipse_from_plane(plane) diff --git a/src/ansys/geometry/core/sketch/face.py b/src/ansys/geometry/core/sketch/face.py index 451d7e5e52..72fdcd9482 100644 --- a/src/ansys/geometry/core/sketch/face.py +++ b/src/ansys/geometry/core/sketch/face.py @@ -72,14 +72,14 @@ def visualization_polydata(self) -> pv.PolyData: def plane_change(self, plane: "Plane") -> None: """Redefine the plane containing ``SketchFace`` objects. - Notes - ----- - This implies that their 3D definition might suffer changes. This method does - nothing by default. It is required to be implemented in child ``SketchFace`` classes. - Parameters ---------- plane : Plane Desired new plane that is to contain the sketched face. + + Notes + ----- + This implies that their 3D definition might suffer changes. This method does + nothing by default. It is required to be implemented in child ``SketchFace`` classes. """ pass diff --git a/src/ansys/geometry/core/sketch/segment.py b/src/ansys/geometry/core/sketch/segment.py index 8e598f864a..3c71d69514 100644 --- a/src/ansys/geometry/core/sketch/segment.py +++ b/src/ansys/geometry/core/sketch/segment.py @@ -166,14 +166,14 @@ def __ne__(self, other: "SketchSegment") -> bool: def plane_change(self, plane: "Plane") -> None: """Redefine the plane containing ``SketchSegment`` objects. - Notes - ----- - This implies that their 3D definition might suffer changes. - Parameters ---------- plane : Plane Desired new plane that is to contain the sketched segment. + + Notes + ----- + This implies that their 3D definition might suffer changes. """ # Reinitialize the line definition for the given plane self._init_primitive_line_from_plane(plane) diff --git a/src/ansys/geometry/core/sketch/sketch.py b/src/ansys/geometry/core/sketch/sketch.py index 09c44d0a8b..3d00be2a8b 100644 --- a/src/ansys/geometry/core/sketch/sketch.py +++ b/src/ansys/geometry/core/sketch/sketch.py @@ -317,11 +317,6 @@ def segment_from_point_and_vector( ): """Add a segment to the sketch starting from a given starting point. - Notes - ----- - Vector magnitude determines the segment endpoint. - Vector magnitude is assumed to use the same unit as the starting point. - Parameters ---------- start : Point2D @@ -337,6 +332,11 @@ def segment_from_point_and_vector( ------- Sketch Revised sketch state ready for further sketch actions. + + Notes + ----- + Vector magnitude determines the segment endpoint. + Vector magnitude is assumed to use the same unit as the starting point. """ end_vec_as_point = Point2D(vector, start.unit) end = start + end_vec_as_point @@ -613,16 +613,16 @@ def trapezoid( tag : str, default: None User-defined label for identifying the face. + Returns + ------- + Sketch + Revised sketch state ready for further sketch actions. + Notes ----- If an asymmetric base angle is defined, the base angle is applied to the left-most angle, and the asymmetric base angle is applied to the right-most angle. - - Returns - ------- - Sketch - Revised sketch state ready for further sketch actions. """ trapezoid = Trapezoid(base_width, height, base_angle, base_asymmetric_angle, center, angle) return self.face(trapezoid, tag) diff --git a/src/ansys/geometry/core/tools/measurement_tools.py b/src/ansys/geometry/core/tools/measurement_tools.py index 8c6250a4d1..65c41c45dc 100644 --- a/src/ansys/geometry/core/tools/measurement_tools.py +++ b/src/ansys/geometry/core/tools/measurement_tools.py @@ -59,15 +59,15 @@ def distance(self) -> Distance: def _from_distance_response(cls, response: MinDistanceBetweenObjectsResponse) -> "Gap": """Construct ``Gap`` object from distance response. - Notes - ----- - This method is used internally to construct a ``Gap`` object from a - gRPC response. - Parameters ---------- response : MinDistanceBetweenObjectsResponse Response from the gRPC server. + + Notes + ----- + This method is used internally to construct a ``Gap`` object from a + gRPC response. """ distance = Distance(response.gap.distance, unit=DEFAULT_UNITS.LENGTH) return cls(distance)