Conversation
Codecov Report❌ Patch coverage is 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 |
|
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. |
aeecf99 to
1ae98e5
Compare
|
Hi @moe-ad I see broken images in the tutorials, is it just for me? |
src/ansys/dpf/core/plotter.py
Outdated
| """ | ||
|
|
||
| def __init__(self, **kwargs): | ||
| def __init__(self, plotter_type=PLOTTER_TYPE_AUTO, **kwargs): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Closes #2841.
Summary of changes
_VisualizationInterfacePlotterclass has been added. Since viz'sPlotlyBackenddoesn't support volumetric meshes like thePyVistaBackenddoes, we are pluggingpydpf-core's plotter to only the latter._PyVistaPlotteryet, since other classes likePlotterandAnimatordepends on it. Once those are gradually phased out via separate PRs in the future, we will eventually be able to deprecate_PyVistaPlotter.plotter_typeargument that can be one ofPLOTTER_TYPE_VISUALIZATION_INTERFACE,PLOTTER_TYPE_PYVISTA, andPLOTTER_TYPE_AUTO. The behavior is as follows:PLOTTER_TYPE_AUTOis 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 updatepydpf-corewithout updating it's plotting dependencies.PLOTTER_TYPE_PYVISTAwill select the legacy plotter andPLOTTER_TYPE_VISUALIZATION_INTERFACEwill select the new plotter.doc/sphinx_gallery_examples/06-plotting/07-plot_on_geometries.pyandsrc/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.