Skip to content

Model.plot cannot return anything 😭 #197

@jfthuong

Description

@jfthuong

The function Model.plot cannot return any result, unlike its cousin from pyvista:
https://docs.pyvista.org/api/plotting/_autosummary/pyvista.plot.html

In particular, we can have 3 types of results:

  • return_img: for returning a np-array
  • return_cpos: for returning camera position
  • return_viewer: for returning a jupyterlab viewer, scene, or display object when plotting with jupyter notebook

We need to replace:

        self.metadata.meshed_region.grid.plot(
            color=color, show_edges=show_edges, **kwargs
        )

by

        return self.metadata.meshed_region.grid.plot(
            color=color, show_edges=show_edges, **kwargs
        )

... i.e. adding a return 🧙‍♂️

Also, we could a link to Pyvista doc in pydpf doc (https://dpfdocs.pyansys.com/api/ansys.dpf.core.model.html?highlight=plot#ansys.dpf.core.model.Model.plot)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions