From 806d6c25f6b49c5ab0359d34fb052e63a66576ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 04:55:33 +0000 Subject: [PATCH 1/3] build(deps): bump pyvista from 0.45.3 to 0.46.0 in /requirements Bumps [pyvista](https://github.com/pyvista/pyvista) from 0.45.3 to 0.46.0. - [Release notes](https://github.com/pyvista/pyvista/releases) - [Commits](https://github.com/pyvista/pyvista/compare/v0.45.3...v0.46.0) --- updated-dependencies: - dependency-name: pyvista dependency-version: 0.46.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements/requirements_docs.txt | 2 +- requirements/requirements_test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 8951320166b..8862d272962 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -7,7 +7,7 @@ jupyter_sphinx==0.5.3 nbsphinx==0.9.5 pypandoc==1.15 pytest-sphinx==0.6.3 -pyvista==0.45.3 +pyvista==0.46.0 sphinx==8.2.3 sphinx-copybutton==0.5.2 sphinx-gallery==0.19.0 diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index cb5690c2d71..36b7ce04dea 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -8,5 +8,5 @@ pytest==8.4.1 pytest-cov==6.2.1 pytest-order==1.3.0 pytest-rerunfailures==15.0 -pyvista==0.45.3 +pyvista==0.46.0 vtk==9.4.2 From 5aee92d60812068acc9084fb89d2616a195360d9 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 6 Aug 2025 10:06:26 +0200 Subject: [PATCH 2/3] Fix call to settattr, switch to pv.set_new_attribute --- src/ansys/dpf/core/vtk_helper.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ansys/dpf/core/vtk_helper.py b/src/ansys/dpf/core/vtk_helper.py index d40913f5dc6..c75c27190d4 100644 --- a/src/ansys/dpf/core/vtk_helper.py +++ b/src/ansys/dpf/core/vtk_helper.py @@ -185,12 +185,18 @@ def dpf_mesh_to_vtk_op(mesh, nodes=None, as_linear=True): celltypes_pv = mesh_to_pyvista.outputs.cell_types() if VTK9: grid = pv.UnstructuredGrid(cells_pv, celltypes_pv, nodes_pv) - setattr(grid, "_dpf_cache_op", [cells_pv, celltypes_pv, nodes_pv]) + # setattr(grid, "_dpf_cache_op", [cells_pv, celltypes_pv, nodes_pv]) + pv.set_new_attribute( + obj=grid, name="_dpf_cache_op", value=[cells_pv, celltypes_pv, nodes_pv] + ) return grid else: offsets_pv = mesh_to_pyvista.outputs.offsets() grid = pv.UnstructuredGrid(offsets_pv, cells_pv, celltypes_pv, nodes_pv) - setattr(grid, "_dpf_cache_op", [cells_pv, celltypes_pv, nodes_pv, offsets_pv]) + # setattr(grid, "_dpf_cache_op", [cells_pv, celltypes_pv, nodes_pv, offsets_pv]) + pv.set_new_attribute( + obj=grid, name="_dpf_cache_op", value=[cells_pv, celltypes_pv, nodes_pv, offsets_pv] + ) return grid @@ -350,7 +356,10 @@ def compute_offset(): # Quick fix required to hold onto the data as PyVista does not make a copy. # All of those now return DPFArrays - setattr(grid, "_dpf_cache", [node_coordinates, coordinates_field]) + # setattr(grid, "_dpf_cache", [node_coordinates, coordinates_field]) + pv.set_new_attribute( + obj=grid, name="_dpf_cache", value=[node_coordinates, coordinates_field] + ) return grid From f17ccca0ecbc8a11a224c25398c94a63b163bf2c Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 6 Aug 2025 11:31:48 +0200 Subject: [PATCH 3/3] Fix _sort_supported_kwargs to work with new pyvista positional arguments decorator --- src/ansys/dpf/core/helpers/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/dpf/core/helpers/utils.py b/src/ansys/dpf/core/helpers/utils.py index 55ae77300b3..5d9c31562cd 100644 --- a/src/ansys/dpf/core/helpers/utils.py +++ b/src/ansys/dpf/core/helpers/utils.py @@ -34,7 +34,7 @@ def _sort_supported_kwargs(bound_method, **kwargs): warnings.simplefilter("ignore") # Get supported arguments - supported_args = inspect.getfullargspec(bound_method).args + supported_args = inspect.signature(bound_method).parameters.keys() kwargs_in = {} kwargs_not_avail = {} # Filter the given arguments