ansys / pyaedt

AEDT Python Client Package
https://aedt.docs.pyansys.com
MIT License
185 stars 101 forks source link

FIX: AEDT port value in create_session #4870

Closed SMoraisAnsys closed 3 days ago

SMoraisAnsys commented 5 days ago

This is an attempt to fix #4844.

@maxcapodi78 The main change is that we both handle None and 0 as the same kind of result. Indeed, 0 seems to be the default value obtained if _desktop_sessions is empty. Note that I'm not sure if, in the case of existing desktop sessions, we shouldn't use directly client.root.check_port() to define cl.aedt_port directly. Also, I was wondering how we could try to leverage _desktop_sessions from pyaedt.generic.desktop_sessions but I have the feeling that this shouldn't be updated unless a Desktop is created (which isn't performed right through the call create_session right ?)

ansys-reviewer-bot[bot] commented 5 days ago

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.14%. Comparing base (df9b411) to head (0ae2cfa). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4870 +/- ## ========================================== - Coverage 83.15% 83.14% -0.02% ========================================== Files 118 118 Lines 54080 54080 ========================================== - Hits 44971 44965 -6 - Misses 9109 9115 +6 ```
SMoraisAnsys commented 4 days ago

@nathmay could you give a try at this fix ? I tested locally and it seems to be working fine.