Skip to content

Commit 1e12262

Browse files
fix: Revert visualization changes (#2084)
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
1 parent effc0ad commit 1e12262

File tree

8 files changed

+14
-30
lines changed

8 files changed

+14
-30
lines changed

doc/changelog.d/2055.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/changelog.d/2084.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Revert visualization changes

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ dependencies = [
4242

4343
[project.optional-dependencies]
4444
graphics = [
45-
"ansys-tools-visualization-interface>=0.10.0,<1",
45+
"ansys-tools-visualization-interface>=0.2.6",
4646
"pygltflib>=1.16,<2",
4747
"pyvista[jupyter]>=0.38.1,<1",
4848
"vtk>=9,<10",
4949
]
5050
all = [
5151
"ansys-platform-instancemanagement>=1.0.3,<2",
52-
"ansys-tools-visualization-interface>=0.10.0,<1",
52+
"ansys-tools-visualization-interface>=0.2.6",
5353
"docker>=6.0.1,<8",
5454
"pygltflib>=1.16,<2",
5555
"pyvista[jupyter]>=0.38.1,<1",
@@ -58,7 +58,7 @@ all = [
5858
tests = [
5959
"ansys-platform-instancemanagement==1.1.2",
6060
"ansys-tools-path==0.7.3",
61-
"ansys-tools-visualization-interface==0.10.0",
61+
"ansys-tools-visualization-interface==0.11.0",
6262
"beartype==0.21.0",
6363
"docker==7.1.0",
6464
"geomdl==5.4.0",
@@ -87,7 +87,7 @@ tests-minimal = [
8787
doc = [
8888
"ansys-sphinx-theme[autoapi]==1.5.2",
8989
"ansys-tools-path==0.7.3",
90-
"ansys-tools-visualization-interface==0.10.0",
90+
"ansys-tools-visualization-interface==0.11.0",
9191
"beartype==0.21.0",
9292
"docker==7.1.0",
9393
"geomdl==5.4.0",

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ def plot(
687687
screenshot: str | None = None,
688688
use_trame: bool | None = None,
689689
use_service_colors: bool | None = None,
690-
show_options: dict | None = {},
691690
**plotting_options: dict | None,
692691
) -> None:
693692
"""Plot the body.
@@ -709,8 +708,6 @@ def plot(
709708
Whether to use the colors assigned to the body in the service. The default
710709
is ``None``, in which case the ``ansys.geometry.core.USE_SERVICE_COLORS``
711710
global setting is used.
712-
show_options : dict, default: {}
713-
Keyword arguments for the show method of the plotter.
714711
**plotting_options : dict, default: None
715712
Keyword arguments for plotting. For allowable keyword arguments, see the
716713
:meth:`Plotter.add_mesh <pyvista.Plotter.add_mesh>` method.
@@ -1331,7 +1328,6 @@ def plot( # noqa: D102
13311328
screenshot: str | None = None,
13321329
use_trame: bool | None = None,
13331330
use_service_colors: bool | None = None,
1334-
show_options: dict | None = {},
13351331
**plotting_options: dict | None,
13361332
) -> None:
13371333
raise NotImplementedError(
@@ -1796,7 +1792,6 @@ def plot( # noqa: D102
17961792
screenshot: str | None = None,
17971793
use_trame: bool | None = None,
17981794
use_service_colors: bool | None = None,
1799-
show_options: dict | None = {},
18001795
**plotting_options: dict | None,
18011796
) -> None:
18021797
# lazy import here to improve initial module load time
@@ -1828,7 +1823,7 @@ def plot( # noqa: D102
18281823
)
18291824
pl = GeometryPlotter(use_trame=use_trame, use_service_colors=use_service_colors)
18301825
pl.plot(mesh_object, **plotting_options)
1831-
pl.show(screenshot=screenshot, **show_options)
1826+
pl.show(screenshot=screenshot, **plotting_options)
18321827

18331828
def intersect(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False) -> None: # noqa: D102
18341829
if self._template._grpc_client.backend_version < __TEMPORARY_BOOL_OPS_FIX__:

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,6 @@ def plot(
16031603
use_trame: bool | None = None,
16041604
use_service_colors: bool | None = None,
16051605
allow_picking: bool | None = None,
1606-
show_options: dict | None = {},
16071606
**plotting_options: dict | None,
16081607
) -> None | list[Any]:
16091608
"""Plot the component.
@@ -1632,8 +1631,6 @@ def plot(
16321631
allow_picking : bool, default: None
16331632
Whether to enable picking. The default is ``None``, in which case the
16341633
picker is not enabled.
1635-
show_options : dict, default: {}
1636-
Keyword arguments for the show method of the plotter.
16371634
**plotting_options : dict, default: None
16381635
Keyword arguments for plotting. For allowable keyword arguments, see the
16391636
@@ -1721,7 +1718,7 @@ def plot(
17211718
allow_picking=allow_picking,
17221719
)
17231720
pl.plot(self, **plotting_options)
1724-
return pl.show(screenshot=screenshot, **show_options)
1721+
return pl.show(screenshot=screenshot, **plotting_options)
17251722

17261723
def __repr__(self) -> str:
17271724
"""Represent the ``Component`` as a string."""

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,6 @@ def plot(
565565
screenshot: str | None = None,
566566
use_trame: bool | None = None,
567567
use_service_colors: bool | None = None,
568-
show_options: dict | None = {},
569568
**plotting_options: dict | None,
570569
) -> None:
571570
"""Plot the face.
@@ -582,8 +581,6 @@ def plot(
582581
Whether to use the colors assigned to the face in the service. The default
583582
is ``None``, in which case the ``ansys.geometry.core.USE_SERVICE_COLORS``
584583
global setting is used.
585-
show_options : dict, default: {}
586-
Keyword arguments for the show method of the plotter.
587584
**plotting_options : dict, default: None
588585
Keyword arguments for plotting. For allowable keyword arguments, see the
589586
:meth:`Plotter.add_mesh <pyvista.Plotter.add_mesh>` method.
@@ -605,4 +602,4 @@ def plot(
605602
mesh_object = self if use_service_colors else MeshObjectPlot(self, self.tessellate())
606603
pl = GeometryPlotter(use_trame=use_trame, use_service_colors=use_service_colors)
607604
pl.plot(mesh_object, **plotting_options)
608-
pl.show(screenshot=screenshot, **show_options)
605+
pl.show(screenshot=screenshot, **plotting_options)

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@ def show(
505505
self,
506506
plotting_object: Any = None,
507507
screenshot: str | None = None,
508-
plotting_options: dict | None = {},
509-
**show_options: dict | None,
508+
**plotting_options,
510509
) -> None | list[Any]:
511510
"""Show the plotter.
512511
@@ -516,16 +515,13 @@ def show(
516515
Object you can add to the plotter.
517516
screenshot : str, default: None
518517
Path to save a screenshot of the plotter.
519-
plotting_options : dict, default: {}
518+
**plotting_options : dict, default: None
520519
Keyword arguments for the plotter. Arguments depend of the backend implementation
521520
you are using.
522-
**show_options : dict, default: None
523-
Keyword arguments for the show method. Arguments depend of the backend
524-
implementation you are using.
525521
"""
526522
if plotting_object is not None:
527523
self.plot(plotting_object, **plotting_options)
528-
picked_objs = self._backend.show(screenshot=screenshot, **show_options)
524+
picked_objs = self._backend.show(screenshot=screenshot, **plotting_options)
529525

530526
# Return the picked objects if picking is enabled... but as the actual PyAnsys
531527
# Geometry objects (or PyVista objects if not)

src/ansys/geometry/core/sketch/sketch.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,6 @@ def plot(
890890
screenshot: str | None = None,
891891
use_trame: bool | None = None,
892892
selected_pd_objects: list["PolyData"] = None,
893-
show_options: dict | None = {},
894893
**plotting_options: dict | None,
895894
):
896895
"""Plot all objects of the sketch to the scene.
@@ -918,7 +917,7 @@ def plot(
918917
view_2d_dict = {"vector": vector, "viewup": viewup}
919918
else:
920919
view_2d_dict = None
921-
# plotting_options.pop("view_2d", None)
920+
plotting_options.pop("view_2d", None)
922921
if selected_pd_objects is not None:
923922
pl = GeometryPlotter(use_trame=use_trame)
924923
pl.plot(
@@ -929,13 +928,13 @@ def plot(
929928
pl.show(
930929
screenshot=screenshot,
931930
view_2d=view_2d_dict,
932-
**show_options,
931+
**plotting_options,
933932
)
934933
else:
935934
pl = GeometryPlotter(use_trame=use_trame)
936935
pl.plot(self.sketch_polydata_faces(), opacity=0.7, **plotting_options)
937936
pl.plot(self.sketch_polydata_edges(), **plotting_options)
938-
pl.show(screenshot=screenshot, view_2d=view_2d_dict, **show_options)
937+
pl.show(screenshot=screenshot, view_2d=view_2d_dict, **plotting_options)
939938

940939
@graphics_required
941940
def plot_selection(

0 commit comments

Comments
 (0)