ansys / pydpf-post

Data Processing Framework - Post Processing Module
https://post.docs.pyansys.com
MIT License
43 stars 10 forks source link

Remove restraint of vtk<9.1.0 #132

Closed PProfizi closed 2 years ago

PProfizi commented 2 years ago

Solves #107

codecov[bot] commented 2 years ago

Codecov Report

Merging #132 (dcabaab) into master (2142edc) will increase coverage by 0.01%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
+ Coverage   82.80%   82.81%   +0.01%     
==========================================
  Files          26       26              
  Lines        1407     1408       +1     
==========================================
+ Hits         1165     1166       +1     
  Misses        242      242              
PProfizi commented 2 years ago

Windows fatal exception: access violation

Thread 0x000006e8 (most recent call first): File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\pyvista\plotting\plotting.py", line 1470 in renderWindows fatal exception: access violation File

"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\pyvista\plotting\plotting.py", line 5533 in show File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\ansys\dpf\core\plotter.py", line 780 in plot_contour File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\ansys\dpf\post\result_data.py", line 352 in plot_contour File "<doctest post.result_data.ResultData.plot_contour[5]>", line 1 in File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\doctest.py", line 1334 in __run File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\doctest.py", line 1481 in run File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\doctest.py"D:\a_temp\aaa44f51-9ba7-41ce-b862-69b1d7ff185f.sh: line 3: 58 Segmentation fault pytest --doctest-modules $DEBUG --junitxml=junit/test-doctests-results.xml ansys/dpf/post ansys/dpf/post/result_data.py::post.result_data.ResultData.plot_contour Error: Process completed with exit code 139.

RobPasMue commented 2 years ago

I am guessing your VTK dependency is because of PyVista right? Are you using VTK explicitly in some place? I think @akaszynski can weigh in better than anybody here. I know that VTK (as of released packages - i.e. not beta versions or release candidates) is not yet supported on Python 3.10 and they have some PyVista wheels for this specific case.. He'll probably have more info than anyone else.

PProfizi commented 2 years ago

Indeed, we do not use vtk directly, only through PyVista. So what you are saying is that when using pyvista on Python 3.10 we cannot simply pip install?

Here the problem is not about Python 3.10, but when using vtk==9.1.0 for Pythons 3.7 to 3.9, where we get a memory error on Windows, although I could not replicate the issue locally. I am guessing it has something to do with the specific windows installation of the github runners.

RobPasMue commented 2 years ago

No, what I meant was that @akaszynski provided some specific VTK wheels for 9.1.0 and Python 3.10 in the PyVista project, as far as I am aware of. Follow the link: https://github.com/pyvista/pyvista/discussions/2064

I am seeing though you are having problems with other Python versions now... The output on the runners is limited though. Are you getting more info locally? Or does it work just fine? Try running everything from a clean virtual env. Maybe that gives you more info on the error. Though I am sure you must have tried it already.

akaszynski commented 2 years ago

This issue occurs on Windows when using the OSMesa opengl on windows. This shouldn't be an issue on linux.

akaszynski commented 2 years ago

Indeed, we do not use vtk directly, only through PyVista. So what you are saying is that when using pyvista on Python 3.10 we cannot simply pip install?

Here the problem is not about Python 3.10, but when using vtk==9.1.0 for Pythons 3.7 to 3.9, where we get a memory error on Windows, although I could not replicate the issue locally. I am guessing it has something to do with the specific windows installation of the github runners.

I'm going to have to review and improve patch this.

PProfizi commented 2 years ago

We are using a pyvista github action to prepare the headless display in our CI. (pyvista/setup-headless-display-action@v1) For anyone else other than Alex, this indeed means this script is used which installs a MesaOpenGL opengl32_mingw_64.dll for rendering.

PProfizi commented 2 years ago

Hi @akaszynski, any updates on this issue?

akaszynski commented 2 years ago

Hi @akaszynski, any updates on this issue?

On my (growing) todo list.

akaszynski commented 2 years ago

Fix was simply to install vtk<=9.1 for windows. There's an issue with OSMesa for VTK on Windows with vtk>=9.1.0 and this is very rarely used by users (batch processing is on linux typically), so I see no issue with just installing the older version until this is fixed upstream.

akaszynski commented 2 years ago

Identified the minimum reproducible error: https://github.com/pyvista/pyvista/issues/3185

PProfizi commented 2 years ago

Tried using the same trick for doctest, yet it does not work for Python 3.10 (see here). Keeping the skip of doctest for plot_contour for now.