ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
426 stars 120 forks source link

Missing argument in plot_nodal_disp function? #345

Closed TonggeWu94 closed 3 years ago

TonggeWu94 commented 3 years ago

Please see the function definition and function call in the example. There is no show_displacement argument, cannot even find it in the general plotter function as a keyword argument.

https://github.com/pyansys/pymapdl/blob/4f498c1b0416971db38ff8b1c5b2cd40ca75b157/ansys/mapdl/core/post.py#L246-L255 https://github.com/pyansys/pymapdl/blob/4f498c1b0416971db38ff8b1c5b2cd40ca75b157/examples/00-mapdl-examples/pyvista_mesh.py#L60-L69 https://github.com/pyansys/pymapdl/blob/4f498c1b0416971db38ff8b1c5b2cd40ca75b157/ansys/mapdl/core/plotting.py#L8-L27

akaszynski commented 3 years ago

Thanks for pointing this out.

The issue is that we're using **kwargs for show_displacement as I don't want to duplicate all the signatures, but I've neglected to include documentation for the kwarg in the documentation anywhere. I'll patch this.

TonggeWu94 commented 3 years ago

Emm, it seems like this show_displacement is not recognized as keyword argument?

Traceback (most recent call last):
  File "main-ver2.py", line 43, in <module>
    contaLibrary = myContaLibrary)
  File "U:\D16X\couponBendingPyANSYS\debug11\binFunction.py", line 738, in PyANSYSSolve
    PyANSYSSolvePreview(mapdl, option = 'nodeTotalStrain')
  File "U:\D16X\couponBendingPyANSYS\debug11\binFunction.py", line 418, in PyANSYSSolvePreview
    cpos = 'xy')
  File "C:\Anaconda\lib\site-packages\ansys\mapdl\core\post.py", line 951, in plot_nodal_total_component_strain
    **kwargs)
  File "C:\Anaconda\lib\site-packages\ansys\mapdl\core\post.py", line 317, in _plot_point_scalars
    return general_plotter('MAPDL Displacement', meshes, [], labels, **kwargs)
TypeError: general_plotter() got an unexpected keyword argument 'show_displacement'
akaszynski commented 3 years ago

Emm, it seems like this show_displacement is not recognized as keyword argument?

You're correct, I didn't pass this to the other plotting methods, it's just there for plot_nodal_displacement and it's completely missing within the general plotter. Now that I think of it, adding in displacement might not be as straightforward as I hoped since I'll have to request the displacement results as well as the current results being plotted. I'll see if I can get to this over the weekend.

TonggeWu94 commented 3 years ago

resolved, Thanks!