Skip to content

Commit

Permalink
fix: replace leading "__" by "_" - faking privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue committed Oct 28, 2024
1 parent 0e3b262 commit 2626a39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ansys/geometry/core/designer/body.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ def copy(self, parent: "Component", name: str = None) -> "Body": # noqa: D102
response.master_id, copy_name, self._grpc_client, is_surface=self.is_surface
)
parent._master_component.part.bodies.append(tb)
parent.__clear_cached_bodies()
parent._clear_cached_bodies()
body_id = f"{parent.id}/{tb.id}" if parent.parent_component else tb.id
return Body(body_id, response.name, parent, tb)

Expand Down
20 changes: 10 additions & 10 deletions src/ansys/geometry/core/designer/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def __init__(

self._master_component.occurrences.append(self)

def __clear_cached_bodies(self) -> None:
def _clear_cached_bodies(self) -> None:
"""Clear the cached bodies."""
if "bodies" in self.__dict__:
del self.__dict__["bodies"]
Expand Down Expand Up @@ -515,7 +515,7 @@ def extrude_sketch(
response = self._bodies_stub.CreateExtrudedBody(request)
tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@min_backend_version(24, 2, 0)
Expand Down Expand Up @@ -565,7 +565,7 @@ def sweep_sketch(
response = self._bodies_stub.CreateSweepingProfile(request)
tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@min_backend_version(24, 2, 0)
Expand Down Expand Up @@ -613,7 +613,7 @@ def sweep_chain(
response = self._bodies_stub.CreateSweepingChain(request)
tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=True)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@min_backend_version(24, 2, 0)
Expand Down Expand Up @@ -729,7 +729,7 @@ def extrude_face(

tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@protect_grpc
Expand Down Expand Up @@ -763,7 +763,7 @@ def create_sphere(self, name: str, center: Point3D, radius: Distance) -> Body:
response = self._bodies_stub.CreateSphereBody(request)
tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@protect_grpc
Expand Down Expand Up @@ -830,7 +830,7 @@ def create_body_from_loft_profile(
response = self._bodies_stub.CreateExtrudedBodyFromLoftProfiles(request)
tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@protect_grpc
Expand Down Expand Up @@ -868,7 +868,7 @@ def create_surface(self, name: str, sketch: Sketch) -> Body:

tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=True)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@protect_grpc
Expand Down Expand Up @@ -909,7 +909,7 @@ def create_surface_from_face(self, name: str, face: Face) -> Body:

tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=True)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@protect_grpc
Expand Down Expand Up @@ -950,7 +950,7 @@ def create_body_from_surface(self, name: str, trimmed_surface: TrimmedSurface) -

tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=response.is_surface)
self._master_component.part.bodies.append(tb)
self.__clear_cached_bodies()
self._clear_cached_bodies()
return Body(response.id, response.name, self, tb)

@check_input_types
Expand Down

0 comments on commit 2626a39

Please sign in to comment.