Skip to content

Commit 24196f3

Browse files
RobPasMuepyansys-ci-botpre-commit-ci[bot]
committed
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 9e30fb5 commit 24196f3

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
@@ -852,6 +852,7 @@ def fill_style(self, value: FillStyle): # noqa: D102
852852

853853
@property
854854
@protect_grpc
855+
@min_backend_version(25, 2, 0)
855856
def is_suppressed(self) -> bool: # noqa: D102
856857
response = self._bodies_stub.IsSuppressed(EntityIdentifier(id=self._id))
857858
return response.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)