Skip to content

Commit d0c3e93

Browse files
RobPasMuepyansys-ci-botpre-commit-ci[bot]
authored
fix: is_suppressed is not available until 25R2 (#1916)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f9e387d commit d0c3e93

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

doc/changelog.d/1916.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
is_suppressed is not available until 25R2

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ def fill_style(self, value: FillStyle): # noqa: D102
853853
self.set_fill_style(value)
854854

855855
@property
856+
@min_backend_version(25, 2, 0)
856857
def is_suppressed(self) -> bool: # noqa: D102
857858
response = self._grpc_client.services.bodies.is_suppressed(id=self.id)
858859
return response.get("result")

src/ansys/geometry/core/plotting/plotter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from ansys.geometry.core.designer.design import Design
4545
from ansys.geometry.core.designer.designpoint import DesignPoint
4646
from ansys.geometry.core.designer.face import Face
47+
from ansys.geometry.core.errors import GeometryRuntimeError
4748
from ansys.geometry.core.logger import LOG
4849
from ansys.geometry.core.math.frame import Frame
4950
from ansys.geometry.core.math.plane import Plane
@@ -248,8 +249,13 @@ def add_body(self, body: Body, merge: bool = False, **plotting_options: dict | N
248249
Keyword arguments. For allowable keyword arguments,
249250
see the :meth:`Plotter.add_mesh <pyvista.Plotter.add_mesh>` method.
250251
"""
251-
if body.is_suppressed:
252-
return
252+
try:
253+
if body.is_suppressed:
254+
return
255+
except GeometryRuntimeError: # pragma: no cover
256+
# For backward compatibility with older versions of PyAnsys Geometry
257+
# Inserted in 25R2
258+
pass
253259

254260
if self.use_service_colors:
255261
faces = body.faces

0 commit comments

Comments
 (0)