Skip to content

Commit d2c940f

Browse files
committed
doc: modified another src file
1 parent e12c744 commit d2c940f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ansys/dpf/core/plotter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import sys
3636
import numpy as np
3737
import warnings
38+
from pathlib import Path
3839
from typing import TYPE_CHECKING, List, Union
3940

4041
from ansys import dpf
@@ -1019,7 +1020,7 @@ def _plot_contour_using_vtk_file(self, fields_container, notebook=None):
10191020
# mesh_provider.inputs.data_sources.connect(self._evaluator._model.metadata.data_sources)
10201021

10211022
# create a temporary file at the default temp directory
1022-
path = os.path.join(tempfile.gettempdir(), "dpf_temp_hokflb2j9s.vtk")
1023+
path = Path(tempfile.gettempdir()) / "dpf_temp_hokflb2j9s.vtk"
10231024

10241025
vtk_export = dpf.core.Operator("vtk_export")
10251026
vtk_export.inputs.mesh.connect(self._mesh)
@@ -1028,8 +1029,8 @@ def _plot_contour_using_vtk_file(self, fields_container, notebook=None):
10281029
vtk_export.run()
10291030
grid = pv.read(path)
10301031

1031-
if os.path.exists(path):
1032-
os.remove(path)
1032+
if path.exists():
1033+
path.unlink()
10331034

10341035
names = grid.array_names
10351036
field_name = fields_container[0].name

0 commit comments

Comments
 (0)