Skip to content

chore: graphics target #820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

chore: graphics target #820

wants to merge 6 commits into from

Conversation

moe-ad
Copy link

@moe-ad moe-ad commented Apr 1, 2025

Closes #818

@moe-ad moe-ad self-assigned this Apr 1, 2025
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.12%. Comparing base (86c9540) to head (340e854).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #820   +/-   ##
=======================================
  Coverage   85.12%   85.12%           
=======================================
  Files          52       52           
  Lines        5210     5210           
=======================================
  Hits         4435     4435           
  Misses        775      775           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@moe-ad
Copy link
Author

moe-ad commented Apr 3, 2025

examples/03-Cyclic-Examples/05-modal_cyclic_no_expansion.py is the cause of the failing jobs. Weird, that file wasn't changed.

Edit: it seems the problem is from the dpf core repo.

@moe-ad
Copy link
Author

moe-ad commented Apr 3, 2025

Seems like it might be related to changes made in ansys/pydpf-core#2161.

@rafacanton @PProfizi please can you confirm this assessment?

@moe-ad moe-ad marked this pull request as draft April 3, 2025 16:08
@rafacanton
Copy link
Contributor

Seems like it might be related to changes made in ansys/pydpf-core#2161.

@rafacanton @PProfizi please can you confirm this assessment?

Yes, correct. We should implement a similar change here. @oparreno, can you handle this? Thanks!

@moe-ad
Copy link
Author

moe-ad commented Apr 4, 2025

@rafacanton Thanks!

@oparreno
Copy link
Contributor

oparreno commented Apr 4, 2025

@rafacanton, @moe-ad, I'm afraid this is a server bug since I don't see any usage of the same operators as the last change I did on pydpf-core.
@laurent-ge, told me about an issue with some cyclic results requested on elemental location. Is this the same case?

@laurent-ge
Copy link

I indeed noticed a test failure for this DPF Post example (05-modal_cyclic_no_expansion)

Here on the print, these 3 columns circled in red did not appear before.
image

Then we get an error at to_elemental.plot()

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[7], line 9
      5 to_elemental = simulation.stress_elemental(
      6     set_ids=[7], expand_cyclic=[1], phase_angle_cyclic=45.0
      7 )
      8 print(to_elemental)
----> 9 to_elemental.plot()

File [c:\ANSYSDev\dpf_py_venv\lib\site-packages\ansys\dpf\post\dataframe.py:876](file:///C:/ANSYSDev/dpf_py_venv/lib/site-packages/ansys/dpf/post/dataframe.py:876), in DataFrame.plot(self, shell_layer, **kwargs)
    872     field_to_plot = dpf.operators.math.norm(
    873         field_to_plot, server=field_to_plot._server
    874     ).eval()
    875 plotter = DpfPlotter(**kwargs)
--> 876 plotter.add_field(field=field_to_plot, **kwargs)
    878 return plotter.show_figure(
    879     title=kwargs.pop("title", str(label_space)), **kwargs
    880 )

File [c:\ANSYSDev\dpf_py_venv\lib\site-packages\ansys\dpf\core\plotter.py:667](file:///C:/ANSYSDev/dpf_py_venv/lib/site-packages/ansys/dpf/core/plotter.py:667), in DpfPlotter.add_field(self, field, meshed_region, show_max, show_min, label_text_size, label_point_size, deform_by, scale_factor, shell_layer, **kwargs)
    613 def add_field(
    614     self,
    615     field,
   (...)
    624     **kwargs,
    625 ):
    626     """Add a field containing data to the plotter.
    627 
    628     A meshed_region to plot on can be added.
   (...)
    665 
    666     """
--> 667     self._internal_plotter.add_field(
    668         field=field,
    669         meshed_region=meshed_region,
    670         show_max=show_max,
    671         show_min=show_min,
    672         label_text_size=label_text_size,
    673         label_point_size=label_point_size,
    674         deform_by=deform_by,
    675         scale_factor=scale_factor,
    676         as_linear=True,
    677         shell_layer=shell_layer,
    678         **kwargs,
    679     )

File [c:\ANSYSDev\dpf_py_venv\lib\site-packages\ansys\dpf\core\plotter.py:280](file:///C:/ANSYSDev/dpf_py_venv/lib/site-packages/ansys/dpf/core/plotter.py:280), in _PyVistaPlotter.add_field(self, field, meshed_region, show_max, show_min, label_text_size, label_point_size, deform_by, scale_factor, scale_factor_legend, as_linear, shell_layer, **kwargs)
    278     mesh_location = meshed_region.elements
    279 else:
--> 280     raise ValueError("Only elemental, nodal or faces location are supported for plotting.")
    282 # Treat multilayered shells
    283 if not isinstance(shell_layer, eshell_layers):

ValueError: Only elemental, nodal or faces location are supported for plotting.

@laurent-ge
Copy link

laurent-ge commented Apr 11, 2025

Hi @moe-ad @rafacanton @oparreno @PProfizi
FYI I just created a bug in the server about the failure in this example.

@PProfizi PProfizi marked this pull request as ready for review April 28, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change plotting target for graphics target
5 participants