Skip to content

Commit bf17548

Browse files
Apply suggestions from code review
Co-authored-by: Kathy Pippert <[email protected]>
1 parent bfa6f50 commit bf17548

File tree

2 files changed

+36
-39
lines changed

2 files changed

+36
-39
lines changed

doc/source/user_guide/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ User guide
66

77
This section explains key concepts for implementing the Visualization Interface Tool in your workflow.
88
You can use the Visualization Interface Tool in your examples as well as integrate this library into
9-
your own code. If you need further details on how to migrate from PyVista, please refer to the
10-
:ref:`ref_migration_guide` section.
9+
your own code. For information on how to migrate from PyVista to the Ansys Visualization Interface Tool, see
10+
:ref:`ref_migration_guide`.
1111

1212
Default plotter usage
1313
=====================
@@ -110,7 +110,7 @@ class. After that, see these main use cases for customizing the plotter:
110110
Some practical examples of how to use the ``PlotterInterface`` class are included in some PyAnsys libraries,
111111
such as `PyAnsys Geometry <https://github.com/ansys/pyansys-geometry/pull/959>`_.
112112

113-
An extended migration guide with code examples is available in :ref:`ref_migration_guide`.
113+
For comprehensive migration information with code examples, see :ref:`ref_migration_guide`.
114114

115115

116116
Customizing the picker and hover callbacks

doc/source/user_guide/migration.rst

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,25 @@ Migration
44
#########
55

66
In this section two guides are provided to help you migrate from PyVista plotters to the Ansys Tools Visualization Interface plotters.
7-
The first one addresses code migration, and the second one addresses documentation migration.
87

9-
Code migration guide
10-
====================
8+
Code migration
9+
==============
10+
This topic explains how to migrate from PyVista plotters to the new Ansys Tools Visualization Interface plotters. Because cases vary greatly, it provides a few examples that cover the most common scenarios.
1111

12-
This guide intends to help users transition from PyVista plotters to the new Ansys Tools Visualization Interface plotters. Since cases are very different
13-
from each other, a few examples are provided to cover the most common scenarios.
14-
15-
From simple PyVista mesh plotting to the Ansys visualization interface plotter
16-
------------------------------------------------------------------------------
12+
Replace PyVista plotter code with Ansys Tools Visualization Interface plotter code
13+
----------------------------------------------------------------------------------
1714
If you only need to plot simple PyVista meshes, you can directly replace your PyVista plotter code with the Ansys Tools Visualization Interface plotter code.
18-
On top of common PyVista functionalities, the Ansys Tools Visualization Interface plotter provides additional interactivity such as view buttons, mesh slicing, etc.
19-
Here is an example of how to do this:
15+
On top of common PyVista functionalities, the Ansys Tools Visualization Interface plotter provides additional interactivity such as view buttons and mesh slicing.
16+
17+
The following code shows how to do the plotter code replacement:
2018

2119
- PyVista code:
2220

2321
.. code-block:: python
2422
2523
import pyvista as pv
2624
27-
# Create a pyvista mesh
25+
# Create a PyVista mesh
2826
mesh = pv.Cube()
2927
3028
# Create a plotter
@@ -43,7 +41,7 @@ Here is an example of how to do this:
4341
import pyvista as pv
4442
from ansys.tools.visualization_interface import Plotter
4543
46-
# Create a pyvista mesh
44+
# Create a PyVista mesh
4745
mesh = pv.Cube()
4846
4947
# Create a plotter
@@ -56,10 +54,10 @@ Here is an example of how to do this:
5654
pl.show()
5755
5856
59-
Convert your custom meshes to MeshObjectPlot and use the Ansys visualization interface plotter
60-
----------------------------------------------------------------------------------------------
57+
Convert your custom meshes to objects usable by the Ansys Tools Visualization Interface plotter
58+
-----------------------------------------------------------------------------------------------
6159

62-
Your custom object must have a method that returns a PyVista mesh and a method that exposes a ``name`` or ``id`` attribute of your object.
60+
Your custom object must have a method that returns a PyVista mesh and a method that exposes a ``name`` or ``id`` attribute of your object:
6361

6462
.. code-block:: python
6563
@@ -75,7 +73,7 @@ Your custom object must have a method that returns a PyVista mesh and a method t
7573
return self.name
7674
7775
78-
Then you need to create a ``MeshObjectPlot`` instance that relates the PyVista mesh with your custom object.
76+
You then need to create a ``MeshObjectPlot`` instance that relates the PyVista mesh with your custom object:
7977

8078
.. code-block:: python
8179
@@ -90,11 +88,10 @@ Then you need to create a ``MeshObjectPlot`` instance that relates the PyVista m
9088
With this, you can use the Ansys Tools Visualization Interface plotter to visualize your custom object. It enables interactivity such as picking and hovering.
9189

9290

93-
Customizing the PyVista backend
94-
-------------------------------
91+
Customize the PyVista backend
92+
-----------------------------
9593

96-
You can customize the backend of the Ansys Tools Visualization Interface plotter to enable or turn off certain functionalities. For example,
97-
if you want to enable picking, you can do it as follows:
94+
You can customize the backend of the Ansys Tools Visualization Interface plotter to enable or turn off certain functionalities. The following code shows how to enable picking:
9895

9996
.. code-block:: python
10097
@@ -112,8 +109,8 @@ if you want to enable picking, you can do it as follows:
112109
# Show the plotter
113110
pl.show()
114111
115-
If you want to go further and customize the backend even more, you can create your own backend by inheriting from the ``PyVistaBackendInterface`` class
116-
and implementing the required methods. You can find more information about this in the backend documentation:
112+
If you want to customize the backend even more, you can create your own backend by inheriting from the ``PyVistaBackendInterface`` class
113+
and implementing the required methods:
117114

118115
.. code-block:: python
119116
@@ -124,9 +121,9 @@ and implementing the required methods. You can find more information about this
124121
Parameters
125122
----------
126123
plottable_object : Any
127-
One or more objects to add.
124+
One or more objects plot.
128125
name_filter : str, default: None.
129-
Regular expression with the desired name or names to include in the plotter.
126+
Regular expression with the desired name or names to include in the plotter.
130127
**plotting_options : dict, default: None
131128
Keyword arguments. For allowable keyword arguments, see the
132129
:meth:`Plotter.add_mesh <pyvista.Plotter.add_mesh>` method.
@@ -142,7 +139,7 @@ and implementing the required methods. You can find more information about this
142139
Parameters
143140
----------
144141
plottable_object : Any
145-
Object to add.
142+
Object to plot.
146143
name_filter : str
147144
Regular expression with the desired name or names to include in the plotter.
148145
**plotting_options : dict, default: None
@@ -154,18 +151,18 @@ and implementing the required methods. You can find more information about this
154151
155152
156153
The rest of the methods are implemented for you. This ensures that while you can customize what you need for plotting, the rest of the functionalities still work as expected.
157-
If you need to even go further, you can also create your own plotter by inheriting from the ``BaseBackend`` class and implementing the required methods,
154+
If you need to even go further, you can create your own plotter by inheriting from the ``BaseBackend`` class and implementing the required methods,
158155
although this may break existing features. You can find more information about this in the plotter documentation.
159156

160157
Customize the picker or hover behavior
161158
--------------------------------------
162-
You can customize the picker of the Ansys Tools Visualization Interface plotter to decide what happens when an object is picked or hovered.
159+
You can customize the picker of the Ansys Tools Visualization Interface plotter to decide what happens when you pick or hover over an object.
163160
For example, if you want to print the name of the picked object, you can do it as described in the custom picker example.
164161

165-
Using PyVista Qt backend
166-
------------------------
167-
You can use the PyVista Qt backend with the Ansys Tools Visualization Interface plotter. To do this, you need to set the PyVista backend to Qt
168-
before creating the plotter. Here is an example of how to do this:
162+
Use the PyVista Qt backend
163+
--------------------------
164+
You can use the PyVista Qt backend with the Ansys Tools Visualization Interface plotter. To do this, you must set the PyVista backend to Qt
165+
before creating the plotter:
169166

170167
.. code-block:: python
171168
@@ -176,14 +173,14 @@ before creating the plotter. Here is an example of how to do this:
176173
pl.backend.enable_widgets()
177174
pv_backend.scene.show()
178175
179-
With this, you can integrate the plotter into a PyQt or PySide app by disabling ``show_qt`` parameter.
180-
You can find more information about this in the `PyVista documentation <https://qtdocs.pyvista.org/>`_.
176+
You can then integrate the plotter into a PyQt or PySide app by disabling the ``show_qt`` parameter.
177+
For more information about this, see the `PyVista documentation <https://qtdocs.pyvista.org/>`_.
181178

182179

183-
Documentation migration guide
184-
=============================
180+
Documentation configuration migration
181+
=====================================
185182

186-
This guide is intended to help users transition from PyVista documentation configuration to the new Ansys Tools Visualization Interface documentation configuration.
183+
This topic explains how to migrate from the PyVista documentation configuration to the new Ansys Tools Visualization Interface documentation configuration.
187184

188185
1. Add environment variables for documentation:
189186

0 commit comments

Comments
 (0)