ansys / pymechanical

Pythonic interface to Ansys Mechanical
https://mechanical.docs.pyansys.com/
MIT License
29 stars 13 forks source link

fix pythonnet issue #772

Closed koubaa closed 1 week ago

koubaa commented 2 weeks ago

This fixes the nightly runs issue. It's a weird failure mode...

I added the event handlers for updating the globals which doesn't work when running on pythonnet. Since this happens in the constructor, this will throw an exception and the atexit handler will be called, which also throws an exception. Apparently, this will cause the asyncio-based subprocess handling to hang. I'm not sure why this only seems to affect 242...

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.99%. Comparing base (178107b) to head (6c32284).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #772 +/- ## ========================================== - Coverage 81.01% 80.99% -0.03% ========================================== Files 32 32 Lines 2012 2015 +3 ========================================== + Hits 1630 1632 +2 - Misses 382 383 +1 ```
koubaa commented 2 weeks ago

This was ready to merge, but I'm keeping it open until I look further into why this didn't cause any issues in 241. I'd have expected it to.

koubaa commented 1 week ago

241: https://github.com/ansys/pymechanical/actions/runs/9551990561/job/26327687609?pr=772 242: https://github.com/ansys/pymechanical/actions/runs/9550352583/job/26322107742

Before the fix, it is not clear why 242 hangs on shutdown but 241 does not. I will test the engrdata serial option

koubaa commented 1 week ago

It is not related to the serial option for engineering data, so I don't know the cause. Merging the fix as-is