dvexporter
SliceType
module-attribute
labels
module-attribute
labels: Dict[str, str] = dict(
index="Index",
mixed_load_error="Mixed load error",
mixed_loads="Number of mixed loads",
integration_error="Integration error",
integrations="Number of contact integrations",
)
DVExporter
Debug variables exporter
GroupBy
class-attribute
instance-attribute
GroupBy = Union[
Mapping,
Callable,
str,
Literal[
"phase",
"step",
"mixedLoad",
"integration",
"increment",
"plasticCorrection",
"idx",
],
]
GroupStat
class-attribute
instance-attribute
_toDataFrame
_toDataFrame(field: str) -> 'DataFrame'
Get the debug information as a pandas DataFrame.
heatmap
heatmap(
x: Literal["phase", "step", "mixedLoad", "integration"] | str = "step",
y: Literal["phase", "step", "mixedLoad", "integration"] | str = "mixedLoad",
z: (
Literal[
"mixed_load_error",
"mixed_loads",
"integration_error",
"integrations",
]
| str
) = "integrations",
*,
ax: Axes | None = None,
props: dict | None = None,
**kwargs
)
Plot a heatmap of the number of steps/mixed loads/integrations
PARAMETER | DESCRIPTION |
---|---|
x
|
The x, y, z-axis to plot.
TYPE:
|
y
|
The x, y, z-axis to plot.
TYPE:
|
z
|
The x, y, z-axis to plot.
TYPE:
|
ax
|
The axes to plot on.
TYPE:
|
props
|
The properties to set on the axes.
TYPE:
|
kwargs
|
Keyword arguments passed to :meth:
DEFAULT:
|
plot
plot(
*args: str | Literal["index", "phase", "step", "mixedLoad", "integration"],
x: str | Literal["first", "auto"] = "auto",
phase: SliceType | None = None,
step: SliceType | None = None,
mixedLoad: SliceType | None = None,
integration: SliceType | None = None,
increment: SliceType | None = None,
plasticCorrection: SliceType | None = None,
idx: SliceType | None = None,
filters: dict[str, SliceType] | None = None,
col: int | None = None,
groupby: GroupBy | List[GroupBy] | None = None,
groupby_kwargs: dict | None = None,
groupby_stat: GroupStat | List[GroupStat] | Dict[str, GroupStat] = "sum",
label: str = "{x} vs {y}",
on: Plottable | None = None,
ncols: int = 2,
backend: Literal["matplotlib", "bokeh"] | None = None,
subplots_kwargs: dict | None = None,
line_kwargs: Iterable[Dict[str, Any]] | None = None,
legend_kwargs: Dict | None = None,
props: Dict[str, Any] | None = None,
bokeh_show: bool = False,
tight_layout: bool = True,
**kwargs
) -> Union["MplFigure", "BkGridPlot"]
Plot anything from the debug information providing step
, mixedLoad
, integration
, contact
and
col
filters.
Notes
The following placeholders are supported for arguments label
, kwargs
and line_kwargs
:
{x}
and{y}
for the name of the variable
PARAMETER | DESCRIPTION |
---|---|
args
|
State variables to plot. If the number of arguments is an even number, multiple curves will be plotted
with every two arguments as a pair of
TYPE:
|
x
|
Variable to plot on x-axis, by default "auto".
TYPE:
|
phase
|
The phase to get.
TYPE:
|
step
|
The step to get.
TYPE:
|
mixedLoad
|
The mixed load to get.
TYPE:
|
integration
|
The integration to get.
TYPE:
|
increment
|
The increment to get.
TYPE:
|
plasticCorrection
|
The plastic correction to get.
TYPE:
|
idx
|
The index of the integration point to get.
TYPE:
|
filters
|
Additional filters, by default None |
col
|
The value column of the array to plot.
TYPE:
|
groupby
|
The groupby parameter to group the data, by default None
TYPE:
|
groupby_kwargs
|
Keyword arguments for the groupby function, by default None
TYPE:
|
groupby_stat
|
The statistic method to use for the groupby, by default "sum"
TYPE:
|
label
|
The label of the plot, by default "{x} vs {y}"
TYPE:
|
on
|
The axes to plot on. If not given, a new figure is created by calling :func:
TYPE:
|
ncols
|
Number of columns in the figure grid, by default 2
TYPE:
|
backend
|
Backend to use, by default None which means the backend set in the environment variable
TYPE:
|
subplots_kwargs
|
Keyword arguments for creating the subplots, by default None
TYPE:
|
line_kwargs
|
Line-specific keyword arguments, by default None |
legend_kwargs
|
Keyword arguments for the legend, by default None
TYPE:
|
props
|
The properties to set on the axes.
TYPE:
|
bokeh_show
|
Whether to show the figure in the browser, by default False
TYPE:
|
tight_layout
|
Whether to use tight layout in the matplotlib figure, by default True
TYPE:
|
kwargs
|
Keyword arguments passed to :meth:
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
Figure | GridPlot
|
The matplotlib figure or bokeh gridplot |
toDataFrame
toDataFrame(
field: str,
*,
phase: SliceType | None = None,
step: SliceType | None = None,
mixedLoad: SliceType | None = None,
integration: SliceType | None = None,
increment: SliceType | None = None,
plasticCorrection: SliceType | None = None,
idx: SliceType | None = None,
**kwargs
) -> "DataFrame"
Get the debug information as a pandas DataFrame with filters. The data is stored in the field column for scalar fields. The filter parameters are used to filter the data, if an integer smaller than 0 is given, it will be converted to the maximum value of the index.
PARAMETER | DESCRIPTION |
---|---|
field
|
The name of the field to get.
TYPE:
|
phase
|
The phase to get.
TYPE:
|
step
|
The step to get.
TYPE:
|
mixedLoad
|
The mixed load to get.
TYPE:
|
integration
|
The integration to get.
TYPE:
|
increment
|
The increment to get.
TYPE:
|
plasticCorrection
|
The plastic correction to get.
TYPE:
|
idx
|
The index of the integration point to get.
TYPE:
|
kwargs
|
Additional filters.
DEFAULT:
|