Skip to content

Commit ef56179

Browse files
committed
Update docstring of field.plot()
1 parent c65c1fe commit ef56179

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

src/ansys/dpf/core/field.py

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,21 @@
2222

2323
"""Field."""
2424

25+
from __future__ import annotations
26+
27+
from typing import TYPE_CHECKING
28+
2529
import numpy as np
2630

2731
from ansys import dpf
2832
from ansys.dpf.core import dimensionality, errors, meshed_region, scoping, time_freq_support
29-
from ansys.dpf.core.common import _get_size_of_list, locations, natures, types
33+
from ansys.dpf.core.common import (
34+
_get_size_of_list,
35+
locations,
36+
natures,
37+
shell_layers as eshell_layers,
38+
types,
39+
)
3040
from ansys.dpf.core.field_base import _FieldBase, _LocalFieldBase
3141
from ansys.dpf.core.field_definition import FieldDefinition
3242
from ansys.dpf.gate import (
@@ -37,6 +47,11 @@
3747
field_grpcapi,
3848
)
3949

50+
if TYPE_CHECKING:
51+
from ansys.dpf.core.dpf_operator import Operator
52+
from ansys.dpf.core.meshed_region import MeshedRegion
53+
from ansys.dpf.core.results import Result
54+
4055

4156
class Field(_FieldBase):
4257
"""Represents the main simulation data container.
@@ -501,7 +516,12 @@ def to_nodal(self):
501516
return op.outputs.field()
502517

503518
def plot(
504-
self, shell_layers=None, deform_by=None, scale_factor=1.0, meshed_region=None, **kwargs
519+
self,
520+
shell_layers: eshell_layers = None,
521+
deform_by: Union[Field, Result, Operator] = None,
522+
scale_factor: float = 1.0,
523+
meshed_region: MeshedRegion = None,
524+
**kwargs,
505525
):
506526
"""Plot the field or fields container on the mesh support if it exists.
507527
@@ -524,15 +544,14 @@ def plot(
524544
525545
Parameters
526546
----------
527-
shell_layers : shell_layers, optional
547+
shell_layers:
528548
Enum used to set the shell layers if the model to plot
529-
contains shell elements. The default is ``None``.
530-
deform_by : Field, Result, Operator, optional
549+
contains shell elements. Defaults to the top layer.
550+
deform_by:
531551
Used to deform the plotted mesh. Must output a 3D vector field.
532-
Defaults to None.
533-
scale_factor : float, optional
534-
Scaling factor to apply when warping the mesh. Defaults to 1.0.
535-
**kwargs : optional
552+
scale_factor:
553+
Scaling factor to apply when warping the mesh.
554+
**kwargs:
536555
Additional keyword arguments for the plotter. For additional keyword
537556
arguments, see ``help(pyvista.plot)``.
538557
"""

0 commit comments

Comments
 (0)