diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 8951320166..8862d27296 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 cb5690c2d7..36b7ce04de 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 diff --git a/src/ansys/dpf/core/helpers/utils.py b/src/ansys/dpf/core/helpers/utils.py index 55ae77300b..5d9c31562c 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 diff --git a/src/ansys/dpf/core/vtk_helper.py b/src/ansys/dpf/core/vtk_helper.py index d40913f5dc..c75c27190d 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