Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 30, 2024
1 parent 15bc732 commit 3e7af1d
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/ansys/mapdl/core/plotting/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,25 @@

class MapdlPlotterBackend(PyVistaBackendInterface):
"""Plotter class for PyMapdl.
This class is an implementation of the PlotterInterface class from the ansys-visualizer package.
Picker is implemented in PyMAPDL specific classes due to the characteristics of the library.
Parameters
----------
use_trame : bool, optional
Whether to use the trame interface or not, by default False.
theme : pv.DefaultTheme, optional
_description_, by default None1
"""

def __init__(self, use_trame: bool = False, plot_picked_names: bool = True, **plotter_kwargs):

def __init__(
self, use_trame: bool = False, plot_picked_names: bool = True, **plotter_kwargs
):
"""Initialize the MapdlPlotter class."""
super().__init__(use_trame=use_trame, plot_picked_names=plot_picked_names, **plotter_kwargs)
super().__init__(
use_trame=use_trame, plot_picked_names=plot_picked_names, **plotter_kwargs
)

def plot_iter(
self,
Expand All @@ -68,11 +72,18 @@ def plot_iter(
def plot(self, object: Any, filter: str = None, **plotting_options):
self.pv_interface.plot(object, filter, **plotting_options)

def show(self, object: Any = None, screenshot: str = None, filter: bool = None, **plotting_options):
def show(
self,
object: Any = None,
screenshot: str = None,
filter: bool = None,
**plotting_options,
):
if object is not None:
self.plot(object, filter, **plotting_options)
self.pv_interface.show(screenshot=screenshot, **plotting_options)


class MapdlPlotter(Plotter):
"""Plotter class for PyMapdl.
Expand Down Expand Up @@ -109,7 +120,9 @@ def add_labels(
labels : List[str]
List of labels to be added.
"""
_ = self._backend.pv_interface.scene.add_point_labels(points, labels, **plotting_options)
_ = self._backend.pv_interface.scene.add_point_labels(
points, labels, **plotting_options
)

def add_points(self, points: Iterable[float], **plotting_options) -> None:
"""Add points to the plotter.
Expand Down

0 comments on commit 3e7af1d

Please sign in to comment.