Skip to content

Commit adcee6d

Browse files
fix: Off screen testing mode and fix version getter (#51)
1 parent 7102984 commit adcee6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ansys/tools/visualization_interface/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222
"""Visualization Interface Tool is a Python client library for visualizing the results of Ansys simulations."""
23+
import importlib.metadata as importlib_metadata
2324
import os
2425

25-
import pkg_resources
26-
27-
__version__ = pkg_resources.get_distribution("ansys-tools-visualization-interface").version
26+
__version__ = importlib_metadata.version(__name__.replace(".", "-"))
2827

2928
USE_TRAME: bool = False
3029
DOCUMENTATION_BUILD: bool = False

src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def __init__(
7474
# Generate custom scene if ``None`` is provided
7575
if scene is None:
7676
scene = pv.Plotter(plotter_kwargs)
77-
77+
if TESTING_MODE:
78+
scene.off_screen = True
7879
# If required, use a white background with no gradient
7980
if not color_opts:
8081
color_opts = dict(color="white")

0 commit comments

Comments
 (0)