Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pyvista from 0.35.1 to 0.35.2 #313

Merged
merged 5 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ansys/dpf/core/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ def get_label_at_grid_point(index):
bound_method=self._plotter.add_point_labels,
**kwargs
)
import pyvista.core.pointset as pointset
# The scalar data used will be the one of the last field added.
for data_set in self._plotter._datasets:
if type(data_set) is pointset.UnstructuredGrid:
active_scalars = data_set.active_scalars
# For all grid_points given
for index, grid_point in enumerate(grid_points):
# Check for existing label at that point
Expand All @@ -141,7 +146,8 @@ def get_label_at_grid_point(index):
[labels[index]],
**kwargs_in))
else:
scalar_at_index = meshed_region.grid.active_scalars[node_indexes[index]]
# Otherwise, get the value of the current scalar field
scalar_at_index = active_scalars[node_indexes[index]]
scalar_at_grid_point = f"{scalar_at_index:.2f}"
label_actors.append(self._plotter.add_point_labels(grid_point,
[scalar_at_grid_point],
Expand Down Expand Up @@ -331,7 +337,7 @@ def labels(self):
return self._labels

def add_node_labels(self, nodes, meshed_region, labels=None, **kwargs):
"""Add labels at the nodal locations.
"""Add labels at the nodal locations for the last added field.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pypandoc==1.8.1
matplotlib==3.5.2
vtk<9.1.0
pyvista==0.35.1
pyvista==0.35.2
imageio==2.19.5
imageio-ffmpeg==0.4.7
Sphinx==5.1.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ pytest-cov==3.0.0
pytest-rerunfailures==10.2
matplotlib==3.5.2
vtk==9.0.3
pyvista==0.35.1
pyvista==0.35.2
ansys-platform-instancemanagement==1.0.2
coverage==6.4.2