Skip to content

Comments

feat: support viz interface#2881

Open
moe-ad wants to merge 34 commits intomainfrom
feat/support-viz-interface
Open

feat: support viz interface#2881
moe-ad wants to merge 34 commits intomainfrom
feat/support-viz-interface

Conversation

@moe-ad
Copy link
Collaborator

@moe-ad moe-ad commented Jan 5, 2026

Closes #2841.

Summary of changes

  • To prevent direct coupling between the plotter that has to be implemented and viz-interface's plotter backends, we had to propose a couple of backend agnostic customization APIs in the viz-interface. For more context regarding that, see:
  • A _VisualizationInterfacePlotter class has been added. Since viz's PlotlyBackend doesn't support volumetric meshes like the PyVistaBackend does, we are plugging pydpf-core's plotter to only the latter.
  • We still can't deprecate the now legacy _PyVistaPlotter yet, since other classes like Plotter and Animator depends on it. Once those are gradually phased out via separate PRs in the future, we will eventually be able to deprecate _PyVistaPlotter.
  • Because of the previous point, the plotter factory has been parametrized with a plotter_type argument that can be one of PLOTTER_TYPE_VISUALIZATION_INTERFACE, PLOTTER_TYPE_PYVISTA, and PLOTTER_TYPE_AUTO. The behavior is as follows:
    • PLOTTER_TYPE_AUTO is the default. This will select the new plotter or the legacy plotter depending on which one is available in the users environment. This guarantees that user plotting scripts won't automatically start breaking if they update pydpf-core without updating it's plotting dependencies.
    • PLOTTER_TYPE_PYVISTA will select the legacy plotter and PLOTTER_TYPE_VISUALIZATION_INTERFACE will select the new plotter.
  • Other miscellaneous updates made in doc/sphinx_gallery_examples/06-plotting/07-plot_on_geometries.py and src/ansys/dpf/core/meshed_region.py

@PProfizi and @jorgepiloto, this is now ready for review.

Warning

Before merging, change the version specifier of ansys-tools-visualization-interface to a released version and not a branch. @AlejandroFernandezLuces will soon make a pre-release that we can point to.

@moe-ad moe-ad self-assigned this Jan 5, 2026
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 10.75269% with 249 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.84%. Comparing base (b3d5b74) to head (361d3f6).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2881      +/-   ##
==========================================
- Coverage   46.75%   45.84%   -0.92%     
==========================================
  Files          92       92              
  Lines       10948    11218     +270     
==========================================
+ Hits         5119     5143      +24     
- Misses       5829     6075     +246     

@moe-ad moe-ad marked this pull request as ready for review February 8, 2026 18:51
@moe-ad moe-ad added the deploy-pr-doc For deploying a PR's documentation label Feb 10, 2026
@github-actions
Copy link
Contributor

The documentation for this pull request will be available at https://dpf.docs.pyansys.com/pull/2881. Please allow some time for the documentation to be deployed.

@moe-ad moe-ad force-pushed the feat/support-viz-interface branch from aeecf99 to 1ae98e5 Compare February 18, 2026 08:58
@PProfizi
Copy link
Contributor

Hi @moe-ad I see broken images in the tutorials, is it just for me?

"""

def __init__(self, **kwargs):
def __init__(self, plotter_type=PLOTTER_TYPE_AUTO, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would allow for the plotter_type to be plotter_type: str | enum. This way, users avoid performing an import. You can have a look to a similar approach in here ansys/pystk#928

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of using an Enum to enforce possible types. Thanks for the suggestion.

PS: users don't have to perform an import with the current implementation if they don't want to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 736901f.

@moe-ad
Copy link
Collaborator Author

moe-ad commented Feb 19, 2026

@PProfizi I am seeing it too. Let's see if the ongoing CI run fixes it. Otherwise I will investigate locally.

Edit: fixed in #2995. The cause is not related to the changes here.

@moe-ad moe-ad requested a review from jorgepiloto February 23, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-pr-doc For deploying a PR's documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update plotting modules to support ansys-tools-visualization-interface.

3 participants